]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
Merge pull request #242 from tsoding/238
[nothing.git] / src / game / camera.h
1 #ifndef CAMERA_H_
2 #define CAMERA_H_
3
4 #include "color.h"
5 #include "math/point.h"
6 #include "math/rect.h"
7 #include "math/triangle.h"
8
9 typedef struct camera_t camera_t;
10
11 camera_t *create_camera_from_renderer(SDL_Renderer *renderer);
12 void destroy_camera(camera_t *camera);
13
14 int camera_clear_background(camera_t *camera,
15                             color_t color);
16
17 int camera_fill_rect(camera_t *camera,
18                      rect_t rect,
19                      color_t color);
20
21 int camera_draw_rect(camera_t * camera,
22                      rect_t rect,
23                      color_t color);
24
25 int camera_draw_triangle(camera_t *camera,
26                          triangle_t t,
27                          color_t color);
28
29 int camera_fill_triangle(camera_t *camera,
30                          triangle_t t,
31                          color_t color);
32
33 void camera_center_at(camera_t *camera, point_t position);
34
35 void camera_toggle_debug_mode(camera_t *camera);
36 void camera_disable_debug_mode(camera_t *camera);
37
38 void camera_toggle_blackwhite_mode(camera_t *camera);
39
40 int camera_is_point_visible(const camera_t *camera, point_t p);
41
42 rect_t camera_view_port(const camera_t *camera);
43
44 #endif  // CAMERA_H_