]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
Remove TODO(#956)
[nothing.git] / src / game / camera.h
1 #ifndef CAMERA_H_
2 #define CAMERA_H_
3
4 #include <stdbool.h>
5
6 #include "color.h"
7 #include "game/sprite_font.h"
8 #include "math/point.h"
9 #include "math/rect.h"
10 #include "math/triangle.h"
11
12 typedef struct {
13     bool debug_mode;
14     bool blackwhite_mode;
15     Point position;
16     float scale;
17     SDL_Renderer *renderer;
18     Sprite_font *font;
19 } Camera;
20
21 Camera create_camera(SDL_Renderer *renderer,
22                      Sprite_font *font);
23
24 int camera_clear_background(const Camera *camera,
25                             Color color);
26
27 int camera_fill_rect(const Camera *camera,
28                      Rect rect,
29                      Color color);
30
31 int camera_draw_rect(Camera *camera,
32                      Rect rect,
33                      Color color);
34
35 int camera_draw_rect_screen(Camera *camera,
36                             Rect rect,
37                             Color color);
38
39 int camera_draw_thicc_rect_screen(const Camera *camera,
40                                   Rect rect,
41                                   Color color,
42                                   float thiccness);
43
44 int camera_draw_triangle(Camera *camera,
45                          Triangle t,
46                          Color color);
47
48 int camera_fill_triangle(const Camera *camera,
49                          Triangle t,
50                          Color color);
51
52 int camera_render_text(const Camera *camera,
53                        const char *text,
54                        Vec size,
55                        Color color,
56                        Vec position);
57
58 int camera_render_text_screen(const Camera *camera,
59                               const char *text,
60                               Vec size,
61                               Color color,
62                               Vec position);
63
64 Rect camera_text_boundary_box(const Camera *camera,
65                               Vec position,
66                               Vec scale,
67                               const char *text);
68
69 int camera_render_debug_text(const Camera *camera,
70                              const char *text,
71                              Vec position);
72
73 int camera_render_debug_rect(const Camera *camera,
74                              Rect rect,
75                              Color color);
76
77 void camera_center_at(Camera *camera, Point position);
78 void camera_scale(Camera *came, float scale);
79
80 void camera_toggle_debug_mode(Camera *camera);
81 void camera_disable_debug_mode(Camera *camera);
82
83 int camera_is_point_visible(const Camera *camera, Point p);
84 int camera_is_text_visible(const Camera *camera,
85                            Vec size,
86                            Vec position,
87                            const char *text);
88
89 Rect camera_view_port(const Camera *camera);
90
91 Rect camera_view_port_screen(const Camera *camera);
92
93 Vec camera_map_screen(const Camera *camera,
94                       Sint32 x, Sint32 y);
95
96 Vec camera_point(const Camera *camera, const Vec p);
97 Rect camera_rect(const Camera *camera, const Rect rect);
98
99 int camera_fill_rect_screen(const Camera *camera,
100                             Rect rect,
101                             Color color);
102
103 const Sprite_font *camera_font(const Camera *camera);
104
105 #endif  // CAMERA_H_