summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-01-04 20:45:36 -0800
committer3gg <3gg@shellblade.net>2026-01-04 20:45:36 -0800
commitbe25789773aaae89dcfeee2816a3dfce29753981 (patch)
tree25d377a8dca451e36bb1af906182b9186ffb3f02 /src
parent311e4bebcc75f59e123b80d45f99af9e286e0b67 (diff)
Rename sgTexture_t -> sgImageHEADmain
Diffstat (limited to 'src')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 1f900bc..dcd0335 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,7 +29,7 @@ static constexpr sgVec2i WindowDims = (sgVec2i){.x = WindowWidth, .y = WindowH
29 29
30static constexpr R Fovy = (R)(90 * TO_RAD); 30static constexpr R Fovy = (R)(90 * TO_RAD);
31static constexpr R Near = 0.1f; 31static constexpr R Near = 0.1f;
32static constexpr R Far = 1000.0f; 32static constexpr R Far = 100.0f;
33 33
34#define DEBUG_EVENT_LOOP 1 34#define DEBUG_EVENT_LOOP 1
35 35
@@ -69,7 +69,7 @@ typedef struct State {
69 void* gfx_mem; 69 void* gfx_mem;
70 swgfx* gfx; 70 swgfx* gfx;
71 Model* model; 71 Model* model;
72 sgTexture_t texture; 72 sgImage texture;
73 Camera camera; 73 Camera camera;
74 CameraController camera_controller; 74 CameraController camera_controller;
75 Uint64 last_tick; 75 Uint64 last_tick;
@@ -291,7 +291,7 @@ static bool Initialize(State* state) {
291 } 291 }
292 if (state->model->material.diffuseTexture[0] != 0) { 292 if (state->model->material.diffuseTexture[0] != 0) {
293 // TODO: When doing lighting, need to gamma-correct here. 293 // TODO: When doing lighting, need to gamma-correct here.
294 sgTexture_t texture = {0}; 294 sgImage texture = {0};
295 int channels = 0; 295 int channels = 0;
296 constexpr int desired_channels = 4; 296 constexpr int desired_channels = 4;
297 texture.pixels = (sgPixel*)stbi_load(state->model->material.diffuseTexture, &texture.width, &texture.height, &channels, desired_channels); 297 texture.pixels = (sgPixel*)stbi_load(state->model->material.diffuseTexture, &texture.width, &texture.height, &channels, desired_channels);
@@ -326,7 +326,7 @@ static void Shutdown(State* state) {
326 326
327 if (state->texture.pixels) { 327 if (state->texture.pixels) {
328 free(state->texture.pixels); 328 free(state->texture.pixels);
329 state->texture = (sgTexture_t){0}; 329 state->texture = (sgImage){0};
330 } 330 }
331 331
332 if (state->model) { 332 if (state->model) {