summaryrefslogtreecommitdiff
path: root/sources/text.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/text.h')
-rw-r--r--sources/text.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/text.h b/sources/text.h
index 74716c1..fed7181 100644
--- a/sources/text.h
+++ b/sources/text.h
@@ -17,6 +17,12 @@ static s7_pointer rl_draw_text(s7_scheme *s7, s7_pointer args) {
return(NULL);
}
+static s7_pointer rl_draw_texture(s7_scheme *s7, s7_pointer args) {
+ Texture2D *texture = (Texture2D *) s7_c_object_value(s7_car(args));
+ DrawTexture(*texture, 100, 100, WHITE);
+ return(NULL);
+}
+
static s7_pointer rl_load_texture(s7_scheme *s7, s7_pointer args) {
Texture2D texture = LoadTexture("./assets/test.png");
Texture2D *texture_ptr = (Texture2D *) malloc(sizeof(Texture2D));
@@ -27,6 +33,7 @@ static s7_pointer rl_load_texture(s7_scheme *s7, s7_pointer args) {
static void rl_text_define_methods(s7_scheme *s7) {
s7_define_safe_function(s7, "rl-draw-text", rl_draw_text, 1, 0, false, "test");
s7_define_safe_function(s7, "rl-load-texture", rl_load_texture, 0, 0, false, "test");
+ s7_define_safe_function(s7, "rl-draw-texture", rl_draw_texture, 1, 0, false, "test");
texture_2d_tag = s7_make_c_type(s7, "texture-2d");
s7_c_type_set_gc_free(s7, texture_2d_tag, free_texture_2d);