From a618f7c8d4e8df65d9d2542d9032c32973e42981 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Thu, 10 Sep 2026 19:16:42 -0700 Subject: Switch away from Wavefront & more --- src/teapot.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/teapot.c') 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 . */ -#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); } -- cgit v1.2.3