;; load shader (vert and frag shader)
(bind-func create_shader
(lambda (vsource:i8* fsource:i8*)
(let ((fshader (glCreateShader GL_FRAGMENT_SHADER))
(vshader (glCreateShader GL_VERTEX_SHADER))
(fcode:|1,i8*|* (salloc 1))
(vcode:|1,i8*|* (salloc 1))
(program (glCreateProgram))
(temp:i32* (salloc 1)))
(pset! fcode 0 fsource)
(pset! vcode 0 vsource)
(glShaderSource fshader 1 (cast fcode i8**) (bitcast null i32*))
(glShaderSource vshader 1 (cast vcode i8**) (bitcast null i32*))
(glCompileShader fshader)
(glCompileShader vshader)
(glAttachShader program fshader)
(glAttachShader program vshader)
(glLinkProgram program)
(print_shader_info_log fshader)
(print_shader_info_log vshader)
(print_program_info_log program)
program)))