class Roglew::Texture2d
Attributes
handle[R]
id[R]
Public Class Methods
finalize(handle, id)
click to toggle source
# File lib/roglew/texture2d.rb, line 13 def self.finalize(handle, id) proc do #puts "releasing texture #{id}" handle.delete_textures [id] end end
new(handle)
click to toggle source
# File lib/roglew/texture2d.rb, line 7 def initialize(handle) @handle = handle @id = handle.bind { |context| context.gen_textures } ObjectSpace.define_finalizer(self, self.class.finalize(@handle, @id)) end
Public Instance Methods
bind(level = 0, deferred = nil, &block)
click to toggle source
# File lib/roglew/texture2d.rb, line 20 def bind(level = 0, deferred = nil, &block) create_binding(deferred, GL::TEXTURE_2D, level, &block) end