Other engines 0.3
Your own game or an engine with no goome package of its own: nothing gets injected. goome runs offscreen and the engine draws its frame as a texture. The examples repo has small ones in engines, each with a short README and the exact build command.
| Folder | Engine | How |
|---|---|---|
raylib |
raylib 5.5 | offscreen goome + the goome_gl3 renderer backend in raylib’s GL context |
sdl_gl3 |
SDL2 + OpenGL 3 | the goome_sdl2 platform backend + goome_gl3, the Dear ImGui style setup |
love2d |
LÖVE (Lua) | LuaJIT ffi to a goome shared lib, the frame copied into a love Image |
All of them keep input from the game while goome wants it. SDL3 works too, swap goome_sdl2.h for goome_sdl3.h and sdl2 for sdl3 in the names.
raylib
raylib doesnt need a platform backend, push its input yourself and check goome_ui_wants before the game reads anything:
int wants = goome_ui_wants(u);
if (!(wants & GOOME_WANT_MOUSE)) distance -= GetMouseWheelMove() * 0.5f;
if (!(wants & GOOME_WANT_KEYBOARD) && IsKeyPressed(KEY_SPACE)) paused = !paused;
BeginDrawing();
draw_game();
rlDrawRenderBatchActive();
goome_gl3_render(g);
EndDrawing();
rlDrawRenderBatchActive flushes raylib’s own batch first, otherwise goome draws under it. On a resize call goome_gl3_resize(g, GetScreenWidth(), GetScreenHeight(), 1).
curl -L https://github.com/raysan5/raylib/releases/download/5.5/raylib-5.5_linux_amd64.tar.gz | tar xz
cc -std=c99 -O2 -I../../vendor -I../../vendor/backends -Iraylib-5.5_linux_amd64/include main.c ../../vendor/goome.c raylib-5.5_linux_amd64/lib/libraylib.a -lm -lpthread -ldl -o raylib_demo
SDL2 + OpenGL 3
Every event goes to goome_sdl2_event first and the game skips it when that returns 1, then goome_gl3_render right before SDL_GL_SwapWindow. All GL calls go through SDL_GL_GetProcAddress, no -lGL and no loader library.
sudo apt install libsdl2-dev
cc -std=c99 -O2 -I../../vendor -I../../vendor/backends main.c ../../vendor/goome.c $(sdl2-config --cflags --libs) -lm -o sdl_gl3
LÖVE
No C glue at all. main.lua loads goome as a shared library with LuaJIT’s ffi, copies only the changed part of each frame into an ImageData and draws it with premultiplied alpha:
if goome.goome_frame_dirty(g, dirty) ~= 0 then
local w = frame_data:getWidth()
local base = ffi.cast("uint8_t *", frame_data:getFFIPointer()) + (dirty.y * w + dirty.x) * 4
goome.goome_frame_copy(g, base, w * 4, FMT_RGBA_PREMUL, dirty)
frame_image:replacePixels(frame_data)
end
love.graphics.setBlendMode("alpha", "premultiplied")
love.graphics.draw(frame_image, 0, 0)
love.graphics.setBlendMode("alpha")
cc -O2 -shared -fPIC -I../../vendor ../../vendor/goome.c -lm -lpthread -ldl -o libgoome.so
love .
The lib has to sit next to main.lua (goome.dll on Windows, libgoome.dylib on macOS) and it has to run from the folder, a zipped .love cant load a library from inside itself. The ffi declarations copy goome’s structs by hand, so when a struct changes in a new goome, change it there too.
Anything else
If the engine can put pixels in a texture it can run goome. Push its input, check goome_ui_wants, copy the frame with goome_frame_dirty and goome_frame_copy (How mods work has that bit) and draw one premultiplied quad. Godot already has its own addon, see Godot.