From c194f59e171a1e58ce1704f37d99ffcd09a42433 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 15:55:03 +0100 Subject: fix(gpu): Resolve high-DPI squished rendering and 3D shadow bugs - Implemented dynamic resolution support in all shaders and effects. - Added explicit viewport setting for all render passes to ensure correct scaling. - Fixed 3D shadow mapping by adding PLANE support and standardizing soft shadow logic. - Propagated resize events through the Effect hierarchy. - Applied project-wide code formatting. --- src/main.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index 406b900..842c174 100644 --- a/src/main.cc +++ b/src/main.cc @@ -2,12 +2,12 @@ // It serves as the application entry point. // Orchestrates platform initialization, main loop, and subsystem coordination. +#include "3d/renderer.h" #include "audio/audio.h" #include "audio/gen.h" #include "audio/synth.h" #include "generated/assets.h" // Include generated asset header #include "gpu/gpu.h" -#include "3d/renderer.h" #include "platform.h" #include "util/math.h" #include @@ -238,9 +238,19 @@ int main(int argc, char** argv) { // Start real audio audio_start(); + int last_width = platform_state.width; + int last_height = platform_state.height; + while (!platform_should_close(&platform_state)) { platform_poll(&platform_state); + if (platform_state.width != last_width || + platform_state.height != last_height) { + last_width = platform_state.width; + last_height = platform_state.height; + gpu_resize(last_width, last_height); + } + double current_time = platform_get_time() + seek_time; // Offset logic time update_game_logic(current_time); -- cgit v1.2.3