Class BufferLayout

java.lang.Object
com.jme3.shader.bufferobject.layout.BufferLayout
Direct Known Subclasses:
RawLayout, Std140Layout

public abstract class BufferLayout extends Object
Layout serializer for buffers
  • Field Details

  • Constructor Details

    • BufferLayout

      public BufferLayout()
  • Method Details

    • getSerializer

      protected BufferLayout.ObjectSerializer<?> getSerializer(Object obj)
    • registerSerializer

      protected void registerSerializer(BufferLayout.ObjectSerializer<?> serializer)
      Register a serializer
      Parameters:
      type -
    • estimateSize

      public int estimateSize(Object o)
      Estimate size of Object when serialized accordingly with std140
      Parameters:
      o - the object to serialize
      Returns:
      the size
    • getBasicAlignment

      public int getBasicAlignment(Object o)
      Get basic alignment of Object when serialized accordingly with std140
      Parameters:
      o - the object to serialize
      Returns:
      the basic alignment
    • align

      public int align(int pos, int basicAlignment)
      Align a position to the given basicAlignment
      Parameters:
      pos - the position to align
      basicAlignment - the basic alignment
      Returns:
      the aligned position
    • write

      public void write(ByteBuffer out, Object o)
      Serialize an object accordingly with the std140 layout and write the result to a BufferObject
      Parameters:
      out - the output BufferObject where the object will be serialized (starting from the current position)
      o - the Object to serialize
    • getId

      public abstract String getId()