class Prism::Shader::CompiledProgram

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def attach_shader(shader_id : LibGL::UInt) #

Attaches a shader to the program


[View source]
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).


[View source]
def finalize #

garbage collection


[View source]
def id : UInt32 #

Returns the shader program id


[View source]
def num_attributes : UInt32 #

[View source]
def program : UInt32 #

[View source]
def uniform_names : Array(String) #

[View source]
def uniform_types : Array(String) #

[View source]
def uniforms : Hash(String, Int32) #

[View source]