Camera controls, fix some math; lighting probably broken
This commit is contained in:
11
src/main.zig
11
src/main.zig
@@ -47,6 +47,8 @@ fn init() callconv(.c) void {
|
||||
.logger = .{ .func = sokolLogFn },
|
||||
});
|
||||
|
||||
sapp.lockMouse(true);
|
||||
|
||||
game.init();
|
||||
}
|
||||
|
||||
@@ -66,7 +68,7 @@ fn frame() callconv(.c) void {
|
||||
.dpi_scale = sapp.dpiScale(),
|
||||
});
|
||||
|
||||
game.update(dt);
|
||||
game.update(@floatCast(dt));
|
||||
|
||||
// --- BEGIN IMGUI PASS ---
|
||||
|
||||
@@ -90,6 +92,13 @@ fn event(_ev: [*c]const sapp.Event) callconv(.c) void {
|
||||
if (ev.type == .KEY_DOWN and !ev.key_repeat) {
|
||||
game.onKeyDown(ev.key_code, ev.modifiers);
|
||||
}
|
||||
if (ev.type == .KEY_UP and !ev.key_repeat) {
|
||||
game.onKeyUp(ev.key_code, ev.modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
if (ev.type == .MOUSE_MOVE) {
|
||||
game.onMouseMove(ev.mouse_dx, ev.mouse_dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user