java.lang.Object
technology.sola.engine.core.Sola
Direct Known Subclasses:
SolaWithDefaults

@NullMarked public abstract class Sola extends Object
Sola contains the core functionality needed to make a game. It is played via SolaPlatform.
  • Field Details

    • configuration

      protected final SolaConfiguration configuration
      The configuration for this Sola
    • solaEcs

      protected technology.sola.ecs.SolaEcs solaEcs
      The SolaEcs instance used by this Sola
    • eventHub

      protected EventHub eventHub
      The EventHub instance used by this Sola
    • keyboardInput

      protected KeyboardInput keyboardInput
      Used to check current state of keyboard input.
    • mouseInput

      protected MouseInput mouseInput
      Used to check current state of mouse input.
    • assetLoaderProvider

      protected AssetLoaderProvider assetLoaderProvider
      Used to load assets for the Sola to use.
  • Constructor Details

    • Sola

      protected Sola(SolaConfiguration configuration)
      Creates a Sola instance with desired SolaConfiguration.
      Parameters:
      configuration - the configuration for the Sola
  • Method Details

    • onRender

      protected abstract void onRender(Renderer renderer)
      Method called every frame to render the world.
      Parameters:
      renderer - the Renderer instance
    • onInit

      protected abstract void onInit()
      Method called to initialize the Sola.
    • onAsyncInit

      protected void onAsyncInit(Runnable completeAsyncInit)
      Method called if any asynchronous initialization is needed. Call completeAsyncInit.run() when completed to continue starting the Sola.
      Parameters:
      completeAsyncInit - the callback to notify the hosting platform initialization is complete
    • platform

      protected SolaPlatform platform()
      Returns:
      the SolaPlatform running this Sola.
    • onUpdate

      protected void onUpdate(float deltaTime)
      Method called every frame to update the input and world state.
      Parameters:
      deltaTime - the time since last update