(bind-func ShaderProgram_create
"compile and link shader program (vert and frag shader)"
(lambda (vert:Shader* geom:Shader* frag:Shader*)
(if (not (and (= (Shader_type vert) GL_VERTEX_SHADER)
(= (Shader_type geom) GL_GEOMETRY_SHADER)
(= (Shader_type frag) GL_FRAGMENT_SHADER)))
(begin (println "Error: input shader types must be vert and frag respectively.")
-1)
(let ((program (glCreateProgram)))
(glAttachShader program (Shader_id vert))
(glAttachShader program (Shader_id geom))
(glAttachShader program (Shader_id frag))
(glLinkProgram program)
(ShaderProgram_print_info_log program)
program))))