Skip to content

Instantly share code, notes, and snippets.

@SimonDanisch
Created April 3, 2014 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimonDanisch/9956371 to your computer and use it in GitHub Desktop.
Save SimonDanisch/9956371 to your computer and use it in GitHub Desktop.
#This can be made more usable with a lot of defaults
immutable GLRenderObject
vertexArray::GLVertexArray
uniforms::Dict{ASCIIString, Any}
shader::GLProgram
preRenderFunctions::Arrray{Tuple, 1},
postRenderFunctions::Arrray{Tuple, 1}
function GLRenderObject(
vertShader::Dict{ASCIIString, Any},
fragShader::Dict{ASCIIString, Any})
shader = GLProgram(toVertShader(vertShader), toFragShader(fragShader))
buffers = filter(x -> isa(x, GLBuffer), collect(values(vertShader)))
uniforms = filter(x -> !isa(x, GLBuffer) && !isa(x, (Function, Tuple)), collect(values(vertShader)))
vertexArray = GLVertexArray(buffers)
new(vertexArray, uniforms, shader, (Function, Tuple)[], (Function, Tuple)[])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment