summaryrefslogtreecommitdiff
path: root/gltfview
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-06-21 08:53:09 -0700
committer3gg <3gg@shellblade.net>2023-06-21 08:53:09 -0700
commit616c2a5903c9da722f4c06607da2705e7bc6a282 (patch)
tree58af72bcc1593caba675bf9f93b66339fbdf698c /gltfview
parenta85b62fdb2e153195a52cef8ecad27432bf37f50 (diff)
Make camera optional in the renderer and move start/end frame calls outside so that it can be used along the imm renderer.
Diffstat (limited to 'gltfview')
-rw-r--r--gltfview/src/game.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gltfview/src/game.c b/gltfview/src/game.c
index d618447..5ca9ad4 100644
--- a/gltfview/src/game.c
+++ b/gltfview/src/game.c
@@ -130,7 +130,10 @@ void game_update(Game* game, double t, double dt) {
130} 130}
131 131
132void game_render(const Game* game) { 132void game_render(const Game* game) {
133 Renderer* renderer = gfx_get_renderer(game->gfx); 133 RenderBackend* render_backend = gfx_get_render_backend(game->gfx);
134 Renderer* renderer = gfx_get_renderer(game->gfx);
135
136 gfx_start_frame(render_backend);
134 137
135 gfx_render_scene( 138 gfx_render_scene(
136 renderer, 139 renderer,
@@ -142,6 +145,8 @@ void game_render(const Game* game) {
142 void* plugin_state = get_plugin_state(game->plugin); 145 void* plugin_state = get_plugin_state(game->plugin);
143 plugin_call(game->plugin, plugin_render, "render", plugin_state, game); 146 plugin_call(game->plugin, plugin_render, "render", plugin_state, game);
144 } 147 }
148
149 gfx_end_frame(render_backend);
145} 150}
146 151
147void game_set_viewport(Game* game, int width, int height) { 152void game_set_viewport(Game* game, int width, int height) {