Frontends¶
A frontend creates the klartraum::VulkanContext and the
klartraum::KlartraumEngine and is the entry point of an
application.
GLFW frontend¶
klartraum::GlfwFrontend opens a window, creates a swapchain and
runs the frame loop with loop(). Mouse and keyboard events are passed to the
engine, which forwards them to the active camera (for example
klartraum::InterfaceCameraOrbit).
Everything that depends on the swapchain (image count, size) is created in a
graph builder set with engine.setGraphBuilder(...). The engine runs it
once at start-up and again after every window resize.
Headless frontend¶
klartraum::HeadlessFrontend creates a Vulkan context without a
window or swapchain. Graphs are compiled and submitted directly:
klartraum::HeadlessFrontend frontend;
auto& vc = frontend.getKlartraumEngine().getVulkanContext();
klartraum::ComputeGraph graph(vc, 1);
graph.compileFrom(output);
graph.submitAndWait(vc.getGraphicsQueue(), 0);
The test suite uses the headless frontend, and it is the starting point for inference-only applications.