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, }; 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))); }