Prep for adding z buffer
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -10,7 +10,7 @@
|
||||
enum {
|
||||
TINY_EXIT_SUCCESS,
|
||||
TINY_EXIT_ARENA_INIT_FAILED,
|
||||
TINY_EXIT_IMAGE_INIT_FAILED,
|
||||
TINY_EXIT_RENDER_INIT_FAILED,
|
||||
TINY_EXIT_MODEL_LOAD_FAILED,
|
||||
};
|
||||
|
||||
@@ -26,9 +26,9 @@ int main(void) {
|
||||
Colour bg = {.r = 42, .g = 45, .b = 52, .a = 255};
|
||||
Colour teal = {.r = 14, .g = 156, .b = 208, .a = 255};
|
||||
Colour orange = {.r = 242, .g = 100, .b = 48, .a = 255};
|
||||
Image img = {.width = 1200, .height = 1200};
|
||||
if (!init_image(arena, &img)) {
|
||||
return TINY_EXIT_IMAGE_INIT_FAILED;
|
||||
Render render;
|
||||
if (!init_render(arena, &render, 1200, 1200)) {
|
||||
return TINY_EXIT_RENDER_INIT_FAILED;
|
||||
}
|
||||
|
||||
Model model = load_obj_file(arena, "resources/head.obj");
|
||||
@@ -36,9 +36,9 @@ int main(void) {
|
||||
return TINY_EXIT_MODEL_LOAD_FAILED;
|
||||
}
|
||||
|
||||
clear_image(&img, bg);
|
||||
render_model(&model, &img, teal, RENDER_TYPE_SHADED, COLOUR_TYPE_FIXED);
|
||||
save_image(&img, "result.pam");
|
||||
clear_image(&(render.img), bg);
|
||||
render_model(&model, &render, teal, RENDER_TYPE_SHADED, COLOUR_TYPE_FIXED);
|
||||
save_image(&(render.img), "result.pam");
|
||||
|
||||
wapp_mem_arena_destroy(&arena);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user