Class BufferBuilder

All Implemented Interfaces:
BufferVertexConsumer, VertexConsumer, IForgeVertexConsumer

public class BufferBuilder extends DefaultedVertexConsumer implements BufferVertexConsumer
  • Field Details

    • GROWTH_SIZE

      private static final int GROWTH_SIZE
      See Also:
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • buffer

      private ByteBuffer buffer
    • renderedBufferCount

      private int renderedBufferCount
    • renderedBufferPointer

      private int renderedBufferPointer
    • nextElementByte

      private int nextElementByte
    • vertices

      private int vertices
    • currentElement

      @Nullable private VertexFormatElement currentElement
    • elementIndex

      private int elementIndex
    • format

      private VertexFormat format
    • mode

      private VertexFormat.Mode mode
    • fastFormat

      private boolean fastFormat
    • fullFormat

      private boolean fullFormat
    • building

      private boolean building
    • sortingPoints

      @Nullable private Vector3f[] sortingPoints
    • sortX

      private float sortX
    • sortY

      private float sortY
    • sortZ

      private float sortZ
    • indexOnly

      private boolean indexOnly
  • Constructor Details

    • BufferBuilder

      public BufferBuilder(int p_85664_)
  • Method Details

    • ensureVertexCapacity

      private void ensureVertexCapacity()
    • ensureCapacity

      private void ensureCapacity(int p_85723_)
    • roundUp

      private static int roundUp(int p_85726_)
    • setQuadSortOrigin

      public void setQuadSortOrigin(float p_166772_, float p_166773_, float p_166774_)
    • getSortState

      public BufferBuilder.SortState getSortState()
    • restoreSortState

      public void restoreSortState(BufferBuilder.SortState p_166776_)
    • begin

      public void begin(VertexFormat.Mode p_166780_, VertexFormat p_166781_)
    • switchFormat

      private void switchFormat(VertexFormat p_85705_)
    • intConsumer

      private it.unimi.dsi.fastutil.ints.IntConsumer intConsumer(int p_231159_, VertexFormat.IndexType p_231160_)
    • makeQuadSortingPoints

      private Vector3f[] makeQuadSortingPoints()
    • putSortedQuadIndices

      private void putSortedQuadIndices(VertexFormat.IndexType p_166787_)
    • isCurrentBatchEmpty

      public boolean isCurrentBatchEmpty()
    • endOrDiscardIfEmpty

      @Nullable public BufferBuilder.RenderedBuffer endOrDiscardIfEmpty()
    • end

    • ensureDrawing

      private void ensureDrawing()
    • storeRenderedBuffer

      private BufferBuilder.RenderedBuffer storeRenderedBuffer()
    • reset

      private void reset()
    • putByte

      public void putByte(int p_85686_, byte p_85687_)
      Specified by:
      putByte in interface BufferVertexConsumer
    • putShort

      public void putShort(int p_85700_, short p_85701_)
      Specified by:
      putShort in interface BufferVertexConsumer
    • putFloat

      public void putFloat(int p_85689_, float p_85690_)
      Specified by:
      putFloat in interface BufferVertexConsumer
    • endVertex

      public void endVertex()
      Specified by:
      endVertex in interface VertexConsumer
    • nextElement

      public void nextElement()
      Specified by:
      nextElement in interface BufferVertexConsumer
    • color

      public VertexConsumer color(int p_85692_, int p_85693_, int p_85694_, int p_85695_)
      Specified by:
      color in interface BufferVertexConsumer
      Specified by:
      color in interface VertexConsumer
    • vertex

      public void vertex(float p_85671_, float p_85672_, float p_85673_, float p_85674_, float p_85675_, float p_85676_, float p_85677_, float p_85678_, float p_85679_, int p_85680_, int p_85681_, float p_85682_, float p_85683_, float p_85684_)
      Specified by:
      vertex in interface VertexConsumer
    • releaseRenderedBuffer

      void releaseRenderedBuffer()
    • clear

      public void clear()
    • discard

      public void discard()
    • currentElement

      public VertexFormatElement currentElement()
      Specified by:
      currentElement in interface BufferVertexConsumer
    • building

      public boolean building()
    • bufferSlice

      ByteBuffer bufferSlice(int p_231170_, int p_231171_)
    • putBulkData

      public void putBulkData(ByteBuffer buffer)