Architecture and layers
JOID is split into three layers, so that one interface runs unchanged on OpenGL, Vulkan or the renderer of an engine.
A module depends only on the layers above it, and a base module on no other one, except a library module on the API module it binds, as base-lwjgl3-openal on base-openal.

The core depends on no technology
Section titled “The core depends on no technology”joid-core holds everything that does not depend on a graphics, window or audio library:
- the UI engine: UIs, nodes, layout, signals, effects, animation, text and resources;
- the contracts that a backend implements, in
dev.joid.lib.bridge: one interface per bridge, and the registries ofBridgeHandler; - the generic half of every backend:
RenderBridgekeeps the matrices, the render state and the frame in Java,Texturecomputes the mipmap chain,ShaderSourceparses each stage andShadertranslates it, andBackendregisters the bridges in a fixed order.
The core never calls OpenGL, Vulkan, GLFW or OpenAL. It reaches them only through the bridges.
The base modules share one library between backends
Section titled “The base modules share one library between backends”A base module holds the code that several backends would otherwise copy, for one library:
| Module | Library | Gives |
|---|---|---|
| base-openal | OpenAL, through IAlBinding | the audio bridge and its streaming sources |
| base-opengl | OpenGL 2.1 and later, through IGlBinding | the render bridge, the state guard, textures, framebuffers, shaders and mipmaps |
| base-lwjgl2 | LWJGL 2, a single jar | the bindings of base-opengl and base-openal, the Display window bridge with its native cursors, the input forwarder, the key table |
| base-lwjgl3-glfw | GLFW of LWJGL 3 | the window bridge, the input forwarder, the key table |
| base-lwjgl3-openal | OpenAL of LWJGL 3 | the binding of base-openal |
| base-lwjgl3-opengl | OpenGL of LWJGL 3 | the binding of base-opengl |
| base-lwjgl3-sdl | SDL 3 of LWJGL | the key table, the mouse buttons |
base-openal and base-opengl are API modules: they call their library only through these binding interfaces, so they declare no LWJGL dependency, and the binding you give them decides which library they call.
The other base modules are library modules, one for each jar of a library, so that a backend takes exactly the libraries it already runs on.
The final backends stay thin
Section titled “The final backends stay thin”A final backend picks its base modules, adds what is specific to its library, and registers everything through a subclass of Backend:
| Backend | Base modules | Its own code |
|---|---|---|
| LWJGL 2 | lwjgl2, openal, opengl | the natives |
| LWJGL 3 | lwjgl3-glfw, lwjgl3-openal, lwjgl3-opengl, openal, opengl | the context hints |
| Vulkan | lwjgl3-glfw, lwjgl3-openal, openal | the whole renderer, and the hosts that own the device and the frame |
Each jar of a backend embeds the core and its base modules, with Gson, Guava, Commons IO, Commons Lang, JSVG, TwelveMonkeys and ASM relocated under dev.joid.shaded; JavaCV, JavaCPP and FFmpeg keep their own packages, and so does JNA in the LWJGL 2 jars.
An application declares one JOID jar, next to the libraries of its backend (LWJGL, for the official ones).
The tools sit beside the layers
Section titled “The tools sit beside the layers”| Module | Role |
|---|---|
tool-msdf | Generates the MSDF atlases of the fonts; the core embeds it. |
tool-testkit | Renders scenarios on a hidden surface and runs the contract suites that every backend passes (Testing a backend). |
The snapshot packages of base-lwjgl3-glfw, base-opengl and of each final backend hold the hidden surfaces and the captures of the tests; those of base-opengl and of the backends use the testkit; Three jars per module says which jars carry them.
Feed the core, never the interface
Section titled “Feed the core, never the interface”The code of a UI never adapts to its backend. Rules that hold for every backend, such as the mipmap chain, the vertex layout or the depth conversion, already live in the core, so a backend only translates them for its library.
When a host has data of its own (its textures, its asset paths, its key bindings, its text objects), the backend feeds a registry of the core and the UI keeps calling the core API:
| Registry | Turns | Page |
|---|---|---|
ResourceResolver | an object of the host (a sprite, a texture handle) into a resource | Resource resolvers |
AssetLocator | a path of the host into a stream | Custom formats |
KeyResolver | a key binding of the host into keys | Keyboard and shortcuts |
TextConverter | a text object of the host into a string | Text markup and effects |
