Class: Roglew::FramebufferARB
- Inherits:
-
Object
- Object
- Roglew::FramebufferARB
- Defined in:
- lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(target, deferred = nil, &block) ⇒ Object
target: one of GL::DRAW_FRAMEBUFFER, GL::READ_FRAMEBUFFER or GL::FRAMEBUFFER.
-
#initialize(handle) ⇒ FramebufferARB
constructor
A new instance of FramebufferARB.
Constructor Details
#initialize(handle) ⇒ FramebufferARB
Returns a new instance of FramebufferARB.
7 8 9 10 11 |
# File 'lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb', line 7 def initialize(handle) @handle = handle @id = handle.bind { |context| context.gen_framebuffers } ObjectSpace.define_finalizer(self, self.class.finalize(@handle, @id)) end |
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
5 6 7 |
# File 'lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb', line 5 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb', line 5 def id @id end |
Class Method Details
.finalize(handle, id) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb', line 13 def self.finalize(handle, id) proc do #puts "releasing framebuffer #{id}" handle.bind { |context| context.delete_framebuffers(id) } end end |
Instance Method Details
#bind(target, deferred = nil, &block) ⇒ Object
target: one of GL::DRAW_FRAMEBUFFER, GL::READ_FRAMEBUFFER or GL::FRAMEBUFFER
21 22 23 |
# File 'lib/roglew/extensions/GL_ARB_framebuffer_object/framebuffer.rb', line 21 def bind(target, deferred = nil, &block) create_binding(deferred, target, &block) end |