struct Gloop::BufferList

Overview

Collection of buffers belonging to the same context.

Defined in:

gloop/buffer.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Gloop::ObjectList(Gloop::Buffer)

size size, to_slice to_slice, to_unsafe to_unsafe, unsafe_fetch(index : Int) unsafe_fetch

Constructor methods inherited from struct Gloop::ObjectList(Gloop::Buffer)

new(context : Context, names : Slice(Object::Name))
new(context : Context, names : Enumerable(Object::Name))
new(context : Context, objects : Enumerable(T))
new(context : Context, size : Int, &)
new

Constructor Detail

def self.create(context, count : Int) : self #

Creates multiple new buffers.

The number of buffers to create is given by count. Unlike .generate, resources are created in advance instead of on the first binding.

  • OpenGL function: glCreateBuffers
  • OpenGL version: 4.5

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

Generates multiple new buffers.

This ensures unique names for the buffer objects. Resources are not allocated for the buffers until they are bound.

See: .create

  • OpenGL function: glGenBuffers
  • OpenGL version: 2.0

[View source]
def self.new(context : Context, names : Slice(Object::Name)) #

Creates a list of objects from the same context with their names.


[View source]
def self.new(context : Context, names : Enumerable(Object::Name)) #

Creates a list of objects from the same context with their names.


[View source]
def self.new(context : Context, objects : Enumerable(T)) #

Creates a list of object from the same context.


[View source]
def self.new(context : Context, size : Int, &) #

Creates a list of objects from the same context.

Yields a pointer to a block of memory to populate with object names.


[View source]

Instance Method Detail

def delete : Nil #

Deletes all buffers in the list.

  • OpenGL function: glDeleteBuffers
  • OpenGL version: 2.0

[View source]