aboutsummaryrefslogtreecommitdiff
path: root/raylib/raylib.ha
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-21 11:09:56 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-21 11:09:56 +0200
commit123144c93bfc77883c8fb517828b47bbe13b8671 (patch)
tree762739afedb5f3f168051367515cb9b9a06ec68d /raylib/raylib.ha
downloadminesweeper-123144c93bfc77883c8fb517828b47bbe13b8671.tar.gz
minesweeper-123144c93bfc77883c8fb517828b47bbe13b8671.zip
Initial commitHEADmaster
Diffstat (limited to 'raylib/raylib.ha')
-rw-r--r--raylib/raylib.ha52
1 files changed, 52 insertions, 0 deletions
diff --git a/raylib/raylib.ha b/raylib/raylib.ha
new file mode 100644
index 0000000..65c1b51
--- /dev/null
+++ b/raylib/raylib.ha
@@ -0,0 +1,52 @@
1use types::c;
2
3export const MOUSE_BUTTON_LEFT = 0;
4export const MOUSE_BUTTON_RIGHT = 1;
5export const FLAG_WINDOW_RESIZABLE: uint = 4;
6
7export const KEY_N = 78;
8
9export type color = struct {
10 r: u8,
11 g: u8,
12 b: u8,
13 a: u8
14};
15
16export type vector2 = struct {
17 x: f32,
18 y: f32
19};
20
21export @symbol("WindowShouldClose") fn window_should_close() bool;
22export @symbol("BeginDrawing") fn begin_drawing() void;
23export @symbol("EndDrawing") fn end_drawing() void;
24export @symbol("ClearBackground") fn clear_background(color) void;
25export @symbol("DrawRectangleV") fn draw_rectangle_v(vector2, vector2, color) void;
26export @symbol("IsMouseButtonPressed") fn is_mouse_button_pressed(int) bool;
27export @symbol("GetMousePosition") fn get_mouse_position() vector2;
28export @symbol("GetScreenHeight") fn get_screen_height() int;
29export @symbol("GetScreenWidth") fn get_screen_width() int;
30export @symbol("SetConfigFlags") fn set_config_flags(uint) void;
31export @symbol("IsKeyPressed") fn is_key_pressed(int) bool;
32
33@symbol("InitWindow") fn InitWindow(int, int, *c::char) void;
34export fn init_window(width: int, height: int, title: str) void = {
35 let c_title = c::fromstr(title)!;
36 defer free(c_title);
37 InitWindow(width, height, c_title);
38};
39
40@symbol("DrawText") fn DrawText(*c::char, int, int, int, color) void;
41export fn draw_text(text: str, x: int, y: int, sz: int, c: color) void = {
42 let c_str = c::fromstr(text)!;
43 defer free(c_str);
44 DrawText(c_str, x, y, sz, c);
45};
46
47@symbol("MeasureText") fn MeasureText(*c::char, int) int;
48export fn measure_text(text: str, sz: int) int = {
49 let c_str = c::fromstr(text)!;
50 defer free(c_str);
51 return MeasureText(c_str, sz);
52};

Generated with cgit - Back to sebastiano.tronto.net