Class: Parasol::Shader
- Inherits:
-
Object
- Object
- Parasol::Shader
- Includes:
- OpenGLContext
- Defined in:
- lib/parasol/shader.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #compiled? ⇒ Boolean
- #delete ⇒ Object
- #handle ⇒ Object
-
#initialize(source:, type:) ⇒ Shader
constructor
A new instance of Shader.
Methods included from OpenGLContext
Constructor Details
#initialize(source:, type:) ⇒ Shader
Returns a new instance of Shader.
9 10 11 12 |
# File 'lib/parasol/shader.rb', line 9 def initialize source:, type: @source = source @type = type end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/parasol/shader.rb', line 7 def source @source end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/parasol/shader.rb', line 7 def type @type end |
Instance Method Details
#compiled? ⇒ Boolean
22 23 24 |
# File 'lib/parasol/shader.rb', line 22 def compiled? !the_shader.nil? end |
#delete ⇒ Object
18 19 20 |
# File 'lib/parasol/shader.rb', line 18 def delete cleanup end |
#handle ⇒ Object
14 15 16 |
# File 'lib/parasol/shader.rb', line 14 def handle the_shader || compile_the_shader! end |