struct Gloop::Attribute
- Gloop::Attribute
- Struct
- Value
- Object
Overview
Information about a vertex attribute from the bound vertex array.
This type should be used if direct state access (DSA) isn't available.
NOTE The currently bound vertex array is always referenced. If another vertex array is bound, then this will reference the newly bound instance.
Included Modules
- Gloop::Contextual
- Gloop::Parameters
Defined in:
gloop/attribute.crConstructors
-
.new(context : Context, index : UInt32)
Creates the attribute reference.
Instance Method Summary
-
#address : Size
Retrieves the offset within buffer data to the first value of the attribute.
-
#data_pointer : Pointer(Void)
Retrieves the pointer within buffer data to the first value of the attribute.
-
#disable : Nil
Disables the attribute in the vertex array.
-
#divisor : UInt32
Returns the frequency divisor for instanced rendering.
-
#divisor=(divisor : UInt32)
Sets the rate at which attribute values advance during instances rendering.
-
#enable : Nil
Enables the attribute in the vertex array.
-
#enabled? : Bool
Indicates whether the attribute is enabled for the vertex array.
-
#float64? : Bool
Indicates whether the attribute's data is a double-precision floating-point value on the GPU.
-
#format : AttributeFormat
Retrieves all format information about the attribute.
-
#format=(format : Float32AttributeFormat)
Sets the format of the attribute.
-
#format=(format : IntAttributeFormat)
Sets the format of the attribute.
-
#format=(format : Float64AttributeFormat)
Sets the format of the attribute.
-
#index : UInt32
Index of the attribute.
-
#integer? : Bool
Indicates whether the attribute's data is an integer on the GPU.
-
#normalized? : Bool
Indicates whether the attribute's value is normalized when converted to a float-poing number.
-
#pointer : AttributePointer
Retrieves all format information about the attribute.
-
#pointer=(pointer : Float32AttributePointer)
Specifies a pointer to attribute data.
-
#pointer=(pointer : IntAttributePointer)
Specifies a pointer to attribute data.
-
#pointer=(pointer : Float64AttributePointer)
Specifies a pointer to attribute data.
-
#relative_offset : UInt32
Retrieves the number of bytes from the start of the vertex buffer data to the first instance of this attribute.
-
#size
Retrieves the number of components in the attribute.
-
#specify_float64_format(size : Int32, relative_offset : UInt32, type : Float64AttributeFormat::Type = :float64) : Nil
Specifies the format of the attribute.
-
#specify_float64_pointer(size : Int32, stride : Int32 = 0, address : Size = 0, type : Float64AttributePointer::Type = :float64) : Nil
Specifies a pointer to attribute data.
-
#specify_format(size : Int32, type : Float32AttributeFormat::Type, normalized : Bool, relative_offset : UInt32) : Nil
Specifies the format of the attribute.
-
#specify_int_format(size : Int32, type : IntAttributeFormat::Type, relative_offset : UInt32) : Nil
Specifies the format of the attribute.
-
#specify_int_pointer(size : Int32, type : IntAttributePointer::Type, stride : Int32 = 0, address : Size = 0) : Nil
Specifies a pointer to attribute data.
-
#specify_pointer(size : Int32, type : Float32AttributePointer::Type, normalized : Bool, stride : Int32 = 0, address : Size = 0) : Nil
Specifies a pointer to attribute data.
-
#stride
Returns the number of bytes between attribute values in the buffer data.
-
#type : Gloop::Float32AttributeFormat::Type
Returns the attribute's data type.
Constructor Detail
Instance Method Detail
Retrieves the offset within buffer data to the first value of the attribute.
- OpenGL function:
glGetVertexAttribPointerv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_POINTER
- OpenGL version: 2.0
Retrieves the pointer within buffer data to the first value of the attribute.
- OpenGL function:
glGetVertexAttribPointerv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_POINTER
- OpenGL version: 2.0
Disables the attribute in the vertex array.
- OpenGL function:
glDisableVertexAttribArray
- OpenGL version: 2.0
Returns the frequency divisor for instanced rendering.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_DIVISOR
- OpenGL version: 3.2
Sets the rate at which attribute values advance during instances rendering.
- OpenGL function:
glVertexAttribDivisor
- OpenGL version: 3.2
Enables the attribute in the vertex array.
- OpenGL function:
glEnableVertexAttribArray
- OpenGL version: 2.0
Indicates whether the attribute is enabled for the vertex array.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_ENABLED
- OpenGL version: 2.0
Indicates whether the attribute's data is a double-precision floating-point value on the GPU.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_LONG
- OpenGL version: 2.0
Sets the format of the attribute.
The data will be 32-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribFormat
- OpenGL version: 4.3
Sets the format of the attribute.
The data will be integer values on the GPU.
- OpenGL function:
glVertexAttribIFormat
- OpenGL version: 4.3
Sets the format of the attribute.
The data will be 64-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribLFormat
- OpenGL version: 4.3
Indicates whether the attribute's data is an integer on the GPU.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_INTEGER
- OpenGL version: 2.0
Indicates whether the attribute's value is normalized when converted to a float-poing number.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
- OpenGL version: 2.0
Specifies a pointer to attribute data.
The data will be 32-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribPointer
- OpenGL version: 2.0
Specifies a pointer to attribute data.
The data will be integer values on the GPU.
- OpenGL function:
glVertexAttribIPointer
- OpenGL version: 3.0
Specifies a pointer to attribute data.
The data will be 64-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribLPointer
- OpenGL version: 4.1
Retrieves the number of bytes from the start of the vertex buffer data to the first instance of this attribute.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_RELATIVE_OFFSET
- OpenGL version: 4.3
Retrieves the number of components in the attribute.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_SIZE
- OpenGL version: 2.0
Specifies the format of the attribute.
The data will be 64-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribLFormat
- OpenGL version: 4.3
Specifies a pointer to attribute data.
The data will be 64-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribLPointer
- OpenGL version: 4.1
Specifies the format of the attribute.
The data will be 32-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribFormat
- OpenGL version: 4.3
Specifies the format of the attribute.
The data will be integer values on the GPU.
- OpenGL function:
glVertexAttribIFormat
- OpenGL version: 4.3
Specifies a pointer to attribute data.
The data will be integer values on the GPU.
- OpenGL function:
glVertexAttribIPointer
- OpenGL version: 3.0
Specifies a pointer to attribute data.
The data will be 32-bit floating-point values on the GPU.
- OpenGL function:
glVertexAttribPointer
- OpenGL version: 2.0
Returns the number of bytes between attribute values in the buffer data.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_STRIDE
- OpenGL version: 2.0
Returns the attribute's data type.
- OpenGL function:
glGetVertexAttribiv
- OpenGL enum:
GL_VERTEX_ATTRIB_ARRAY_TYPE
- OpenGL version: 2.0