class Roglew::Buffer

Attributes

handle[R]
id[R]

Public Class Methods

finalize(handle, id) click to toggle source
# File lib/roglew/extensions/GL_VERSION_1_5/buffer.rb, line 14
def self.finalize(handle, id)
  proc do
    #puts "releasing buffer #{id}"
    handle.bind { |context| context.delete_buffers(id) }
  end
end
new(handle) click to toggle source
# File lib/roglew/extensions/GL_VERSION_1_5/buffer.rb, line 7
def initialize(handle)
  @handle = handle
  @id = handle.bind { |context| context.gen_buffers }

  ObjectSpace.define_finalizer(self, self.class.finalize(@handle, @id))
end

Public Instance Methods

bind(target, deferred = nil, &block) click to toggle source
# File lib/roglew/extensions/GL_VERSION_1_5/buffer.rb, line 21
def bind(target, deferred = nil, &block)
  create_binding(deferred, target, &block)
end