 | VertexAttributeSetDataT Method (T, Int32, Boolean) |
Sets up the attribute for use with client data.
Namespace:
Ooogles
Assembly:
Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic void SetData<T>(
T[] data,
int stride = 0,
bool normalized = false
)
where T : struct, new()
Public Sub SetData(Of T As {Structure, New}) (
data As T(),
Optional stride As Integer = 0,
Optional normalized As Boolean = false
)
public:
generic<typename T>
where T : value class, gcnew()
void SetData(
array<T>^ data,
int stride = 0,
bool normalized = false
)
member SetData :
data : 'T[] *
?stride : int *
?normalized : bool
(* Defaults:
let _stride = defaultArg stride 0
let _normalized = defaultArg normalized false
*)
-> unit when 'T : struct, new()
Parameters
- data
- Type: T
client data array containing the vertices. - 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. - normalized (Optional)
- Type: SystemBoolean
(optional) flag that specifies whether integer values will be normalized.
If set to True, integer values are be mapped to the range [-1,1] (for signed values) or [0,1] (for unsigned values) when they are accessed and converted to floating point.
Otherwise (default), values will be converted to floats directly without normalization.
Type Parameters
- T
- The type of elements in the data array.
ExceptionsException | Condition |
---|
GLException | InvalidValue if stride is negative. |
Remarks
When this attribute is part of a VBO, then you should use
SetConfig(VertexAttributeDataType, Int32, Int32, Int32) instead
(which is more efficient than using client data).
Type parameter {T} must be of an integral or floating-point type, or of type Vector2, Vector3 or Vector4.
The other overloaded versions (SetConfig(VertexAttributeDataType, Int32, Int32, Int32) and SetDataT(VertexAttributeDataType, Int32, T, Int32, Boolean)) are more efficient.
OpenGL API: glVertexAttribPointer
See Also