Renderer Matrices

Backends, hosts, and native Linux direction

Kryon has two backend tiers: link-time surface backends for full applications, and runtime KRB hosts for portable cartridges.

Shipping Partial Not planned Utility host

Decision

Should Kryon Add A GTK Backend?

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.

Why

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.

Better First Step

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

Surface Backends

Selected at link time with KRYON_BACKEND. The full widget catalog runs here, so new entries carry the highest maintenance cost.

BackendGraphics APIPlatformsCIStatusNotes
raylibOpenGL ES 2.0 over SDL2Linux, FreeBSDLinux + FreeBSDDefaultProduction path for native desktop apps.
raylib webWebGL over GLFW3EmscriptenWeb buildsShippingUsed by the normal web build path.
raylib Windows OpenGLOpenGL 2.1WindowsRelease buildsDefault Windows flavorMinGW build path.
raylib Windows softwareraylib software rendererWindowsRelease buildsSecondary flavorNo-GPU fallback package flavor.
canvasHTML5 Canvas2D via EM_JSEmscriptencanvas-testGraphics + WebAudioNo raylib; glyphs rasterized from FontFace data; sound/music, PCM streams, and stream processors.
libdrawkry_sw RGBA8 to plan9port libdraw/devdrawplan9port on Unix/X11libdraw-testUI backendNo libraylib; widgets, TTF glyph atlases, rounded controls, alpha texture blits, rotation, render textures, input, resize, screenshots, and 9c clean-surface compile/link are covered.
nullNoneAllLocal headless usageTest backendZero-return stubs plus injected input.
gtk candidateGTK/Cairo or GTK/GLAreaLinux desktopsNoneDefer full surfaceToo large for the current benefit; see decision above.

Tier B

KRB Hosts

Selected at runtime through the compact KryBackend vtable. This is the right place to prototype new renderers.

HostRenderingInputTexturesTextCINotes
KryBackendDrawraylib surfaceraylibYesFull font stackYesRuns cartridges inside raylib apps and preview tools.
kry_swSoftware RGBA8 rasterizerInjectedPNG + embedded RGBAfont8x8 or KFA1 atlasYesNo GPU/libc-heavy dependencies; supports RGB565 export.
krb-runkry_sw headlessInjectedYesVia kry_swLinux/Windows/macOSConformance host for PNG dumps and call logs.
krb-sdlkry_sw to SDL2 textureSDL2YesVia kry_swYesTemplate for small native host ports.
krb-webkry_sw to wasm Canvas2DJS bridgeYesVia kry_swrenderers.ymlByte-identical to native software output.
KryBackendRecWraps any backendPassthroughPassthroughPassthroughExactness jobRecords vtable calls for cross-engine comparison.
KryBackendNullStubNoneNo texture_rgbaNoneLogic testsDefault before host selection.
GTK KRB host candidateGTK widget + Cairo/image uploadGTK eventsCan reuse kry_swCan reuse kry_swFutureUseful as an embeddable preview host, not as the production app backend.

Linux Integration

GTK/GIO/Portal Support

AreaCurrent BackendStatusDirection
File dialogsXDG Desktop Portal, GTK, zenity, kdialog, yadPortal-firstKeep portal first; GTK remains a local fallback.
NotificationsFreedesktop Notifications over GDBusShippingUse reverse-DNS desktop-entry IDs for icon resolution.
TrayAyatana/AppIndicator, GTK StatusIcon fallbackDesktop-dependentPrefer StatusNotifier/AppIndicator; keep GTK lazy-loaded fallback.
System themeGTK3 style sampling plus config readersUseful but not authoritative everywhereAdd portal/settings sources before making GTK mandatory.
PackagingXDG desktop entries, AppStream, hicolor iconsImprovedKeep app ID, desktop ID, icon name, and notification hint aligned.
Main app windowSDL2/raylib surfaceProductionKeep this as the native Linux default.