struct Gloop::VertexArray

Overview

Information about the specification of vertex formats.

See: https://www.khronos.org/opengl/wiki/Vertex_Specification#Vertex_Array_Object

Included Modules

Defined in:

gloop/vertex_array.cr
gloop/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

Class Method Summary

Instance Method Summary

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

def self.create(context) : self #

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

[View source]
def self.generate(context) : self #

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

[View source]

Class Method Detail

def self.current(context) #

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

[View source]
def self.current?(context) #

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

[View source]
def self.delete(vertex_arrays : Enumerable(self)) : Nil #

Deletes multiple vertex arrays.

  • OpenGL function: glDeleteVertexArrays
  • OpenGL version: 3.0

[View source]
def self.unbind(context) : Nil #

Unbinds any currently bound vertex array.

  • OpenGL function: glBindVertexArray
  • OpenGL version: 3.0

[View source]

Instance Method Detail

def attributes : Attributes #

Information for all attributes in this vertex array.


[View source]
def bind : Nil #

Binds this vertex array, making its vertex attributes active for the context.

  • OpenGL function: glBindVertexArray
  • OpenGL version: 3.0

[View source]
def bind(&) #

Binds this vertex array.

The previously bound vertex array (if any) is restored after the block exits.

  • OpenGL function: glBindVertexArray
  • OpenGL version: 3.0

[View source]
def bind_attribute(attribute : Attribute, to slot : UInt32) #

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

[View source]
def 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.

See: #bind_attribute

  • OpenGL function: glVertexArrayVertexBuffer
  • OpenGL version: 4.5

[View source]
def bindings : Bindings #

Information about vertex buffer and attribute binding slots.


[View source]
def delete : Nil #

Deletes this vertex array.

  • OpenGL function: glDeleteVertexArrays
  • OpenGL version: 3.0

[View source]
def element_array_buffer : Buffer #

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

[View source]
def element_array_buffer=(buffer : Buffer) #

Sets the element array buffer used for indexed drawing calls.

  • OpenGL function: glVertexArrayElementBuffer
  • OpenGL version: 4.5

[View source]
def element_array_buffer? : Buffer | Nil #

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

[View source]
def exists? #

Checks if the vertex array is known by OpenGL.

  • OpenGL function: glIsVertexArray
  • OpenGL version: 3.0

[View source]
def object_type #

Indicates that this is a vertex array object.


[View source]