Class: RLSL::CodeGenerator::ShaderFunctionGenerator
- Inherits:
-
Object
- Object
- RLSL::CodeGenerator::ShaderFunctionGenerator
- Defined in:
- lib/rlsl/code_generator/shader_function_generator.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(context) ⇒ ShaderFunctionGenerator
constructor
A new instance of ShaderFunctionGenerator.
Constructor Details
#initialize(context) ⇒ ShaderFunctionGenerator
Returns a new instance of ShaderFunctionGenerator.
6 7 8 |
# File 'lib/rlsl/code_generator/shader_function_generator.rb', line 6 def initialize(context) @context = context end |
Instance Method Details
#generate ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rlsl/code_generator/shader_function_generator.rb', line 10 def generate <<~C static vec3 shader_#{@context.name}(vec2 frag_coord, vec2 resolution, Uniforms u) { #{@context.fragment_code} } C end |