;; asumming always GL_ARRAY_BUFFER at the moment
;; type is one of GL_DYNAMIC_DRAW, GL_STATIC_DRAW, GL_STREAM_DRAW etc..
(bind-func create_vbo
(lambda (size:i32 data:i8* type:i32)
(let ((vbo:E_vbo* (halloc))
(vboid:i32* (salloc)))
(glGenBuffers 1 vboid)
(glBindBuffer GL_ARRAY_BUFFER (pref vboid 0))
(glBufferData GL_ARRAY_BUFFER (convert size) null type)
;; (glBufferSubData GL_ARRAY_BUFFER 0 size data)
(tfill! vbo (pref vboid 0) size data)
(glBindBuffer GL_ARRAY_BUFFER 0)
vbo)))