 | VertexAttributeSetConfig Method (VertexAttributeDataType, Int32, Int32, Int32) |
Namespace:
Ooogles
Assembly:
Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic void SetConfig(
VertexAttributeDataType dataType,
int numValuesPerVertex,
int stride = 0,
int offset = 0
)
Public Sub SetConfig (
dataType As VertexAttributeDataType,
numValuesPerVertex As Integer,
Optional stride As Integer = 0,
Optional offset As Integer = 0
)
public:
void SetConfig(
VertexAttributeDataType dataType,
int numValuesPerVertex,
int stride = 0,
int offset = 0
)
member SetConfig :
dataType : VertexAttributeDataType *
numValuesPerVertex : int *
?stride : int *
?offset : int
(* Defaults:
let _stride = defaultArg stride 0
let _offset = defaultArg offset 0
*)
-> unit
Parameters
- dataType
- Type: OooglesVertexAttributeDataType
the data type of the each component of the vertex attribute.
For example, an attribute of type vec3 contains components of type Float. - numValuesPerVertex
- Type: SystemInt32
the number of values (components) of the vertex attribute.
For example, an attribute of type vec3 contains 3 values. Valid values are 1, 2, 3 and 4. - stride (Optional)
- Type: SystemInt32
(optional) byte offset between consecutive vertex attributes.
If stride is 0 (the default), the generic vertex attributes are understood to be tightly packed in the array. - offset (Optional)
- Type: SystemInt32
(optional) byte offset into the buffer object's data store. Defaults to 0.
ExceptionsException | Condition |
---|
GLException | InvalidValue if numValuesPerVertex is not 1, 2, 3 or 4. |
GLException | InvalidValue if stride is negative. |
Remarks
That is, this attribute will be part of a VBO (Vertex Buffer Object).
When this attribute is
not part of a VBO, then you should use
SetData(VertexAttributeDataType, Int32, Void*, Int32, Boolean) instead.
There is an overloaded version SetConfigT(Int32, Int32) that has a type parameter {T}
instead of the dataType and numValuesPerVertex parameters.
That version is less efficient though.
Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if no DataBuffer of type Vertex is bound.
OpenGL API: glVertexAttribPointer
See Also