rendlib/dev.c
Kevin Jerebica a176afab7e init: kick-off repository from gravity's SC
source code was taken from my project gravity and
modified so I can reuse the renderer in other projects.
I will also upgrade it, free it from old bugs, put more
effort into learning the math behind rendering, etc.
2024-10-08 00:15:42 +02:00

35 lines
821 B
C

#include <stdlib.h>
#include <stdio.h>
#include "include/rendlib.h"
#include "include/object.h"
int main(int argc, char *argv[]) {
int ret = rendlib_start_window(argc, argv);
if (ret < 0) {
fprintf(stderr, "--error: %d\n", ret);
return EXIT_FAILURE;
}
struct model *m = load_model("assets/models/sphere.obj");
if (m == NULL) {
fprintf(stderr, "--error: loading model\n");
return EXIT_FAILURE;
}
struct object *o = create_object(&objects, 100.0f, m);
if (o == NULL) {
fprintf(stderr, "--error: creating object\n");
return EXIT_FAILURE;
}
ret = rendlib_render();
if (ret < 0) {
fprintf(stderr, "--error: %d\n", ret);
return EXIT_FAILURE;
}
fprintf(stdout, "--rendering\n");
return EXIT_SUCCESS;
}