Class VulkanModuleEntrypoint

java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleEntrypoint
All Implemented Interfaces:
ModuleInitializer

public class VulkanModuleEntrypoint extends Object implements ModuleInitializer
The Vulkan module's main entrypoint.

Loads the Vulkan configuration and registers VulkanModuleVulkan as a main callback, so the instance and devices come up on the engine's callback thread. It then hands itself to the modules that depend on it — the Vulkan render modules — through the vulkan_module_dependent entrypoint.

  • Constructor Details

    • VulkanModuleEntrypoint

      public VulkanModuleEntrypoint()
      Creates the Vulkan module's entrypoint.

      Called by the loader; no Vulkan object exists until onInitialize() runs.

  • Method Details

    • onInitialize

      public void onInitialize()
      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.

      Specified by:
      onInitialize in interface ModuleInitializer
    • 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() 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
    • getVulkan

      public VulkanModuleVulkan getVulkan()
      Returns the object owning the Vulkan instance and devices.
      Returns:
      the Vulkan callback, or null before onInitialize()