write   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm

Implementation

(bind-func write
  (lambda (tex:Texture* filename:String* flip:i1)
    (let ((comp (if (= (type tex) GL_RGB) 3 4)))
      (if flip (stbi_flip_vertically (width tex) (height tex) comp (data tex)))
      (stbi_write_png (cstring filename) (width tex) (height tex)
                      comp
                      (data tex) (* (width tex) comp 1))
      void)))


Back to Index

Similar Entries