From 616c2a5903c9da722f4c06607da2705e7bc6a282 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Wed, 21 Jun 2023 08:53:09 -0700 Subject: Make camera optional in the renderer and move start/end frame calls outside so that it can be used along the imm renderer. --- gltfview/src/game.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gltfview/src') 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) { } void game_render(const Game* game) { - Renderer* renderer = gfx_get_renderer(game->gfx); + RenderBackend* render_backend = gfx_get_render_backend(game->gfx); + Renderer* renderer = gfx_get_renderer(game->gfx); + + gfx_start_frame(render_backend); gfx_render_scene( renderer, @@ -142,6 +145,8 @@ void game_render(const Game* game) { void* plugin_state = get_plugin_state(game->plugin); plugin_call(game->plugin, plugin_render, "render", plugin_state, game); } + + gfx_end_frame(render_backend); } void game_set_viewport(Game* game, int width, int height) { -- cgit v1.2.3