Camera controls, fix some math; lighting probably broken

This commit is contained in:
2025-11-13 17:01:10 +01:00
parent 4cbf151fd9
commit a011603195
10 changed files with 394 additions and 169 deletions

View File

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