48 lines
1.5 KiB
C
48 lines
1.5 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2020/12/22 12:02:14 by gbrochar #+# #+# */
|
|
/* Updated: 2020/12/26 06:41:15 by gbrochar ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "scop.h"
|
|
#include "mat4.h"
|
|
|
|
void banner(void) {
|
|
int fd = open("resources/scop.ans", O_RDONLY);
|
|
if (fd == -1) {
|
|
printf("warning: can't open banner file\n");
|
|
return;
|
|
}
|
|
char buffer[902];
|
|
ssize_t len = read(fd, buffer, 902);
|
|
write(1, buffer, len);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
t_env e;
|
|
|
|
banner();
|
|
init_env(&e);
|
|
if (parse(&e, argc, argv) == SUCCESS)
|
|
{
|
|
center_vertices(&(e.object.vertices));
|
|
if (run(&e) == FAILURE)
|
|
printf("Error with glfw initialization\n");
|
|
}
|
|
else
|
|
{
|
|
free_env(&e);
|
|
printf("file reading error\n");
|
|
return (FAILURE);
|
|
}
|
|
free_env(&e);
|
|
return (SUCCESS);
|
|
}
|