Class: RLSL::RuntimeShader

Inherits:
Object
  • Object
show all
Defined in:
lib/rlsl/runtime_shader.rb

Direct Known Subclasses

CompiledShader, MSL::Shader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, uniforms) ⇒ RuntimeShader

Returns a new instance of RuntimeShader.



7
8
9
10
11
# File 'lib/rlsl/runtime_shader.rb', line 7

def initialize(name, uniforms)
  @name = name
  @uniform_types = normalize_uniform_types(uniforms)
  @uniform_names = @uniform_types.keys
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/rlsl/runtime_shader.rb', line 5

def name
  @name
end

#uniform_namesObject (readonly)

Returns the value of attribute uniform_names.



5
6
7
# File 'lib/rlsl/runtime_shader.rb', line 5

def uniform_names
  @uniform_names
end

#uniform_typesObject (readonly)

Returns the value of attribute uniform_types.



5
6
7
# File 'lib/rlsl/runtime_shader.rb', line 5

def uniform_types
  @uniform_types
end

Instance Method Details

#metal?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rlsl/runtime_shader.rb', line 13

def metal?
  false
end

#renderObject

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/rlsl/runtime_shader.rb', line 17

def render(*)
  raise NotImplementedError, "Subclasses must implement render"
end