struct Gloop::VertexArray
- Gloop::VertexArray
- Gloop::Object
- Struct
- Value
- Object
Overview
Information about the specification of vertex formats.
See: https://www.khronos.org/opengl/wiki/Vertex_Specification#Vertex_Array_Object
Included Modules
- Gloop::Parameters
Defined in:
gloop/vertex_array.crgloop/vertex_array/attribute.cr
gloop/vertex_array/attributes.cr
gloop/vertex_array/binding.cr
gloop/vertex_array/bindings.cr
gloop/vertex_array/current.cr
gloop/vertex_array/current_binding.cr
gloop/vertex_array/current_bindings.cr
Constructors
-
.create(context) : self
Creates a new vertex array.
-
.generate(context) : self
Generates a new vertex array.
Class Method Summary
-
.current(context)
Retrieves the currently bound vertex array.
-
.current?(context)
Retrieves the currently bound vertex array.
-
.delete(vertex_arrays : Enumerable(self)) : Nil
Deletes multiple vertex arrays.
-
.unbind(context) : Nil
Unbinds any currently bound vertex array.
Instance Method Summary
-
#attributes : Attributes
Information for all attributes in this vertex array.
-
#bind : Nil
Binds this vertex array, making its vertex attributes active for the context.
-
#bind(&)
Binds this vertex array.
-
#bind_attribute(attribute : Attribute, to slot : UInt32)
Ties an attribute to a binding slot (index) to be associated with a vertex buffer.
-
#bind_vertex_buffer(buffer : Buffer, to slot : UInt32, offset : Size, stride : Int32)
Ties a vertex buffer to a binding slot (index) to be associated with an attribute.
-
#bindings : Bindings
Information about vertex buffer and attribute binding slots.
-
#delete : Nil
Deletes this vertex array.
-
#element_array_buffer : Buffer
Retrieves the element array buffer tied to this vertex array.
-
#element_array_buffer=(buffer : Buffer)
Sets the element array buffer used for indexed drawing calls.
-
#element_array_buffer? : Buffer | Nil
Retrieves the element array buffer tied to this vertex array.
-
#exists?
Checks if the vertex array is known by OpenGL.
-
#object_type
Indicates that this is a vertex array object.
Instance methods inherited from struct Gloop::Object
context : Context
context,
name : Name
name,
none?
none?,
object_type
object_type,
to_s(io)
to_s,
to_unsafe : UInt32
to_unsafe
Constructor methods inherited from struct Gloop::Object
new(context : Context, name : Name)
new,
none(context) : self
none
Instance methods inherited from module Gloop::Labelable
label : String
label,
label=(label : Nil)label=(label) label=, max_label_size : Int32 max_label_size, name name, object_type object_type
Constructor Detail
Creates a new vertex array.
Unlike .generate
, resources are created in advance instead of on the first binding.
- OpenGL function:
glCreateVertexArrays
- OpenGL version: 4.5
Generates a new vertex array.
This ensures a unique name for a vertex array object. Resources are not allocated for the vertex array until it is bound.
See: .create
- OpenGL function:
glGenVertexArrays
- OpenGL version: 3.0
Class Method Detail
Retrieves the currently bound vertex array.
Returns a null-object (.none
) if there isn't a vertex array bound.
See: #bind
- OpenGL function:
glGetIntegerv
- OpenGL enum:
GL_VERTEX_ARRAY_BINDING
- OpenGL version: 3.0
Retrieves the currently bound vertex array.
Returns nil if there isn't a vertex array bound.
See: #bind
- OpenGL function:
glGetIntegerv
- OpenGL enum:
GL_VERTEX_ARRAY_BINDING
- OpenGL version: 3.0
Deletes multiple vertex arrays.
- OpenGL function:
glDeleteVertexArrays
- OpenGL version: 3.0
Unbinds any currently bound vertex array.
- OpenGL function:
glBindVertexArray
- OpenGL version: 3.0
Instance Method Detail
Binds this vertex array, making its vertex attributes active for the context.
- OpenGL function:
glBindVertexArray
- OpenGL version: 3.0
Binds this vertex array.
The previously bound vertex array (if any) is restored after the block exits.
- OpenGL function:
glBindVertexArray
- OpenGL version: 3.0
Ties an attribute to a binding slot (index) to be associated with a vertex buffer.
See: #bind_vertex_buffer
- OpenGL function:
glVertexArrayAttribBinding
- OpenGL version: 4.5
Ties a vertex buffer to a binding slot (index) to be associated with an attribute.
See: #bind_attribute
- OpenGL function:
glVertexArrayVertexBuffer
- OpenGL version: 4.5
Information about vertex buffer and attribute binding slots.
Deletes this vertex array.
- OpenGL function:
glDeleteVertexArrays
- OpenGL version: 3.0
Retrieves the element array buffer tied to this vertex array.
Returns Buffer.none
if one isn't associated.
- OpenGL function:
glGetVertexArrayiv
- OpenGL enum:
GL_ELEMENT_ARRAY_BUFFER_BINDING
- OpenGL version: 4.5
Sets the element array buffer used for indexed drawing calls.
- OpenGL function:
glVertexArrayElementBuffer
- OpenGL version: 4.5
Retrieves the element array buffer tied to this vertex array.
Returns nil
if one isn't associated.
- OpenGL function:
glGetVertexArrayiv
- OpenGL enum:
GL_ELEMENT_ARRAY_BUFFER_BINDING
- OpenGL version: 4.5
Checks if the vertex array is known by OpenGL.
- OpenGL function:
glIsVertexArray
- OpenGL version: 3.0