summaryrefslogtreecommitdiff
path: root/sources/core.h
diff options
context:
space:
mode:
authorHenrique Alves <henrique.alves@itsjungle.xyz>2024-04-28 21:07:01 +0300
committerHenrique Alves <henrique.alves@itsjungle.xyz>2024-04-28 21:07:01 +0300
commitf6e3396a5a653c3ae124afcd74bac5c9c7e50ae1 (patch)
tree99bc7592c4184363c4d6a985d6c6dbc07688d71a /sources/core.h
parent0d0db3e51ec95ab94befad01cbec0860acf8ffe1 (diff)
downloadgamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.tar.gz
gamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.tar.bz2
gamejam-slgj-2024-f6e3396a5a653c3ae124afcd74bac5c9c7e50ae1.zip
(wip) Basic textbox API
Diffstat (limited to 'sources/core.h')
-rw-r--r--sources/core.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sources/core.h b/sources/core.h
index 7e387de..70a7d81 100644
--- a/sources/core.h
+++ b/sources/core.h
@@ -3,6 +3,14 @@
#include <stdio.h>
#include <stdlib.h>
+static s7_pointer rl_get_mouse_position(s7_scheme *s7, s7_pointer args) {
+ Vector2 mouse_pos = GetMousePosition();
+ s7_pointer vec = s7_make_float_vector(s7, 2, 1, NULL);
+ s7_vector_set(s7, vec, 0, s7_make_real(s7, mouse_pos.x));
+ s7_vector_set(s7, vec, 1, s7_make_real(s7, mouse_pos.y));
+ return vec;
+}
+
static s7_pointer rl_is_key_down(s7_scheme *s7, s7_pointer args) {
int key = s7_integer(s7_car(args));
bool isKey = IsKeyDown(key);
@@ -10,5 +18,6 @@ static s7_pointer rl_is_key_down(s7_scheme *s7, s7_pointer args) {
}
static void rl_core_define_methods(s7_scheme *s7) {
- s7_define_function(s7, "rl-is-key-down", rl_is_key_down, 1, 0, false, "test");
+ s7_define_function(s7, "rl-is-key-down", rl_is_key_down, 1, 0, false, "(rl-is-key-down KEY)");
+ s7_define_function(s7, "rl-get-mouse-position", rl_get_mouse_position, 0, 0, false, "(rl-get-mouse-position)");
}