diff options
author | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:11:21 +0200 |
---|---|---|
committer | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:51:35 +0200 |
commit | ae44478b30d890fe0fb04022f44d474dcdcc3f9d (patch) | |
tree | 5f462459ae4b47d22114eed717d1382d08cf4dfe /sdl2/sdl2.ha |
Diffstat (limited to 'sdl2/sdl2.ha')
-rw-r--r-- | sdl2/sdl2.ha | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sdl2/sdl2.ha b/sdl2/sdl2.ha new file mode 100644 index 0000000..7035e04 --- /dev/null +++ b/sdl2/sdl2.ha @@ -0,0 +1,23 @@ +export def SDL_INIT_TIMER: uint = 0x00000001u; +export def SDL_INIT_AUDIO: uint = 0x00000010u; +export def SDL_INIT_VIDEO: uint = 0x00000020u; +export def SDL_INIT_JOYSTICK: uint = 0x00000200u; +export def SDL_INIT_HAPTIC: uint = 0x00001000u; +export def SDL_INIT_GAMECONTROLLER: uint = 0x00002000u; +export def SDL_INIT_EVENTS: uint = 0x00004000u; +export def SDL_INIT_SENSOR: uint = 0x00008000u; +export def SDL_INIT_NOPARACHUTE: uint = 0x00100000u; +export def SDL_INIT_EVERYTHING: uint = SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO + | SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC + | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR; + +@symbol("SDL_Init") fn _SDL_Init(flags: uint) int; + +// This function initializes the subsystems specified by 'flags'. +export fn SDL_Init(flags: uint) (void | error) = { + return wrapvoid(_SDL_Init(flags)); +}; + +// This function cleans up all initialized subsystems. You should call it upon +// all exit conditions. +export @symbol("SDL_Quit") fn SDL_Quit() void; |