diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-21 17:42:07 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-21 17:42:07 +0000 |
commit | ba522d0b6e8172d2d9f0ee107fbb2d6499380847 (patch) | |
tree | 7727c315be6e02261bd3a55a6c25901f2d327963 /src/game.c | |
parent | ecb467030530f54dfcf530132c4cd7194dc0f484 (diff) | |
download | PenguinYippies-ba522d0b6e8172d2d9f0ee107fbb2d6499380847.tar.gz PenguinYippies-ba522d0b6e8172d2d9f0ee107fbb2d6499380847.tar.bz2 PenguinYippies-ba522d0b6e8172d2d9f0ee107fbb2d6499380847.zip |
Working on resizing thingy
Diffstat (limited to 'src/game.c')
-rw-r--r-- | src/game.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -3,6 +3,7 @@ void initGame(Game* game) { InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Penguin Yippies!"); + SetWindowState(FLAG_WINDOW_RESIZABLE); // Assets. initAssets(&game->assets); @@ -11,11 +12,14 @@ void initGame(Game* game) game->currentScreen = MAIN_MENU_SCREEN; initMainMenu(&game->mainMenu, game); initGameScreen(&game->gameScreen, game); + + game->screenTexture = LoadRenderTexture(WINDOW_WIDTH, WINDOW_HEIGHT); } void updateGame(Game* game) { - BeginDrawing(); + // Draw screen. + BeginTextureMode(game->screenTexture); switch (game->currentScreen) { @@ -29,6 +33,20 @@ void updateGame(Game* game) break; } + EndTextureMode(); + + // Draw the silly silly render texture. + BeginDrawing(); + + DrawTexturePro( + game->screenTexture.texture, + (Rectangle){0.0, 0.0, game->screenTexture.texture.width, -game->screenTexture.texture.height}, + (Rectangle){0.0, 0.0, GetScreenWidth(), GetScreenHeight()}, + Vector2Zero(), + 0.0, + WHITE + ); + EndDrawing(); } @@ -37,6 +55,7 @@ void closeGame(Game* game) closeAssets(&game->assets); closeMainMenu(&game->mainMenu); closeGameScreen(&game->gameScreen); + UnloadRenderTexture(game->screenTexture); CloseWindow(); } |