glfw: ziggify all Action enums

Make the GLFW action enumerations proper Zig enums so one can use `.Name` syntax, etc.

Helps #37

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-10-29 21:22:19 -07:00 committed by Stephen Gutekanst
parent ed10bebf99
commit 8a14d56fc3
6 changed files with 49 additions and 50 deletions

View file

@ -2,11 +2,14 @@
const c = @import("c.zig").c;
/// The key or mouse button was released.
pub const release = c.GLFW_RELEASE;
/// Holds all GLFW C action enumerations in their raw form.
pub const Action = enum(c_int) {
/// The key or mouse button was released.
release = c.GLFW_RELEASE,
/// The key or mouse button was pressed.
pub const press = c.GLFW_PRESS;
/// The key or mouse button was pressed.
press = c.GLFW_PRESS,
/// The key was held down until it repeated.
pub const repeat = c.GLFW_REPEAT;
/// The key was held down until it repeated.
repeat = c.GLFW_REPEAT,
};