Class VulkanGLFWRenderModuleRenderer
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 VulkanGLFWRenderModuleWindowThe GLFW window this renderer draws into.protected VulkanModuleCommandPoolThe pool command buffers for this renderer are allocated from.The queue completed frames are presented on.protected VulkanRenderModuleGraphicsQueueThe queue rendering work is submitted to.protected VulkanRenderModuleForwardRenderActivityThe render pass and per-frame resources used to draw.protected VulkanRenderModuleSurfaceThe Vulkan surface backed by the GLFW window.protected VulkanRenderModuleSwapChainThe swap chain presenting to the surface.Fields inherited from class SceneCallback
initialized, mainModuleEngine, scene -
Constructor Summary
ConstructorsConstructorDescriptionVulkanGLFWRenderModuleRenderer(MainModuleEngine mainModuleEngine, Scene scene, VulkanGLFWRenderModuleEntrypoint 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
-
vulkanGLFWRenderWindow
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 VulkanRenderModuleGraphicsQueue.VulkanRenderPresentModuleGraphicsQueue vulkanGraphicsPresentQueueThe queue completed frames are presented on. -
vulkanRenderModuleForwardRenderActivity
The render pass and per-frame resources used to draw.
-
-
Constructor Details
-
VulkanGLFWRenderModuleRenderer
public VulkanGLFWRenderModuleRenderer(MainModuleEngine mainModuleEngine, Scene scene, VulkanGLFWRenderModuleEntrypoint entrypoint) Creates a renderer for one scene.No window or Vulkan object is created until
init()runs on the engine's callback thread.- Parameters:
mainModuleEngine- 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
-