(bind-func xtm_render_init
(lambda (w h)
(let ((quad-vert (sys_slurp_file "libs/external/gl/quad_v.glsl"))
(quad-frag (sys_slurp_file "libs/external/gl/quad_f.glsl"))
(dof-frag (sys_slurp_file "libs/external/gl/dof_f.glsl"))
(simple-vert (sys_slurp_file "libs/external/gl/simple_v.glsl"))
(simple-frag (sys_slurp_file "libs/external/gl/simple_f.glsl"))
(lights-vert (sys_slurp_file "libs/external/gl/lights_v.glsl"))
(lights-frag (sys_slurp_file "libs/external/gl/lights_f.glsl"))
(skybox-vert (sys_slurp_file "libs/external/gl/sky_v.glsl"))
(skybox-frag (sys_slurp_file "libs/external/gl/sky_f.glsl")))
(println "XTM RENDER SETUP on thread:" (thread_self))
(println 'init 'draw 'quad)
(init_draw_quad)
(println 'init 'QUAD 'shader)
(xtm_render_init_quad_shader quad-vert quad-frag)
(println 'init 'DOF 'shader)
(xtm_render_init_dof_shader quad-vert dof-frag)
(println 'init 'SIMPLE 'shader)
(xtm_render_init_simple_shader simple-vert simple-frag)
;; (println 'init 'SIMPLE_BONE 'shader)
;; (xtm_render_init_simple_bone_shader simple-bone-vert-xtm simple-frag)
(println 'init 'LIGHT 'shader)
(xtm_render_init_light_shader lights-vert lights-frag)
(println 'init 'SKYBOX 'shader)
(xtm_render_init_skybox_shader skybox-vert skybox-frag)
(println 'all-shaders-initialized)
(set! xtm_render_w w)
(set! xtm_render_h h)
(set! XTM_BACKGROUND_COLOUR (vector 0.7:float 0.7 0.7 1.0))
(xtm_shadow_fbo)
(gl_print_error "error setting-up xtm_shadow_fbo")
(xtm_render_fbo)
(gl_print_error "error setting-up xtm_render_fbo")
(printf "XTM Render Setup Complete\n")
void)))