summaryrefslogtreecommitdiff
path: root/src/teapot.c
diff options
context:
space:
mode:
authorConnor Thomson <blumatrikz@gmail.com>2026-09-10 19:16:42 -0700
committerConnor Thomson <blumatrikz@gmail.com>2026-09-10 19:16:42 -0700
commita618f7c8d4e8df65d9d2542d9032c32973e42981 (patch)
tree79e1a9eccd4d1ad61daf4c14f2e3c76638f37597 /src/teapot.c
parente9d4cbaa3c44337115d672d2038a7b73745181c8 (diff)
Switch away from Wavefront & more
Diffstat (limited to 'src/teapot.c')
-rw-r--r--src/teapot.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/teapot.c b/src/teapot.c
index 6ce9a4f..5b8e4e4 100644
--- a/src/teapot.c
+++ b/src/teapot.c
@@ -17,21 +17,23 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "files.h"
#include "gpu.h"
-#include "obj_model.h"
+#include "model.h"
#include "teapot.h"
+#include "teapot_data.h"
#include "window.h"
-static ta_obj_model ta_teapot_model;
-static ta_obj_model ta_dounut_model;
+static ta_model ta_teapot_model;
+static ta_model ta_dounut_model;
void ta_teapot_init(void) {
- ta_obj_model_init(
+ ta_model_init(
&ta_teapot_model,
ta_gpu_device,
- file_data_models_teapot_obj_start,
- file_data_models_teapot_obj_size,
+ ta_teapot_positions,
+ ta_teapot_position_count,
+ ta_teapot_faces,
+ ta_teapot_face_count,
ta_gpu_swapchain_format,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT,
ta_gpu_sample_count
@@ -39,15 +41,15 @@ void ta_teapot_init(void) {
}
void ta_teapot_upload(SDL_GPUCommandBuffer *command_buffer) {
- ta_obj_model_upload(&ta_teapot_model, command_buffer, ta_gpu_device);
- ta_obj_model_upload(&ta_dounut_model, command_buffer, ta_gpu_device);
+ ta_model_upload(&ta_teapot_model, command_buffer, ta_gpu_device);
+ ta_model_upload(&ta_dounut_model, command_buffer, ta_gpu_device);
}
void ta_teapot_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass) {
ta_teapot_model.rotation[1] = (float)SDL_GetTicks() * 0.01f;
- ta_obj_model_render(&ta_teapot_model, command_buffer, render_pass, ta_window_width, ta_window_height);
+ ta_model_render(&ta_teapot_model, command_buffer, render_pass, ta_window_width, ta_window_height);
}
void ta_teapot_shutdown(void) {
- ta_obj_model_destroy(&ta_teapot_model, ta_gpu_device);
+ ta_model_destroy(&ta_teapot_model, ta_gpu_device);
}