Class: Hate::Graphics::Shader::Program
- Inherits:
-
Object
- Object
- Hate::Graphics::Shader::Program
- Defined in:
- lib/hate/graphics/shader.rb
Instance Method Summary collapse
- #attach(shader) ⇒ Object
- #compile ⇒ Object
-
#initialize ⇒ Program
constructor
A new instance of Program.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Program
Returns a new instance of Program.
7 8 9 |
# File 'lib/hate/graphics/shader.rb', line 7 def initialize @program = glCreateProgram end |
Instance Method Details
#attach(shader) ⇒ Object
11 12 13 14 |
# File 'lib/hate/graphics/shader.rb', line 11 def attach(shader) glAttachShader(@program, shader) self end |
#compile ⇒ Object
16 17 18 19 |
# File 'lib/hate/graphics/shader.rb', line 16 def compile glLinkProgram(@program) self end |
#run ⇒ Object
21 22 23 |
# File 'lib/hate/graphics/shader.rb', line 21 def run glUseProgram(@program) end |