From cef05d32d6a8e38d8d84a5a7efac4494b00f1ce9 Mon Sep 17 00:00:00 2001 From: Henrique Alves Date: Mon, 22 Apr 2024 10:32:24 +0300 Subject: Testing texture API --- sources/main.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'sources/main.c') diff --git a/sources/main.c b/sources/main.c index 9dcaad1..b9f702f 100644 --- a/sources/main.c +++ b/sources/main.c @@ -1,21 +1,17 @@ #include "raylib.h" +#include "text.h" +#include "texture.h" + #include #include #include #include #include - -static SCM rl_draw_text(SCM text) -{ - scm_t_string_failed_conversion_handler handler; - char* str = scm_to_stringn(text, NULL, NULL, handler); - DrawText(str, 200, 80, 20, RED); -} - static void* game (void* data) { - scm_c_define_gsubr ("rl-draw-text", 1, 0, 0, &rl_draw_text); + //rl_text_define_methods(); + rl_texture_define_methods(); const int screen_width = 800; const int screen_height = 600; @@ -32,12 +28,22 @@ static void* game (void* data) while (!WindowShouldClose()) { - scm_call_0(guile_update); + scm_call_with_blocked_asyncs(guile_update); + //scm_call_0(guile_update); BeginDrawing(); ClearBackground(RAYWHITE); - scm_call_0(guile_draw); + scm_call_with_blocked_asyncs(guile_draw); + //scm_call_0(guile_draw); EndDrawing(); + + // This doesn't change anything + // SCM_TICK; + + // This line makes memory manageable - until it crashes again (takes more time to crash though) + // scm_run_finalizers(); + // This crashes after just a couple of frames + // scm_gc(); } CloseWindow(); -- cgit v1.2.3