Class: Gl::VertexArray
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #__mark__, __marked_allocated__, #__unmark__, allocated, clear_all, delete_all, inherited, #marked?
Constructor Details
#initialize(name = nil) ⇒ VertexArray
Returns a new instance of VertexArray.
8
9
10
11
12
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 8
def initialize(name = nil)
super()
@name = name || 0
__mark__ if @name != 0
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6
7
8
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 6
def name
@name
end
|
Class Method Details
.unbind ⇒ Object
38
39
40
41
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 38
def self.unbind
Gl.glBindVertexArray(0)
self
end
|
Instance Method Details
#bind ⇒ Object
23
24
25
26
27
28
29
30
31
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 23
def bind
if @name == 0
@name = Gl.glGenVertexArrays(1)[0]
__mark__
end
Gl.glBindVertexArray(@name)
self
end
|
#delete ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 14
def delete
if @name != 0
Gl.glDeleteVertexArrays(@name)
@name = 0
super
end
self
end
|
#unbind ⇒ Object
33
34
35
36
|
# File 'lib/opengl-core/aux/vertex_array.rb', line 33
def unbind
self.class.unbind
self
end
|