summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
commitc194f59e171a1e58ce1704f37d99ffcd09a42433 (patch)
treef77a32f2c4c23b335209b8df11cc82920388b51a /src/main.cc
parent316825883c705ed0fe927c32e072f98141d3eaa3 (diff)
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.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc12
1 files changed, 11 insertions, 1 deletions
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 <GLFW/glfw3.h>
@@ -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);