From 88ab79e436aec6ede0fca4949570f534ffb1b853 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 9 Mar 2024 09:29:52 -0800 Subject: Rename RenderBackend -> GfxCore. --- game/src/game.c | 12 ++++++------ game/src/plugins/texture_view.c | 8 ++++---- game/src/plugins/viewer.c | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) (limited to 'game') diff --git a/game/src/game.c b/game/src/game.c index bc85691..425119f 100644 --- a/game/src/game.c +++ b/game/src/game.c @@ -11,8 +11,8 @@ #include "plugins/plugin.h" #include +#include #include -#include #include #include #include @@ -204,18 +204,18 @@ void app_update(Game* game, double t, double dt) { } void app_render(const Game* game) { - RenderBackend* render_backend = gfx_get_render_backend(game->gfx); - gfx_start_frame(render_backend); + GfxCore* gfxcore = gfx_get_core(game->gfx); + gfx_start_frame(gfxcore); render_plugin(game); - gfx_end_frame(render_backend); + gfx_end_frame(gfxcore); } void app_resize(Game* game, int width, int height) { game->width = width; game->height = height; - RenderBackend* render_backend = gfx_get_render_backend(game->gfx); - gfx_set_viewport(render_backend, width, height); + GfxCore* gfxcore = gfx_get_core(game->gfx); + gfx_set_viewport(gfxcore, width, height); resize_plugin(game, width, height); } diff --git a/game/src/plugins/texture_view.c b/game/src/plugins/texture_view.c index 52dff57..a8b2a94 100644 --- a/game/src/plugins/texture_view.c +++ b/game/src/plugins/texture_view.c @@ -1,7 +1,7 @@ #include "plugin.h" #include -#include +#include #include #include #include @@ -33,7 +33,7 @@ bool init(Game* game, State** pp_state) { // Usage: [texture file] const char* texture_file = game->argc > 1 ? game->argv[1] : DEFAULT_TEXTURE; - RenderBackend* render_backend = gfx_get_render_backend(game->gfx); + GfxCore* gfxcore = gfx_get_core(game->gfx); const Texture* texture = gfx_load_texture( game->gfx, &(LoadTextureCmd){ @@ -46,12 +46,12 @@ bool init(Game* game, State** pp_state) { goto cleanup; } - ShaderProgram* shader = gfx_make_view_texture_shader(render_backend); + ShaderProgram* shader = gfx_make_view_texture_shader(gfxcore); if (!shader) { goto cleanup; } - Geometry* geometry = gfx_make_quad_11(render_backend); + Geometry* geometry = gfx_make_quad_11(gfxcore); if (!geometry) { goto cleanup; } diff --git a/game/src/plugins/viewer.c b/game/src/plugins/viewer.c index 5e8d7d3..f621b00 100644 --- a/game/src/plugins/viewer.c +++ b/game/src/plugins/viewer.c @@ -58,14 +58,14 @@ static SceneNode* load_skyquad(Gfx* gfx, SceneNode* root) { assert(gfx); assert(root); - RenderBackend* render_backend = gfx_get_render_backend(gfx); + GfxCore* gfxcore = gfx_get_core(gfx); const Texture* environment_map = load_environment_map(gfx); if (!environment_map) { return 0; } - return gfx_setup_skyquad(render_backend, root, environment_map); + return gfx_setup_skyquad(gfxcore, root, environment_map); } /// Load the 3D scene. @@ -222,17 +222,17 @@ static void render_bounding_boxes(const Game* game, const State* state) { assert(game); assert(state); - RenderBackend* render_backend = gfx_get_render_backend(game->gfx); - ImmRenderer* imm = gfx_get_imm_renderer(game->gfx); - assert(render_backend); + GfxCore* gfxcore = gfx_get_core(game->gfx); + ImmRenderer* imm = gfx_get_imm_renderer(game->gfx); + assert(gfxcore); assert(imm); const mat4 id = mat4_id(); Anima* anima = 0; - gfx_set_blending(render_backend, true); - gfx_set_depth_mask(render_backend, false); - gfx_set_polygon_offset(render_backend, -1.5f, -1.0f); + gfx_set_blending(gfxcore, true); + gfx_set_depth_mask(gfxcore, false); + gfx_set_polygon_offset(gfxcore, -1.5f, -1.0f); gfx_imm_start(imm); gfx_imm_set_camera(imm, gfx_get_camera_camera(state->camera)); @@ -240,9 +240,9 @@ static void render_bounding_boxes(const Game* game, const State* state) { render_bounding_boxes_rec(imm, anima, &id, gfx_get_scene_root(state->scene)); gfx_imm_end(imm); - gfx_reset_polygon_offset(render_backend); - gfx_set_depth_mask(render_backend, true); - gfx_set_blending(render_backend, false); + gfx_reset_polygon_offset(gfxcore); + gfx_set_depth_mask(gfxcore, true); + gfx_set_blending(gfxcore, false); } void render(const Game* game, const State* state) { -- cgit v1.2.3