lisp-ffi – blip on 2026-02-24

Finally I have working ffi in rholisp! Well, almost working. Return types other than void isn't implemented, and support for floats, doubles, and pointers are not implemented either, but I have enough to open and close a window using Raylib!

> (def raylib (!ffi-load "../ffi_playground/raylib-5.5_linux_amd64/lib/libraylib.so"))
()
> raylib
(clib 94797688994320)
> (def InitWindow (!ffi-sym raylib "InitWindow"))
()
> InitWindow
(csym 139655444555879)
> (!ffi-call InitWindow () ' i32 800 ' i32 600 ' u64 0)
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)
INFO: DISPLAY: Device initialized successfully
INFO:     > Display size: 1920 x 1080
INFO:     > Screen size:  800 x 600
INFO:     > Render size:  800 x 600
INFO:     > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: Supported extensions count: 233
INFO: GL: OpenGL device information:
INFO:     > Vendor:   Intel
INFO:     > Renderer: Mesa Intel(R) HD Graphics 520 (SKL GT2)
INFO:     > Version:  4.6 (Core Profile) Mesa 25.3.5-arch1.1
INFO:     > GLSL:     4.60
INFO: GL: VAO extension detected, VAO functions loaded successfully
INFO: GL: NPOT textures extension detected, full NPOT textures supported
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: PLATFORM: DESKTOP (GLFW - X11): Initialized successfully
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Vertex shader compiled successfully
INFO: SHADER: [ID 2] Fragment shader compiled successfully
INFO: SHADER: [ID 3] Program shader loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)
INFO: RLGL: Default OpenGL state initialized successfully
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: FONT: Default font loaded successfully (224 glyphs)
INFO: SYSTEM: Working Directory: /home/ruan/Documents/programmeering/c/rholisp
()
> (!ffi-call (!ffi-sym raylib "CloseWindow") ())
INFO: TEXTURE: [ID 2] Unloaded texture data from VRAM (GPU)
INFO: SHADER: [ID 3] Default shader unloaded successfully
INFO: TEXTURE: [ID 1] Default texture unloaded successfully
INFO: Window closed successfully
()
>
screenshot of the above code running, creating a blank raylib window without a title

Above you can see a demonstration of the current ffi capabilities

Time posted: 07:07 SAST

Back to index of blips