diff options
| author | 3gg <3gg@shellblade.net> | 2026-01-04 20:45:36 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2026-01-04 20:45:36 -0800 |
| commit | be25789773aaae89dcfeee2816a3dfce29753981 (patch) | |
| tree | 25d377a8dca451e36bb1af906182b9186ffb3f02 /src | |
| parent | 311e4bebcc75f59e123b80d45f99af9e286e0b67 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -29,7 +29,7 @@ static constexpr sgVec2i WindowDims = (sgVec2i){.x = WindowWidth, .y = WindowH | |||
| 29 | 29 | ||
| 30 | static constexpr R Fovy = (R)(90 * TO_RAD); | 30 | static constexpr R Fovy = (R)(90 * TO_RAD); |
| 31 | static constexpr R Near = 0.1f; | 31 | static constexpr R Near = 0.1f; |
| 32 | static constexpr R Far = 1000.0f; | 32 | static 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) { |
