public interface JCGLArrayObjectBuilderType
| Modifier and Type | Method and Description |
|---|---|
Optional<JCGLArrayVertexAttributeType> |
getAttributeAt(int index) |
int |
getMaximumVertexAttributes() |
void |
reset()
Clear all and any configured parameters specified so far.
|
void |
setAttributeFloatingPoint(int index,
JCGLArrayBufferUsableType a,
int elements,
JCGLScalarType type,
int stride,
long offset,
boolean normalized)
Configure the attribute
index to retrieve data from a. |
void |
setAttributeIntegral(int index,
JCGLArrayBufferUsableType a,
int elements,
JCGLScalarIntegralType type,
int stride,
long offset)
Configure the attribute
index to retrieve data from a. |
void |
setIndexBuffer(JCGLIndexBufferUsableType i)
Set the index buffer that will be bound by default.
|
void |
setNoIndexBuffer()
Indicate that no index buffer will be bound by default.
|
Optional<JCGLArrayVertexAttributeType> getAttributeAt(int index)
index - The attribute index in the range [0,
getMaximumVertexAttributes() - 1]int getMaximumVertexAttributes()
>= 16.void setAttributeFloatingPoint(int index,
JCGLArrayBufferUsableType a,
int elements,
JCGLScalarType type,
int stride,
long offset,
boolean normalized)
throws JCGLExceptionDeleted
Configure the attribute index to retrieve data from a.
The data is assumed to be elements values of type type,
occuring every stride bytes in the buffer, starting at offset. The data will be converted to floating point values when delivered
to a shading program. If normalized == true, then values of
integral types will be treated as normalized fixed-point values when
the conversion takes place. Otherwise, they will be directly converted to
floating point (so, for example, an unsigned byte value of 255 will
become 255.0 as opposed to the 1.0 value it would become if
treated as normalized fixed-point).
As a concrete example, if an buffer contains vertices with the following type:
struct vertex {
vec3 position;
vec2 uv;
vec3 normal;
}
Attribute 0, the position field, has an initial offset
of 0, and has 3 elements of type JCGLScalarType.TYPE_FLOAT.
Attribute 1, the uv field, has an initial offset of
3 * (sizeof float) == 3 * 4 == 12 bytes, and has 2 elements
of type JCGLScalarType.TYPE_FLOAT.
Attribute 2, the normal field, has an initial offset of
(3 + 2) * (sizeof float) == 5 * 4 == 20 bytes, and has 3
elements of type JCGLScalarType.TYPE_FLOAT.
If the vertex type has no padding, then the stride value
is equal to the size of the type, which is (3 + 2 + 3) * (sizeof
float) == 8 * 4 == 32 bytes.
index - The attributea - The array bufferelements - The number of elementstype - The type of elementsoffset - The offset from the start of the bufferstride - The number of bytes to step forward at each vertexnormalized - true iff the data should be treated as
normalized fixed-point values when converting to
floating pointJCGLExceptionDeleted - Iff the array buffer has already been deletedvoid setAttributeIntegral(int index,
JCGLArrayBufferUsableType a,
int elements,
JCGLScalarIntegralType type,
int stride,
long offset)
throws JCGLExceptionDeleted
Configure the attribute index to retrieve data from a.
The data is assumed to be elements values of type type,
occuring every stride bytes in the buffer, starting at offset.
The data is assumed to be of an integral type and will not be converted to floating-point prior to being delivered to a shading program.
index - The attributea - The array bufferelements - The number of elementstype - The type of elementsoffset - The offset from the start of the bufferstride - The number of bytes to step forward at each vertexJCGLExceptionDeleted - Iff the array buffer has already been deletedsetAttributeFloatingPoint(int, JCGLArrayBufferUsableType, int,
JCGLScalarType, int, long, boolean)void setIndexBuffer(JCGLIndexBufferUsableType i) throws JCGLExceptionDeleted
Set the index buffer that will be bound by default.
i - The index bufferJCGLExceptionDeleted - Iff the index buffer has already been deletedvoid setNoIndexBuffer()
Indicate that no index buffer will be bound by default.
void reset()
Copyright © 2016 <code@io7m.com> http://io7m.com