-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
43 lines (39 loc) · 982 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
** main.c for main in /home/nicolas/Modules/gfx_raytracer1/tcore
**
** Made by menett_a
** Login <[email protected]>
**
** Started on Sun Feb 28 16:38:20 2016 menett_a
** Last update Sun Mar 13 23:49:06 2016 menett_a
*/
#include <lapin.h>
#include "struct.h"
#include "proto.h"
t_bunny_response main_loop(t_loop *loop)
{
view_pos(loop);
init_color(&loop->pall);
raytracer(loop);
bunny_blit(&loop->win->buffer, &loop->pix->clipable, NULL);
bunny_display(loop->win);
return (GO_ON);
}
int main(int argc, char **argv)
{
t_loop loop;
char *str;
if (argc < 2)
return (1);
if ((str = load_ray(&loop, argv[1])) != NULL)
return (put_err(str));
if ((str = init_window(&loop)) != NULL)
return (put_err(str));
bunny_set_loop_main_function((t_bunny_loop)main_loop);
bunny_set_key_response(key_rsp);
init_move(&loop);
bunny_loop(loop.win, 60, &loop);
bunny_delete_clipable(&loop.pix->clipable);
bunny_stop(loop.win);
return (0);
}