Recommendation
Do not add a full GTK surface backend now. Keep the main native desktop path on the raylib/SDL/OpenGL surface and keep improving GTK/GIO/portal integration around it.
Renderer Matrices
Kryon has two backend tiers: link-time surface backends for full applications, and runtime KRB hosts for portable cartridges.
Decision
Do not add a full GTK surface backend now. Keep the main native desktop path on the raylib/SDL/OpenGL surface and keep improving GTK/GIO/portal integration around it.
A real GTK backend would need windowing, input, texture/render-texture handling, font rasterization, clipping, timing, clipboard, screenshots, and audio stubs across the raylib-shaped surface. That is a large second app runtime, not a small Linux polish feature.
Add a small experimental GTK/Cairo or GTK/GLArea KRB host only if we need a native widget-hosted preview surface. That keeps the risk inside the small KryBackend vtable instead of the full surface.
Tier A
Selected at link time with KRYON_BACKEND. The full widget catalog runs here, so new entries carry the highest maintenance cost.
| Backend | Graphics API | Platforms | CI | Status | Notes |
|---|---|---|---|---|---|
raylib | OpenGL ES 2.0 over SDL2 | Linux, FreeBSD | Linux + FreeBSD | Default | Production path for native desktop apps. |
raylib web | WebGL over GLFW3 | Emscripten | Web builds | Shipping | Used by the normal web build path. |
raylib Windows OpenGL | OpenGL 2.1 | Windows | Release builds | Default Windows flavor | MinGW build path. |
raylib Windows software | raylib software renderer | Windows | Release builds | Secondary flavor | No-GPU fallback package flavor. |
canvas | HTML5 Canvas2D via EM_JS | Emscripten | canvas-test | Graphics + WebAudio | No raylib; glyphs rasterized from FontFace data; sound/music, PCM streams, and stream processors. |
libdraw | kry_sw RGBA8 to plan9port libdraw/devdraw | plan9port on Unix/X11 | libdraw-test | UI backend | No libraylib; widgets, TTF glyph atlases, rounded controls, alpha texture blits, rotation, render textures, input, resize, screenshots, and 9c clean-surface compile/link are covered. |
null | None | All | Local headless usage | Test backend | Zero-return stubs plus injected input. |
gtk candidate | GTK/Cairo or GTK/GLArea | Linux desktops | None | Defer full surface | Too large for the current benefit; see decision above. |
Tier B
Selected at runtime through the compact KryBackend vtable. This is the right place to prototype new renderers.
| Host | Rendering | Input | Textures | Text | CI | Notes |
|---|---|---|---|---|---|---|
KryBackendDraw | raylib surface | raylib | Yes | Full font stack | Yes | Runs cartridges inside raylib apps and preview tools. |
kry_sw | Software RGBA8 rasterizer | Injected | PNG + embedded RGBA | font8x8 or KFA1 atlas | Yes | No GPU/libc-heavy dependencies; supports RGB565 export. |
krb-run | kry_sw headless | Injected | Yes | Via kry_sw | Linux/Windows/macOS | Conformance host for PNG dumps and call logs. |
krb-sdl | kry_sw to SDL2 texture | SDL2 | Yes | Via kry_sw | Yes | Template for small native host ports. |
krb-web | kry_sw to wasm Canvas2D | JS bridge | Yes | Via kry_sw | renderers.yml | Byte-identical to native software output. |
KryBackendRec | Wraps any backend | Passthrough | Passthrough | Passthrough | Exactness job | Records vtable calls for cross-engine comparison. |
KryBackendNull | Stub | None | No texture_rgba | None | Logic tests | Default before host selection. |
| GTK KRB host candidate | GTK widget + Cairo/image upload | GTK events | Can reuse kry_sw | Can reuse kry_sw | Future | Useful as an embeddable preview host, not as the production app backend. |
Linux Integration
| Area | Current Backend | Status | Direction |
|---|---|---|---|
| File dialogs | XDG Desktop Portal, GTK, zenity, kdialog, yad | Portal-first | Keep portal first; GTK remains a local fallback. |
| Notifications | Freedesktop Notifications over GDBus | Shipping | Use reverse-DNS desktop-entry IDs for icon resolution. |
| Tray | Ayatana/AppIndicator, GTK StatusIcon fallback | Desktop-dependent | Prefer StatusNotifier/AppIndicator; keep GTK lazy-loaded fallback. |
| System theme | GTK3 style sampling plus config readers | Useful but not authoritative everywhere | Add portal/settings sources before making GTK mandatory. |
| Packaging | XDG desktop entries, AppStream, hicolor icons | Improved | Keep app ID, desktop ID, icon name, and notification hint aligned. |
| Main app window | SDL2/raylib surface | Production | Keep this as the native Linux default. |