summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorConnor Thomson <blumatrikz@gmail.com>2026-09-10 19:30:13 -0700
committerConnor Thomson <blumatrikz@gmail.com>2026-09-10 19:30:13 -0700
commit9419ddf6e42ccf6127c2dde7d8791c19e4511844 (patch)
tree415fe960575e3c00cd3f4709140418df310d7404 /include
parenta618f7c8d4e8df65d9d2542d9032c32973e42981 (diff)
Make model.c and model.h a little better
Diffstat (limited to 'include')
-rw-r--r--include/model.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/model.h b/include/model.h
index 5d19307..01aa288 100644
--- a/include/model.h
+++ b/include/model.h
@@ -24,9 +24,11 @@
#include <stddef.h>
#include "ta_sdl.h"
+#define TA_MODEL_DIMENSION 3
+
typedef struct ta_model_vertex {
- float position[3];
- float normal[3];
+ float position[TA_MODEL_DIMENSION];
+ float normal[TA_MODEL_DIMENSION];
} ta_model_vertex;
typedef struct ta_model_mesh {
@@ -40,13 +42,13 @@ typedef struct ta_model {
ta_model_mesh mesh;
Uint32 vertex_count;
bool uploaded;
- float position[3];
- float rotation[3];
+ float position[TA_MODEL_DIMENSION];
+ float rotation[TA_MODEL_DIMENSION];
} ta_model;
-bool ta_model_build(const float positions[][3], size_t position_count, const unsigned int faces[][3], size_t face_count, ta_model_mesh *mesh);
+bool ta_model_build(const float positions[][TA_MODEL_DIMENSION], size_t position_count, const unsigned int faces[][TA_MODEL_DIMENSION], size_t face_count, ta_model_mesh *mesh);
void ta_model_free(ta_model_mesh *mesh);
-bool ta_model_init(ta_model *model, SDL_GPUDevice *device, const float positions[][3], size_t position_count, const unsigned int faces[][3], size_t face_count, SDL_GPUTextureFormat color_format, SDL_GPUTextureFormat depth_format, SDL_GPUSampleCount sample_count);
+bool ta_model_init(ta_model *model, SDL_GPUDevice *device, const float positions[][3], size_t position_count, const unsigned int faces[][TA_MODEL_DIMENSION], size_t face_count, SDL_GPUTextureFormat color_format, SDL_GPUTextureFormat depth_format, SDL_GPUSampleCount sample_count);
void ta_model_upload(ta_model *model, SDL_GPUCommandBuffer *command_buffer, SDL_GPUDevice *device);
void ta_model_render(const ta_model *model, SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass, int window_width, int window_height);
void ta_model_destroy(ta_model *model, SDL_GPUDevice *device);