struct Gloop::VertexArray::CurrentBinding

Overview

Vertex buffer binding and attribute slot for the currently bound vertex array.

These slots can be used to associate vertex buffers and attribute formats together.

See: AttributeFormat, Gloop::Attribute

Included Modules

Defined in:

gloop/vertex_array/current_binding.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Context, index : UInt32) #

Creates a reference to a binding slot in the currently bound vertex array.


[View source]

Instance Method Detail

def attribute=(attribute : Gloop::Attribute) #

Binds an attribute to the slot.

  • OpenGL function: glVertexAttribBinding
  • OpenGL version: 4.3

[View source]
def bind_vertex_buffer(buffer : Buffer, offset : Size, stride : Int32) : Nil #

Binds a vertex buffer to the slot.

  • OpenGL function: glBindVertexBuffer
  • OpenGL version: 4.3

[View source]
def divisor : UInt32 #

Retrieves the instance frequency of the attribute bound to this slot.

  • OpenGL function: glGetIntegeri_v
  • OpenGL enum: GL_VERTEX_BINDING_DIVISOR
  • OpenGL version: 4.3

[View source]
def divisor=(divisor : UInt32) #

Sets the instance frequency for the attribute bound to this slot.

  • OpenGL function glVertexBindingDivisor
  • OpenGL version: 4.3

[View source]
def index : UInt32 #

Index of this binding slot.


[View source]
def offset : Int64 #

Retrieves the byte offset to the first value of the attribute bound to this slot.

  • OpenGL function: glGetInteger64i_v
  • OpenGL enum: GL_VERTEX_BINDING_OFFSET
  • OpenGL version: 4.3

def stride : Int32 #

Retrieves the byte distance between values of the attribute bound to this slot.

  • OpenGL function: glGetIntegeri_v
  • OpenGL enum: GL_VERTEX_BINDING_STRIDE
  • OpenGL version: 4.3

[View source]