struct Gloop::VertexArray::Current

Overview

References the currently bound vertex array for a context.

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

Defined in:

gloop/vertex_array/current.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Gloop::Context) #

Creates a resource associated with a context.


[View source]

Instance Method Detail

def attributes : Gloop::Attributes #

Information for all attributes in the bound vertex array.


[View source]
def bind_attribute(attribute : Gloop::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: glVertexAttribBinding
  • OpenGL version: 4.3

[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: glBindVertexBuffer
  • OpenGL version: 4.3

[View source]
def bindings : CurrentBindings #

Information about vertex buffer and attribute binding slots.


[View source]
def bound? #

Checks if there is a vertex array currently bound.


[View source]
def unbind : Nil #

Unbinds any previously bound vertex array from the context.

  • OpenGL function: glBindVertexArray
  • OpenGL version: 3.0

[View source]