-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
diff --git a/c/raylib_bindings.c b/c/raylib_bindings.c
index 902a945..bb36469 100644
--- a/c/raylib_bindings.c
+++ b/c/raylib_bindings.c
@@ -314,11 +314,11 @@ static inline Camera2D camera2D_of_arg(lean_obj_arg camera) {
return (Camera2D){offset, target, rotation, zoom};
}
-lean_obj_res getRandomValue(uint32_t min, uint32_t max)
- __attribute__((optnone)) {
- // BUG: This always seems to return `min`
- return lean_io_result_mk_ok(lean_box_uint32(GetRandomValue(min, max)));
-}
+// lean_obj_res getRandomValue(uint32_t min, uint32_t max)
+// __attribute__((optnone)) {
+// // BUG: This always seems to return `min`
+// return lean_io_result_mk_ok(lean_box_uint32(GetRandomValue(min, max)));
+// }
lean_obj_res initWindow(lean_obj_arg width, lean_obj_arg height,
b_lean_obj_arg title) {
@@ -402,6 +402,16 @@ lean_obj_res beginMode3D(lean_obj_arg camera) {
return IO_UNIT;
}
+lean_obj_res drawLine3D(lean_obj_arg startPos, lean_obj_arg endPos, lean_obj_arg color) {
+ DrawLine3D(vector3_of_arg(startPos), vector3_of_arg(endPos), color_of_arg(color));
+ return IO_UNIT;
+}
+
+lean_obj_res drawPoint3D(lean_obj_arg position, lean_obj_arg color) {
+ DrawPoint3D(vector3_of_arg(position), color_of_arg(color));
+ return IO_UNIT;
+}
+
lean_obj_res drawCube(lean_obj_arg position, double width, double height,
double length, lean_obj_arg color) {
DrawCube(vector3_of_arg(position), width, height, length,
diff --git a/lean/Raylean/Core.lean b/lean/Raylean/Core.lean
index e0818b6..787a1f9 100644
--- a/lean/Raylean/Core.lean
+++ b/lean/Raylean/Core.lean
@@ -112,6 +112,12 @@ opaque drawText : (text : @& String) → (posX : Nat) → (posY : Nat) → (font
/- Basic geometric 3D shapes drawing functions -/
+@[extern "drawLine3D"]
+opaque drawLine3D : (startPos : @& Vector3) → (endPos : @& Vector3) → (color : @& Color) → IO Unit
+
+@[extern "drawPoint3D"]
+opaque drawPoint3D : (position : @& Vector3) → (color : @& Color) → IO Unit
+
@[extern "drawCube"]
opaque drawCube : (position : @& Vector3) → (width : Float) → (height : Float) → (length : Float) → (color : @& Color) -> IO Unit