6 implementations of Texture:
#1
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm ·
#2
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm ·
#3
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm ·
#4
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm ·
#5
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm ·
#6
/digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
;; texture from existing data (no copy)
(bind-func Texture
(lambda (width:i32 height:i32 comp:i32 data:i8*)
(let ((tex (cond ((= comp 1)
(Texture:[Texture*,i32]* GL_DEPTH_COMPONENT))
((= comp 3)
(Texture:[Texture*,i32]* GL_RGB))
(else
(Texture:[Texture*,i32]* GL_RGBA)))))
(tset! tex 2 width)
(tset! tex 3 height)
(tset! tex 4 (cast data i8*))
(update tex)
tex)))