So this doesn’t work
defmodule WinRaylib do
use Charms
defbind init_window_wrapper() :: i32()
defm init_window(env) :: i32() do
init_window_wrapper()
end
def dynamic_libraries() do
so = Path.join(System.tmp_dir!(), "raylib_test.so")
{_, 0} =
System.cmd("cc", [
"-shared",
"-fPIC",
"-o",
so,
"test/support/raylib_test.c",
"-I/opt/homebrew/include",
"-L/opt/homebrew/lib",
"-lraylib"
])
[so]
end
end
#include "raylib.h"
int _mlir_ciface_Elixir$RaylibTest$ScreenWidthTest$init_window_wrapper() {
int width, height;
if (GetScreenWidth() > 0 && GetScreenHeight() > 0) {
width = GetScreenWidth();
height = GetScreenHeight();
} else {
width = 800;
height = 600;
}
const char *title = "Test Window";
TraceLog(LOG_INFO, "Initializing window: %dx%d, title: %s", width, height, title);
InitWindow(width, height, title);
TraceLog(LOG_INFO, "Window initialized - IsWindowReady: %d", IsWindowReady());
if (IsWindowReady()) {
TraceLog(LOG_INFO, "Entering window loop");
// Keep window open until ESC pressed
while (!WindowShouldClose()) {
TraceLog(LOG_DEBUG, "Window loop iteration");
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Test Window Open", 20, 20, 20, DARKGRAY);
EndDrawing();
}
}
return IsWindowReady();
}
void close_window(void) {
CloseWindow();
}
Running ExUnit with seed: 20931, max_cases: 16
.........................................INFO: Initializing window: 800x600, title: Test Window
INFO: Initializing raylib 5.5
INFO: Platform backend: DESKTOP (GLFW)
INFO: Supported raylib modules:
INFO: > rcore:..... loaded (mandatory)
INFO: > rlgl:...... loaded (mandatory)
INFO: > rshapes:... loaded (optional)
INFO: > rtextures:. loaded (optional)
INFO: > rtext:..... loaded (optional)
INFO: > rmodels:... loaded (optional)
INFO: > raudio:.... loaded (optional)






















