Class: Roglew::Query
- Inherits:
-
Object
- Object
- Roglew::Query
- Defined in:
- lib/roglew/extensions/GL_VERSION_1_5/query.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
-
#initialize(handle) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(handle) ⇒ Query
Returns a new instance of Query.
6 7 8 9 10 |
# File 'lib/roglew/extensions/GL_VERSION_1_5/query.rb', line 6 def initialize(handle) @handle = handle @id = handle.bind { |context| context.gen_queries } ObjectSpace.define_finalizer(self, self.class.finalize(@handle, @id)) end |
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
4 5 6 |
# File 'lib/roglew/extensions/GL_VERSION_1_5/query.rb', line 4 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/roglew/extensions/GL_VERSION_1_5/query.rb', line 4 def id @id end |
Class Method Details
.finalize(handle, id) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/roglew/extensions/GL_VERSION_1_5/query.rb', line 12 def self.finalize(handle, id) proc do #puts "releasing query #{id}" handle.bind { |context| context.delete_queries(id) } end end |