]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
Merge pull request #621 from tsoding/615
[nothing.git] / src / game / camera.h
1 #ifndef CAMERA_H_
2 #define CAMERA_H_
3
4 #include "color.h"
5 #include "game/sprite_font.h"
6 #include "math/point.h"
7 #include "math/rect.h"
8 #include "math/triangle.h"
9
10 typedef struct Camera Camera;
11
12 Camera *create_camera(SDL_Renderer *renderer,
13                       Sprite_font *font);
14 void destroy_camera(Camera *camera);
15
16 int camera_clear_background(Camera *camera,
17                             Color color);
18
19 int camera_fill_rect(Camera *camera,
20                      Rect rect,
21                      Color color);
22
23 int camera_draw_rect(Camera * camera,
24                      Rect rect,
25                      Color color);
26
27 int camera_draw_triangle(Camera *camera,
28                          Triangle t,
29                          Color color);
30
31 int camera_fill_triangle(Camera *camera,
32                          Triangle t,
33                          Color color);
34
35 int camera_render_text(Camera *camera,
36                        const char *text,
37                        Vec size,
38                        Color color,
39                        Vec position);
40
41 int camera_render_debug_text(Camera *camera,
42                              const char *text,
43                              Vec position);
44
45 int camera_render_debug_rect(Camera *camera,
46                              Rect rect,
47                              Color color);
48
49 void camera_center_at(Camera *camera, Point position);
50
51 void camera_toggle_debug_mode(Camera *camera);
52 void camera_disable_debug_mode(Camera *camera);
53
54 void camera_toggle_blackwhite_mode(Camera *camera);
55
56 int camera_is_point_visible(const Camera *camera, Point p);
57 int camera_is_text_visible(const Camera *camera,
58                            Vec size,
59                            Vec position,
60                            const char *text);
61
62 Rect camera_view_port(const Camera *camera);
63
64 #endif  // CAMERA_H_