mach: implement key press/release callback

This commit is contained in:
iddev5 2022-05-09 12:22:39 +05:30 committed by Stephen Gutekanst
parent 7a392b2780
commit 71b7473ee7
3 changed files with 53 additions and 0 deletions

View file

@ -2,6 +2,8 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const glfw = @import("glfw");
const gpu = @import("gpu");
const App = @import("app");
const enums = @import("enums.zig");
pub const VSyncMode = enum {
/// Potential screen tearing.
@ -68,6 +70,10 @@ timer: std.time.Timer,
pub const Core = struct {
internal: GetCoreInternalType(),
pub fn setKeyCallback(core: *Core, comptime cb: fn (app: *App, engine: *Engine, key: enums.Key, action: enums.Action) void) void {
core.internal.setKeyCallback(cb);
}
};
pub const GpuDriver = struct {