shapes.h (1039B)
1 #ifndef TA_SHAPES_H
2 #define TA_SHAPES_H
3
4 #include <tuxanci2/syscall.h>
5 #include <tuxanci2/abi.h>
6 #include <stdint.h>
7 #include <stddef.h>
8 #include <stdbool.h>
9
10 static inline bool ta_shapes_draw_pixel(uint32_t x, uint32_t y, uint32_t color) {
11 return ta_syscall(TA_SYS_SHAPES_PIXEL, x, y, color, 0, 0, 0) != 0;
12 }
13
14 static inline bool ta_shapes_draw_rectangle(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t color) {
15 return ta_syscall(TA_SYS_SHAPES_RECTANGLE, x, y, width, height, color, 0) != 0;
16 }
17
18 static inline bool ta_shapes_draw_triangle(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t x3, uint32_t y3, uint32_t color) {
19 uint32_t coordinates[6] = {x1, y1, x2, y2, x3, y3};
20 return ta_syscall(TA_SYS_SHAPES_TRIANGLE, (uint32_t)(size_t)coordinates, color, 0, 0, 0, 0) != 0;
21 }
22
23 static inline bool ta_shapes_draw_oval(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t color) {
24 return ta_syscall(TA_SYS_SHAPES_OVAL, x, y, width, height, color, 0) != 0;
25 }
26
27 #endif // TA_SHAPES_H