(bind-func create_triangle_shader
(lambda (vsource:i8* fsource:i8*)
(let ((vert (glCreateShader GL_VERTEX_SHADER))
(frag (glCreateShader GL_FRAGMENT_SHADER))
(source_ptr:i8** (salloc))
(program (glCreateProgram)))
;; vert shader
(pset! source_ptr 0 vsource)
(glShaderSource vert 1 source_ptr (cast null i32*))
(glCompileShader vert)
;; frag shader
(pset! source_ptr 0 fsource)
(glShaderSource frag 1 source_ptr (cast null i32*))
(glCompileShader frag)
(glAttachShader program vert)
(glAttachShader program frag)
(glLinkProgram program)
(set! sp program))))