]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
(#842) edit_field positioning, Esc button support
[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_text_screen(Camera *camera,
42                               const char *text,
43                               Vec size,
44                               Color color,
45                               Vec position);
46
47 int camera_render_debug_text(Camera *camera,
48                              const char *text,
49                              Vec position);
50
51 int camera_render_debug_rect(Camera *camera,
52                              Rect rect,
53                              Color color);
54
55 void camera_center_at(Camera *camera, Point position);
56 void camera_scale(Camera *came, float scale);
57
58 void camera_toggle_debug_mode(Camera *camera);
59 void camera_disable_debug_mode(Camera *camera);
60
61 void camera_toggle_blackwhite_mode(Camera *camera);
62
63 int camera_is_point_visible(const Camera *camera, Point p);
64 int camera_is_text_visible(const Camera *camera,
65                            Vec size,
66                            Vec position,
67                            const char *text);
68
69 Rect camera_view_port(const Camera *camera);
70
71 Rect camera_view_port_screen(const Camera *camera);
72
73 Vec camera_map_screen(const Camera *camera,
74                       Sint32 x, Sint32 y);
75
76 Vec camera_point(const Camera *camera, const Vec p);
77
78 int camera_fill_rect_screen(Camera *camera,
79                             Rect rect,
80                             Color color);
81
82 #endif  // CAMERA_H_