class Prism::Shader::CompiledProgram
- Prism::Shader::CompiledProgram
- Reference
- Object
Overview
Stores the OpenGL ids and other information for a shader program
TODO this doing a lot of work. I'd rather this simply be a data holder
and let Shader::Loader
do all the work. Then this could be a struct.
Defined in:
prism/shader/compiled_program.crConstructors
Instance Method Summary
-
#attach_shader(shader_id : LibGL::UInt)
Attaches a shader to the program
-
#bind_attribute(variable_name : String, attribute_location : LibGL::Int)
Binds an attribute to the program In older versions of glsl code this will be variables prefixed with
attribute
keyword. -
#finalize
garbage collection
-
#id : UInt32
Returns the shader program id
- #num_attributes : UInt32
- #program : UInt32
- #uniform_names : Array(String)
- #uniform_types : Array(String)
- #uniforms : Hash(String, Int32)
Constructor Detail
Instance Method Detail
def bind_attribute(variable_name : String, attribute_location : LibGL::Int)
#
Binds an attribute to the program
In older versions of glsl code this will be variables prefixed with attribute
keyword.
Newer versions of glsl use the in
keyword.
In both cases these represent values stored in the "vertex attribute buffer" or "vertex buffer object" (vbo).