Class RenderVulkanGLFWModuleRenderer
This is where the two stacks finally meet: it opens a GLFW window, creates a Vulkan surface onto it, and builds the
swap chain and per-frame resources against that surface. Everything is created in init() and torn down in
reverse in clean(), with the queue drained first so nothing is destroyed while still in use.
The draw loop itself is not implemented yet — loop() currently only services the window — so several of the
fields below are created but not yet driven.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VulkanModuleCommandPoolThe pool command buffers for this renderer are allocated from.The queue completed frames are presented on.protected RenderVulkanModuleGraphicsQueueThe queue rendering work is submitted to.protected RenderVulkanGLFWModuleWindowThe GLFW window this renderer draws into.protected RenderVulkanModuleForwardRenderActivityThe render pass and per-frame resources used to draw.protected RenderVulkanModuleSurfaceThe Vulkan surface backed by the GLFW window.protected RenderVulkanModuleSwapChainThe swap chain presenting to the surface.Fields inherited from class SceneCallback
engine, initialized, scene -
Constructor Summary
ConstructorsConstructorDescriptionRenderVulkanGLFWModuleRenderer(Engine engine, Scene scene, CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint entrypoint) Creates a renderer for one scene. -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Releases whatever this callback acquired inSceneCallback.init().voidinit()Sets this callback up against its scene.voidloop()Advances this callback by one frame.Methods inherited from class SceneCallback
isInitialized
-
Field Details
-
vulkanRenderGLFWWindow
The GLFW window this renderer draws into. -
vulkanGraphicsCommandPool
The pool command buffers for this renderer are allocated from. -
vulkanGraphicsQueue
The queue rendering work is submitted to. -
vulkanRenderModuleSurface
The Vulkan surface backed by the GLFW window. -
vulkanRenderModuleSwapChain
The swap chain presenting to the surface. -
vulkanGraphicsPresentQueue
protected RenderVulkanModuleGraphicsQueue.RenderVulkanPresentModuleGraphicsQueue vulkanGraphicsPresentQueueThe queue completed frames are presented on. -
vulkanRenderModuleForwardRenderActivity
The render pass and per-frame resources used to draw.
-
-
Constructor Details
-
RenderVulkanGLFWModuleRenderer
public RenderVulkanGLFWModuleRenderer(Engine engine, Scene scene, CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint entrypoint) Creates a renderer for one scene.No window or Vulkan object is created until
init()runs on the engine's callback thread.- Parameters:
engine- the engine this renderer belongs toscene- the scene to drawentrypoint- the module entrypoint supplying configuration and dependencies
-
-
Method Details
-
init
public void init()Description copied from class:SceneCallbackSets this callback up against its scene.Called once, before the first
SceneCallback.loop(). An implementation should setSceneCallback.initializedwhen it finishes.- Specified by:
initin classSceneCallback
-
loop
public void loop()Description copied from class:SceneCallbackAdvances this callback by one frame.Called repeatedly at the frame rate the engine's configuration specifies.
- Specified by:
loopin classSceneCallback
-
clean
public void clean()Description copied from class:SceneCallbackReleases whatever this callback acquired inSceneCallback.init().- Specified by:
cleanin classSceneCallback
-