Class GeometryBuilder.Abstract<GL extends OGLGraphics>

java.lang.Object
com.blackrook.gloop.opengl.util.GeometryBuilder.Abstract<GL>
Type Parameters:
GL - the graphics implementation that this executes on.
All Implemented Interfaces:
GeometryBuilder
Enclosing interface:
GeometryBuilder

public abstract static class GeometryBuilder.Abstract<GL extends OGLGraphics> extends Object implements GeometryBuilder
Geometry builder utility class.
Author:
Matthew Tropiano
  • Field Details

    • gl

      protected GL extends OGLGraphics gl
    • vertices

      protected int vertices
      Size amount of vertices.
    • attributeSizes

      protected int[] attributeSizes
      Attribute sizes in components.
    • strideSize

      protected int strideSize
      Size of a full stride.
    • attributeOffsets

      protected int[] attributeOffsets
      Attribute offsets.
    • currentVertex

      protected int[] currentVertex
      Current vertex per attribute.
    • buffer

      protected FloatBuffer buffer
      The buffer that holds the data.
  • Constructor Details

    • Abstract

      protected Abstract(GL gl, int vertices, int... attributeSizes)
  • Method Details

    • add

      public GeometryBuilder add(int attributeId, float... values)
      Description copied from interface: GeometryBuilder
      Adds the values for a one-component attribute. Next call to this method with the same will write to the next vertex.
      Specified by:
      add in interface GeometryBuilder
      Parameters:
      attributeId - the attribute id.
      values - the component values.
      Returns:
      this builder.
    • getAttributeCount

      public int getAttributeCount()
      Specified by:
      getAttributeCount in interface GeometryBuilder
      Returns:
      the attribute count.
    • getStrideSize

      public int getStrideSize()
      Specified by:
      getStrideSize in interface GeometryBuilder
      Returns:
      the stride size.
    • getWidth

      public int getWidth(int attributeId)
      Description copied from interface: GeometryBuilder
      Gets the element width for an attribute.
      Specified by:
      getWidth in interface GeometryBuilder
      Parameters:
      attributeId - the attribute id.
      Returns:
      the width for the provided attribute.
    • getOffset

      public int getOffset(int attributeId)
      Description copied from interface: GeometryBuilder
      Gets the stride offset for an attribute.
      Specified by:
      getOffset in interface GeometryBuilder
      Parameters:
      attributeId - the attribute id.
      Returns:
      the offset for the provided attribute.