struct Gloop::VertexArray::Binding

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, Attribute

Included Modules

Defined in:

gloop/vertex_array/binding.cr

Constructors

Instance Method Summary

Constructor Detail

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

Creates a reference to a binding slot in a vertex array.


[View source]

Instance Method Detail

def attribute=(attribute : Attribute) #

Binds an attribute to the slot.

  • OpenGL function: glVertexArrayAttribBinding
  • OpenGL version: 4.5

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

Binds a vertex buffer to the slot.

  • OpenGL function: glVertexArrayVertexBuffer
  • OpenGL version: 4.5

[View source]
def divisor : UInt32 #

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

  • OpenGL function: glGetVertexArrayIndexediv
  • OpenGL enum: GL_VERTEX_BINDING_DIVISOR
  • OpenGL version: 4.5

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

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

  • OpenGL function glVertexArrayBindingDivisor
  • OpenGL version: 4.5

[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: glGetVertexArrayIndexed64iv
  • OpenGL enum: GL_VERTEX_BINDING_OFFSET
  • OpenGL version: 4.5

def stride : Int32 #

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

  • OpenGL function: glGetVertexArrayIndexediv
  • OpenGL enum: GL_VERTEX_BINDING_STRIDE
  • OpenGL version: 4.5

[View source]