Class: RLSL::CompiledShader

Inherits:
RuntimeShader show all
Defined in:
lib/rlsl/compiled_shader.rb

Instance Attribute Summary

Attributes inherited from RuntimeShader

#name, #uniform_names, #uniform_types

Instance Method Summary collapse

Methods inherited from RuntimeShader

#metal?

Constructor Details

#initialize(name, ext_name, uniforms) ⇒ CompiledShader

Returns a new instance of CompiledShader.



5
6
7
8
9
# File 'lib/rlsl/compiled_shader.rb', line 5

def initialize(name, ext_name, uniforms)
  super(name, uniforms)
  @ext_name = ext_name
  @render_method = RLSL::CompiledShaders.method("#{name}_render")
end

Instance Method Details

#render(buffer, width, height, uniforms = {}) ⇒ Object



11
12
13
14
# File 'lib/rlsl/compiled_shader.rb', line 11

def render(buffer, width, height, uniforms = {})
  args = [buffer, width, height] + ordered_uniform_values(uniforms)
  @render_method.call(*args)
end