aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-02-07 08:57:21 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-02-07 08:57:21 +0000
commitcec84edcdd61e5db8f18c11b2320958f8c752541 (patch)
treec519ed730582910d8f9f20a4658c59a2fea73c55
parent3bf475deaf2ed51235d7b7f4130f7afca7abca07 (diff)
Create sdl3_system.odin
-rw-r--r--vendor/sdl3/sdl3_system.odin101
1 files changed, 101 insertions, 0 deletions
diff --git a/vendor/sdl3/sdl3_system.odin b/vendor/sdl3/sdl3_system.odin
new file mode 100644
index 000000000..44c026e82
--- /dev/null
+++ b/vendor/sdl3/sdl3_system.odin
@@ -0,0 +1,101 @@
+package sdl3
+
+import "core:c"
+
+// Windows
+
+import win32 "core:sys/windows"
+
+WindowsMessageHook :: #type proc(userdata: rawptr, msg: ^win32.MSG) -> bool
+
+@(default_calling_convention="c", link_prefix="SDL_")
+foreign lib {
+ SetWindowsMessageHook :: proc(callback: WindowsMessageHook, userdata: rawptr) ---
+ GetDirect3D9AdapterIndex :: proc(displayID: DisplayID) -> c.int ---
+ GetDXGIOutputInfo :: proc(displayID: DisplayID, adapterIndex: ^c.int, outputIndex: ^c.int) -> bool ---
+}
+
+// UNIX
+
+X11EventHook :: #type proc "c" (userdata: rawptr, xevent: rawptr /* ^xlib.XEvent */) -> bool
+
+@(default_calling_convention="c", link_prefix="SDL_")
+foreign lib {
+ SetX11EventHook :: proc(callback: X11EventHook, userdata: rawptr) ---
+}
+
+// Linux
+
+@(default_calling_convention="c", link_prefix="SDL_")
+foreign lib {
+ SetLinuxThreadPriority :: proc(threadID: Sint64, priority: c.int) -> bool ---
+ SetLinuxThreadPriorityAndPolicy :: proc(threadID: Sint64, sdlPriority: c.int, schedPolicy: c.int) -> bool ---
+}
+
+// iOS
+
+iOSAnimationCallback :: #type proc "c" (userdata: rawptr)
+
+@(default_calling_convention="c", link_prefix="SDL_")
+foreign lib {
+ SetiOSAnimationCallback :: proc(window: ^Window, interval: c.int, callback: iOSAnimationCallback, callbackParam: rawptr) -> bool ---
+ SetiOSEventPump :: proc(enabled: bool) ---
+}
+
+// Android
+
+RequestAndroidPermissionCallback :: #type proc "c" (userdata: rawptr, permission: cstring, granted: bool)
+
+
+@(default_calling_convention="c", link_prefix="SDL_", require_results)
+foreign lib {
+ GetAndroidJNIEnv :: proc() -> rawptr ---
+ GetAndroidActivity :: proc() -> rawptr ---
+ GetAndroidSDKVersion :: proc() -> c.int ---
+ IsChromebook :: proc() -> bool ---
+ IsDeXMode :: proc() -> bool ---
+ SendAndroidBackButton :: proc() ---
+ GetAndroidInternalStoragePath :: proc() -> cstring ---
+ GetAndroidExternalStorageState :: proc() -> Uint32 ---
+ GetAndroidExternalStoragePath :: proc() -> cstring ---
+ GetAndroidCachePath :: proc() -> cstring ---
+ RequestAndroidPermission :: proc(permission: cstring, cb: RequestAndroidPermissionCallback, userdata: rawptr) -> bool ---
+ ShowAndroidToast :: proc(message: cstring, duration: c.int, gravity: c.int, xoffset, yoffset: c.int) -> bool ---
+ SendAndroidMessage :: proc(command: Uint32, param: c.int) -> bool ---
+}
+
+// General
+
+Sandbox :: enum c.int {
+ NONE = 0,
+ UNKNOWN_CONTAINER,
+ FLATPAK,
+ SNAP,
+ MACOS,
+}
+
+@(default_calling_convention="c", link_prefix="SDL_", require_results)
+foreign lib {
+ IsTablet :: proc() -> bool ---
+ IsTV :: proc() -> bool ---
+ GetSandbox :: proc() -> Sandbox ---
+ OnApplicationWillTerminate :: proc() ---
+ OnApplicationDidReceiveMemoryWarning :: proc() ---
+ OnApplicationWillEnterBackground :: proc() ---
+ OnApplicationDidEnterBackground :: proc() ---
+ OnApplicationWillEnterForeground :: proc() ---
+ OnApplicationDidEnterForeground :: proc() ---
+ OnApplicationDidChangeStatusBarOrientation :: proc() ---
+}
+
+
+// GDK
+
+XTaskQueueHandle :: distinct rawptr
+XUserHandle :: distinct rawptr
+
+@(default_calling_convention="c", link_prefix="SDL_", require_results)
+foreign lib {
+ GetGDKTaskQueue :: proc(outTaskQueue: ^XTaskQueueHandle) -> bool ---
+ GetGDKDefaultUser :: proc(outUserHandle: ^XUserHandle) -> bool ---
+} \ No newline at end of file