Class CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint

java.lang.Object
io.codetoil.curved_spacetime.render.vulkan_glfw.CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint
All Implemented Interfaces:
ModuleInitializer

public class CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint extends Object implements ModuleInitializer
The Vulkan GLFW render module's main entrypoint.

The most dependent module in the tree: it needs the render, GLFW render, Vulkan, and Vulkan render modules all present before it can do anything, and it blocks during initialization until every one of them has been handed to it. Once they have, it registers a scene callback generator, so each scene gets a renderer.

  • Constructor Details

    • CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint

      public CurvedSpacetimeRenderVulkanGLFWModuleEntrypoint()
      Creates the Vulkan GLFW render module's entrypoint.

      Called by the loader; nothing happens until onInitialize(Engine) runs.

  • Method Details

    • onInitialize

      public void onInitialize(Engine engine)
      Description copied from interface: ModuleInitializer
      Brings this module up.

      An implementation sets its logger's level from the engine's configuration, loads its own configuration and saves it if loading substituted defaults, receives any dependencies it declares through ModuleInitializer.getDependencyModuleTransferQueue(), performs any operations it must perform during initialization, and finally invokes its own dependent entrypoints, passing itself and the engine.

      Specified by:
      onInitialize in interface ModuleInitializer
      Parameters:
      engine - the engine driving initialization
    • recieveDependenciesFromTransferQueue

      protected void recieveDependenciesFromTransferQueue() throws InterruptedException
      Blocks until all four dependencies have been handed to this module.

      Takes exactly four elements and sorts them by type, since the modules initialise concurrently and may arrive in any order. The count must match the number of dependencies declared in quilt.mod.json: taking too few strands a producer, and taking too many blocks here forever.

      Throws:
      InterruptedException - if interrupted while waiting for a dependency
    • getConfig

      public ModuleConfig getConfig()
      Description copied from interface: ModuleInitializer
      Returns this module's configuration.
      Specified by:
      getConfig in interface ModuleInitializer
      Returns:
      the configuration, or null before ModuleInitializer.onInitialize(Engine) has loaded it
    • getLogger

      public Logger getLogger()
      Description copied from interface: ModuleInitializer
      Returns the logger this module writes its diagnostics to.

      The same instance is returned for the lifetime of this entrypoint.

      Specified by:
      getLogger in interface ModuleInitializer
      Returns:
      this module's logger
    • getDependencyModuleTransferQueue

      public TransferQueue<ModuleInitializer> getDependencyModuleTransferQueue()
      Description copied from interface: ModuleInitializer
      Returns the queue by which this module receives the entrypoints it depends on.

      A module does not look its dependencies up. Each module it depends on invokes a dependent entrypoint, which transfers that module's own entrypoint into this queue. The same instance is returned for the lifetime of this entrypoint; a fresh or defensively copied queue breaks the handshake, because the producer transfers into whichever queue this method returned.

      Specified by:
      getDependencyModuleTransferQueue in interface ModuleInitializer
      Returns:
      this module's dependency transfer queue
    • getGlfwRenderModuleEntrypoint

      public CurvedSpacetimeRenderGLFWModuleEntrypoint getGlfwRenderModuleEntrypoint()
      Returns the GLFW render module's entrypoint.
      Returns:
      the GLFW render entrypoint, or null before the handshake completes
    • getRenderModuleEntrypoint

      public CurvedSpacetimeRenderModuleEntrypoint getRenderModuleEntrypoint()
      Returns the render module's entrypoint.
      Returns:
      the render entrypoint, or null before the handshake completes
    • getVulkanModuleEntrypoint

      public CurvedSpacetimeVulkanModuleEntrypoint getVulkanModuleEntrypoint()
      Returns the Vulkan module's entrypoint.
      Returns:
      the Vulkan entrypoint, or null before the handshake completes
    • getRenderVulkanModuleEntrypoint

      public CurvedSpacetimeRenderVulkanModuleEntrypoint getRenderVulkanModuleEntrypoint()
      Returns the Vulkan render module's entrypoint.
      Returns:
      the Vulkan render entrypoint, or null before the handshake completes