diff options
Diffstat (limited to 'game/src')
-rw-r--r-- | game/src/game.c | 12 | ||||
-rw-r--r-- | game/src/plugins/texture_view.c | 8 | ||||
-rw-r--r-- | game/src/plugins/viewer.c | 22 |
3 files changed, 21 insertions, 21 deletions
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 @@ | |||
11 | #include "plugins/plugin.h" | 11 | #include "plugins/plugin.h" |
12 | 12 | ||
13 | #include <gfx/app.h> | 13 | #include <gfx/app.h> |
14 | #include <gfx/core.h> | ||
14 | #include <gfx/gfx.h> | 15 | #include <gfx/gfx.h> |
15 | #include <gfx/render_backend.h> | ||
16 | #include <gfx/renderer.h> | 16 | #include <gfx/renderer.h> |
17 | #include <gfx/scene/camera.h> | 17 | #include <gfx/scene/camera.h> |
18 | #include <gfx/scene/node.h> | 18 | #include <gfx/scene/node.h> |
@@ -204,18 +204,18 @@ void app_update(Game* game, double t, double dt) { | |||
204 | } | 204 | } |
205 | 205 | ||
206 | void app_render(const Game* game) { | 206 | void app_render(const Game* game) { |
207 | RenderBackend* render_backend = gfx_get_render_backend(game->gfx); | 207 | GfxCore* gfxcore = gfx_get_core(game->gfx); |
208 | gfx_start_frame(render_backend); | 208 | gfx_start_frame(gfxcore); |
209 | render_plugin(game); | 209 | render_plugin(game); |
210 | gfx_end_frame(render_backend); | 210 | gfx_end_frame(gfxcore); |
211 | } | 211 | } |
212 | 212 | ||
213 | void app_resize(Game* game, int width, int height) { | 213 | void app_resize(Game* game, int width, int height) { |
214 | game->width = width; | 214 | game->width = width; |
215 | game->height = height; | 215 | game->height = height; |
216 | 216 | ||
217 | RenderBackend* render_backend = gfx_get_render_backend(game->gfx); | 217 | GfxCore* gfxcore = gfx_get_core(game->gfx); |
218 | gfx_set_viewport(render_backend, width, height); | 218 | gfx_set_viewport(gfxcore, width, height); |
219 | 219 | ||
220 | resize_plugin(game, width, height); | 220 | resize_plugin(game, width, height); |
221 | } | 221 | } |
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 @@ | |||
1 | #include "plugin.h" | 1 | #include "plugin.h" |
2 | 2 | ||
3 | #include <gfx/asset.h> | 3 | #include <gfx/asset.h> |
4 | #include <gfx/render_backend.h> | 4 | #include <gfx/core.h> |
5 | #include <gfx/renderer.h> | 5 | #include <gfx/renderer.h> |
6 | #include <gfx/scene.h> | 6 | #include <gfx/scene.h> |
7 | #include <gfx/util/geometry.h> | 7 | #include <gfx/util/geometry.h> |
@@ -33,7 +33,7 @@ bool init(Game* game, State** pp_state) { | |||
33 | // Usage: [texture file] | 33 | // Usage: [texture file] |
34 | const char* texture_file = game->argc > 1 ? game->argv[1] : DEFAULT_TEXTURE; | 34 | const char* texture_file = game->argc > 1 ? game->argv[1] : DEFAULT_TEXTURE; |
35 | 35 | ||
36 | RenderBackend* render_backend = gfx_get_render_backend(game->gfx); | 36 | GfxCore* gfxcore = gfx_get_core(game->gfx); |
37 | 37 | ||
38 | const Texture* texture = gfx_load_texture( | 38 | const Texture* texture = gfx_load_texture( |
39 | game->gfx, &(LoadTextureCmd){ | 39 | game->gfx, &(LoadTextureCmd){ |
@@ -46,12 +46,12 @@ bool init(Game* game, State** pp_state) { | |||
46 | goto cleanup; | 46 | goto cleanup; |
47 | } | 47 | } |
48 | 48 | ||
49 | ShaderProgram* shader = gfx_make_view_texture_shader(render_backend); | 49 | ShaderProgram* shader = gfx_make_view_texture_shader(gfxcore); |
50 | if (!shader) { | 50 | if (!shader) { |
51 | goto cleanup; | 51 | goto cleanup; |
52 | } | 52 | } |
53 | 53 | ||
54 | Geometry* geometry = gfx_make_quad_11(render_backend); | 54 | Geometry* geometry = gfx_make_quad_11(gfxcore); |
55 | if (!geometry) { | 55 | if (!geometry) { |
56 | goto cleanup; | 56 | goto cleanup; |
57 | } | 57 | } |
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) { | |||
58 | assert(gfx); | 58 | assert(gfx); |
59 | assert(root); | 59 | assert(root); |
60 | 60 | ||
61 | RenderBackend* render_backend = gfx_get_render_backend(gfx); | 61 | GfxCore* gfxcore = gfx_get_core(gfx); |
62 | 62 | ||
63 | const Texture* environment_map = load_environment_map(gfx); | 63 | const Texture* environment_map = load_environment_map(gfx); |
64 | if (!environment_map) { | 64 | if (!environment_map) { |
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | return gfx_setup_skyquad(render_backend, root, environment_map); | 68 | return gfx_setup_skyquad(gfxcore, root, environment_map); |
69 | } | 69 | } |
70 | 70 | ||
71 | /// Load the 3D scene. | 71 | /// Load the 3D scene. |
@@ -222,17 +222,17 @@ static void render_bounding_boxes(const Game* game, const State* state) { | |||
222 | assert(game); | 222 | assert(game); |
223 | assert(state); | 223 | assert(state); |
224 | 224 | ||
225 | RenderBackend* render_backend = gfx_get_render_backend(game->gfx); | 225 | GfxCore* gfxcore = gfx_get_core(game->gfx); |
226 | ImmRenderer* imm = gfx_get_imm_renderer(game->gfx); | 226 | ImmRenderer* imm = gfx_get_imm_renderer(game->gfx); |
227 | assert(render_backend); | 227 | assert(gfxcore); |
228 | assert(imm); | 228 | assert(imm); |
229 | 229 | ||
230 | const mat4 id = mat4_id(); | 230 | const mat4 id = mat4_id(); |
231 | Anima* anima = 0; | 231 | Anima* anima = 0; |
232 | 232 | ||
233 | gfx_set_blending(render_backend, true); | 233 | gfx_set_blending(gfxcore, true); |
234 | gfx_set_depth_mask(render_backend, false); | 234 | gfx_set_depth_mask(gfxcore, false); |
235 | gfx_set_polygon_offset(render_backend, -1.5f, -1.0f); | 235 | gfx_set_polygon_offset(gfxcore, -1.5f, -1.0f); |
236 | 236 | ||
237 | gfx_imm_start(imm); | 237 | gfx_imm_start(imm); |
238 | gfx_imm_set_camera(imm, gfx_get_camera_camera(state->camera)); | 238 | 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) { | |||
240 | render_bounding_boxes_rec(imm, anima, &id, gfx_get_scene_root(state->scene)); | 240 | render_bounding_boxes_rec(imm, anima, &id, gfx_get_scene_root(state->scene)); |
241 | gfx_imm_end(imm); | 241 | gfx_imm_end(imm); |
242 | 242 | ||
243 | gfx_reset_polygon_offset(render_backend); | 243 | gfx_reset_polygon_offset(gfxcore); |
244 | gfx_set_depth_mask(render_backend, true); | 244 | gfx_set_depth_mask(gfxcore, true); |
245 | gfx_set_blending(render_backend, false); | 245 | gfx_set_blending(gfxcore, false); |
246 | } | 246 | } |
247 | 247 | ||
248 | void render(const Game* game, const State* state) { | 248 | void render(const Game* game, const State* state) { |