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
-
Nested Class Summary
Nested classes/interfaces inherited from interface GeometryBuilder
GeometryBuilder.Abstract<GL> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]Attribute offsets.protected int[]Attribute sizes in components.protected FloatBufferThe buffer that holds the data.protected int[]Current vertex per attribute.protected GLprotected intSize of a full stride.protected intSize amount of vertices. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GeometryBuilder
create
-
Field Details
-
gl
-
vertices
protected int verticesSize amount of vertices. -
attributeSizes
protected int[] attributeSizesAttribute sizes in components. -
strideSize
protected int strideSizeSize of a full stride. -
attributeOffsets
protected int[] attributeOffsetsAttribute offsets. -
currentVertex
protected int[] currentVertexCurrent vertex per attribute. -
buffer
The buffer that holds the data.
-
-
Constructor Details
-
Abstract
-
-
Method Details
-
add
Description copied from interface:GeometryBuilderAdds the values for a one-component attribute. Next call to this method with the same will write to the next vertex.- Specified by:
addin interfaceGeometryBuilder- Parameters:
attributeId- the attribute id.values- the component values.- Returns:
- this builder.
-
getAttributeCount
public int getAttributeCount()- Specified by:
getAttributeCountin interfaceGeometryBuilder- Returns:
- the attribute count.
-
getStrideSize
public int getStrideSize()- Specified by:
getStrideSizein interfaceGeometryBuilder- Returns:
- the stride size.
-
getWidth
public int getWidth(int attributeId) Description copied from interface:GeometryBuilderGets the element width for an attribute.- Specified by:
getWidthin interfaceGeometryBuilder- Parameters:
attributeId- the attribute id.- Returns:
- the width for the provided attribute.
-
getOffset
public int getOffset(int attributeId) Description copied from interface:GeometryBuilderGets the stride offset for an attribute.- Specified by:
getOffsetin interfaceGeometryBuilder- Parameters:
attributeId- the attribute id.- Returns:
- the offset for the provided attribute.
-