glfw: add joystick hat states

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-07-16 11:40:32 -07:00
parent 025891f0b9
commit 73055427ad
2 changed files with 18 additions and 1 deletions

16
glfw/src/hat.zig Normal file
View file

@ -0,0 +1,16 @@
//! Joystick hat states
//!
//! See glfw.getJoystickHats for how these are used.
const c = @cImport(@cInclude("GLFW/glfw3.h"));
pub const centered = C.GLFW_HAT_CENTERED;
pub const up = C.GLFW_HAT_UP;
pub const right = C.GLFW_HAT_RIGHT;
pub const down = C.GLFW_HAT_DOWN;
pub const left = C.GLFW_HAT_LEFT;
pub const right_up = right | up;
pub const right_down = right | down;
pub const left_up = left | up;
pub const left_down = left | down;