;; comp is number of componenets (RGB=3, RGBA=4, depth=1 etc.)
(bind-func create_data
  (lambda (tex:Texture* width:i32 height:i32 comp:i32)
    ;; seems to need to be set
    (let ((data:float* (alloc (* width height comp))))
      (cond ((= comp 4)
             (tset! tex 1 GL_RGBA))
            ((= comp 3)
             (tset! tex 1 GL_RGB))
            ((= comp 1)
             (tset! tex 1 GL_DEPTH_COMPONENT))
            (else (println "Unknown number of components: " comp) 1:i32))
      (tset! tex 2 width)
      (tset! tex 3 height)
      (tset! tex 4 (cast data i8*))
      void)))