2024-10-07 22:15:42 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "include/rendlib.h"
|
2024-10-08 17:43:14 +00:00
|
|
|
#include "include/camera.h"
|
2024-10-07 22:15:42 +00:00
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
2024-10-08 17:43:14 +00:00
|
|
|
struct camera *c = create_camera(CAMERA_PERSPECTIVE);
|
|
|
|
if (c == NULL) {
|
|
|
|
fprintf(stderr, "--error: creating camera\n");
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
2024-10-07 22:15:42 +00:00
|
|
|
ret = rendlib_render();
|
|
|
|
if (ret < 0) {
|
|
|
|
fprintf(stderr, "--error: %d\n", ret);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf(stdout, "--rendering\n");
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|