Class IndirectInstancer<I extends Instance>

java.lang.Object
dev.engine_room.flywheel.backend.engine.AbstractInstancer<I>
dev.engine_room.flywheel.backend.engine.indirect.IndirectInstancer<I>
All Implemented Interfaces:
Instancer<I>

public class IndirectInstancer<I extends Instance> extends AbstractInstancer<I>
  • Field Details

  • Constructor Details

  • Method Details

    • fromState

      @Nullable public static @Nullable IndirectInstancer<?> fromState(InstanceHandleImpl.State<?> handle)
    • addDraw

      public void addDraw(IndirectDraw draw)
    • draws

      public List<IndirectDraw> draws()
    • update

      public void update(int modelIndex, int baseInstance)
    • writeModel

      public void writeModel(long ptr)
    • uploadInstances

      public void uploadInstances(StagingBuffer stagingBuffer, int instanceVbo)
    • parallelUpdate

      public void parallelUpdate()
      Specified by:
      parallelUpdate in class AbstractInstancer<I extends Instance>
    • delete

      public void delete()
      Specified by:
      delete in class AbstractInstancer<I extends Instance>
    • modelIndex

      public int modelIndex()
    • baseInstance

      public int baseInstance()
    • local2GlobalInstanceIndex

      public int local2GlobalInstanceIndex(int instanceIndex)
    • createInstance

      public I createInstance()
      Returns:
      a handle to a new copy of this model.
    • revealInstance

      public InstanceHandleImpl.State<I> revealInstance(InstanceHandleImpl<I> handle, I instance)
      Specified by:
      revealInstance in class AbstractInstancer<I extends Instance>
    • stealInstance

      public void stealInstance(@Nullable I instance)
      Description copied from interface: Instancer
      Steal an instance from another instancer.
      This has the effect of swapping the instance's model in-place.

      If the given instance is already owned by this instancer, this method does nothing.
      If the given instance is null, this method does nothing.
      If the given instance was created by a different backend, the behavior of this method is undefined.
      Parameters:
      instance - The instance to steal.
    • instanceCount

      public int instanceCount()
      Specified by:
      instanceCount in class AbstractInstancer<I extends Instance>
    • clear

      public void clear()
      Clear all instances without freeing resources.
      Specified by:
      clear in class AbstractInstancer<I extends Instance>