aboutsummaryrefslogtreecommitdiffstats
path: root/src/game.c
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-10-20 10:36:48 +0000
committernathan <nathansmith@disroot.org>2025-10-20 10:36:48 +0000
commit5f402fc99a19d7d73ba75f632aed5cbef7e3920a (patch)
tree05494e50e2dbcd65835e89065637a53724acf913 /src/game.c
parent27cf645101e295671a8381447a9cd1e9244a914c (diff)
downloadFindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.tar.gz
FindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.tar.bz2
FindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.zip
Fuck ultra wide
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c49
1 files changed, 40 insertions, 9 deletions
diff --git a/src/game.c b/src/game.c
index 6166ac7..913be9c 100644
--- a/src/game.c
+++ b/src/game.c
@@ -30,6 +30,19 @@ void resetScreenScale(Game* game)
width,
height
};
+
+ // Fuck ultra-wide.
+ game->screen.ultraWideMode = renderWidth / renderHeight >= MAX_ASPECT;
+
+ if (game->screen.ultraWideMode)
+ {
+ game->screen.destination = (Rectangle){
+ renderWidth / 2.0,
+ renderHeight / 2.0,
+ renderWidth,
+ renderHeight
+ };
+ }
}
void initGame(Game* game)
@@ -78,13 +91,33 @@ void drawGameScreen(Game* game)
{
Texture texture = game->screen.render.texture;
- DrawTexturePro(
- texture,
- (Rectangle){0.0, 0.0, texture.width, -texture.height},
- game->screen.destination,
- (Vector2){0.0, 0.0},
- 0.0,
- WHITE);
+ if (game->screen.ultraWideMode)
+ {
+ BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
+ DrawTexturePro(
+ texture,
+ (Rectangle){0.0, 0.0, texture.width, -texture.height},
+ game->screen.destination,
+ (Vector2){GetRenderWidth() / 2.0, GetRenderHeight() / 2.0},
+ (int)(GetTime() * ULTRA_WIDE_SPIN_SPEED) % 360,
+ WHITE);
+ EndShaderMode();
+
+ DrawText("FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE",
+ 0.0, 0.0, 50, RED);
+ }
+ else
+ {
+ BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
+ DrawTexturePro(
+ texture,
+ (Rectangle){0.0, 0.0, texture.width, -texture.height},
+ game->screen.destination,
+ (Vector2){0.0, 0.0},
+ 0.0,
+ WHITE);
+ EndShaderMode();
+ }
}
void updateGameScene(Game* game)
@@ -108,9 +141,7 @@ void updateGameScene(Game* game)
ClearBackground(BLACK);
- BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
drawGameScreen(game);
- EndShaderMode();
}
void handleGameResize(Game* game)