Created
April 3, 2014 15:18
-
-
Save SimonDanisch/9956371 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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