Struct cat_engine_basement::graphics::core::vertex_array::VertexArray [−][src]
pub struct VertexArray { /* fields omitted */ }
Implementations
Generates a vertex array object name.
Deletes a vertex array object.
If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero and the default vertex array becomes current.
Unused names in arrays are silently ignored, as is the value zero.
Deletes vertex array objects
If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero and the default vertex array becomes current.
Unused names in arrays are silently ignored, as is the value zero.
Binds a vertex array object.
If the bind is successful no change is made to the state of the vertex array object, and any previous vertex array object binding is broken.
GLError::InvalidValue
is generated
if array is not zero or the name of a vertex array object previously
returned from a call to VertexArray::generate
.
pub unsafe fn attribute_pointer(
&self,
index: u32,
offset: isize,
size: VertexComponents,
stride: i32,
data_type: DataType,
normalized: bool
)
pub unsafe fn attribute_pointer(
&self,
index: u32,
offset: isize,
size: VertexComponents,
stride: i32,
data_type: DataType,
normalized: bool
)
Define an array of generic vertex attribute data.
index
- Specifies the index of the generic vertex attribute to be modified.
offset
- Specifies an offset of the first component of the first generic vertex attribute
in the array in the data store of the buffer currently bound to the BufferTarget::ArrayBuffer
target.
The initial value is 0
.
size
- Specifies the number of components per generic vertex attribute.
The initial value is 4
.
stride
- Specifies the byte offset between consecutive generic vertex attributes.
If stride is 0
, the generic vertex attributes are understood to be tightly packed in the array.
The initial value is 0
.
data_type
- Specifies the data type of each component in the array.
normalized
- Specifies whether fixed-point data values should be normalized (true
)
or converted directly as fixed-point values (false
) when they are accessed.
GLError::InvalidValue
is generated
if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS
,
if stride is negative.
GLError::InvalidOperation
is generated
if size
is VertexComponents::BGRA
and type is not DataType::U8
,
DataType::I32_2_10_10_10_REV
or DataType::U32_2_10_10_10_REV
,
if type
is DataType::I32_2_10_10_10_REV
or DataType::U32_2_10_10_10_REV
and size
is not VertexComponents::Four
or VertexComponents::BGRA
,
if size
is DataType::BGRA
and noramlized is false
,
if zero is bound to the BufferTarget::ArrayBuffer
buffer object binding point
and offset
is not 0
(Note: In the core context, the old method of passing glVertexAttribPointer
and glDrawArrays
pointers to mesh data in main memory is no longer allowed.
You must create a Vertex Buffer Object and fill it with your mesh data.),
if there is no Vertex Array Object bound.
pub unsafe fn attribute_pointer_integer(
&self,
index: u32,
offset: isize,
size: VertexIntegerComponents,
stride: i32,
data_type: IntegerDataType
)
pub unsafe fn attribute_pointer_integer(
&self,
index: u32,
offset: isize,
size: VertexIntegerComponents,
stride: i32,
data_type: IntegerDataType
)
Define an array of generic vertex attribute data.
Only the integer types. Values are always left as integer values.
index
- Specifies the index of the generic vertex attribute to be modified.
offset
- Specifies an offset of the first component of the first generic vertex attribute
in the array in the data store of the buffer currently bound to the BufferTarget::ArrayBuffer
target.
The initial value is 0
.
size
- Specifies the number of components per generic vertex attribute.
The initial value is 4
.
stride
- Specifies the byte offset between consecutive generic vertex attributes.
If stride is 0
, the generic vertex attributes are understood to be tightly packed in the array.
The initial value is 0
.
data_type
- Specifies the data type of each component in the array.
GLError::InvalidValue
is generated
if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS
,
if stride is negative.
GLError::InvalidOperation
is generated
if zero is bound to the BufferTarget::ArrayBuffer
buffer object binding point
and offset
is not 0
(note: in the core context, the old method of passing glVertexAttribPointer
and glDrawArrays
pointers to mesh data in main memory is no longer allowed;
you must create a Vertex Buffer Object and fill it with your mesh data),
if there is no Vertex Array Object bound.
Enables a generic vertex attribute array.
GLError::InvalidValue
is generated
if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
GLError::InvalidOperation
is generated
if there is no current vertex array object.
Disables a generic vertex attribute array.
GLError::InvalidValue
is generated
if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
GLError::InvalidOperation
is generated
if there is no current vertex array object.