summaryrefslogtreecommitdiff
path: root/game/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/game.c')
-rw-r--r--game/src/game.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/game/src/game.c b/game/src/game.c
index 64be4f3..c720656 100644
--- a/game/src/game.c
+++ b/game/src/game.c
@@ -197,6 +197,10 @@ void app_update(Game* game, double t, double dt) {
197 shutdown_plugin(game); 197 shutdown_plugin(game);
198 const bool result = init_plugin(game); 198 const bool result = init_plugin(game);
199 assert(result); // TODO: handle error better. 199 assert(result); // TODO: handle error better.
200
201 // Trigger a resize just like the initial resize that occurs when the gfx
202 // application starts.
203 resize_plugin(game, game->width, game->height);
200 } 204 }
201 205
202 update_plugin(game, t, dt); 206 update_plugin(game, t, dt);
@@ -210,6 +214,12 @@ void app_render(const Game* game) {
210} 214}
211 215
212void app_resize(Game* game, int width, int height) { 216void app_resize(Game* game, int width, int height) {
217 game->width = width;
218 game->height = height;
219
220 RenderBackend* render_backend = gfx_get_render_backend(game->gfx);
221 gfx_set_viewport(render_backend, width, height);
222
213 resize_plugin(game, width, height); 223 resize_plugin(game, width, height);
214} 224}
215 225