Click or drag to resize

VertexAttributeSetConfig Method (VertexAttributeDataType, Int32, Int32, Int32)

Sets up the attribute for use with a DataBuffer (of type Vertex).

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void SetConfig(
	VertexAttributeDataType dataType,
	int numValuesPerVertex,
	int stride = 0,
	int offset = 0
)

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.
Exceptions
ExceptionCondition
GLExceptionInvalidValue if numValuesPerVertex is not 1, 2, 3 or 4.
GLExceptionInvalidValue 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

Reference