;; draw system
(bind-func psystem_draw
(let ((my_vertex:i32 -1)
(my_colour:i32 -1)
(my_velocity:i32 -1)
(my_state:i32 -1)
(my_size:i32 -1))
(lambda (psys:psystem*)
(let ((i 0)
(size (tref psys 0))
(texid (tref psys 1))
;; (data (tref psys 2))
(vbo (tref psys 3))
(cnt 0))
(if (= my_vertex -1)
(begin
(set! my_vertex (glGetAttribLocation particle_shader "myVertex"))
(set! my_colour (glGetAttribLocation particle_shader "myColour"))
(set! my_size (glGetAttribLocation particle_shader "mySize"))
(set! my_velocity (glGetAttribLocation particle_shader "myVelocity"))
(set! my_state (glGetAttribLocation particle_shader "myState"))))