mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 00:28:49 +00:00
Embed the SDL2 libraries into vendor:sdl2
This commit is contained in:
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
package sdl2
|
||||
|
||||
import "core:c"
|
||||
|
||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
||||
|
||||
TouchID :: distinct i64;
|
||||
FingerID :: distinct i64;
|
||||
|
||||
TouchDeviceType :: enum c.int {
|
||||
INVALID = -1,
|
||||
DIRECT, /* touch screen with window-relative coordinates */
|
||||
INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
|
||||
INDIRECT_RELATIVE, /* trackpad with screen cursor-relative coordinates */
|
||||
}
|
||||
|
||||
Finger :: struct {
|
||||
id: FingerID,
|
||||
x: f32,
|
||||
y: f32,
|
||||
pressure: f32,
|
||||
}
|
||||
|
||||
TOUCH_MOUSEID :: ~u32(0);
|
||||
MOUSE_TOUCH_ID :: TouchID(-1);
|
||||
|
||||
@(default_calling_convention="c", link_prefix="SDL_")
|
||||
foreign lib {
|
||||
GetNumTouchDevices :: proc() -> c.int ---
|
||||
GetTouchDevice :: proc(index: c.int) -> TouchID ---
|
||||
GetTouchDeviceType :: proc(touchID: TouchID) -> TouchDeviceType ---
|
||||
GetNumTouchFingers :: proc(touchID: TouchID) -> c.int ---
|
||||
GetTouchFinger :: proc(touchID: TouchID, index: c.int) -> ^Finger ---
|
||||
}
|
||||
Reference in New Issue
Block a user