;; creates an empty texture
;; suitable to back an FBO
(bind-func fbo_create_texture_rect
(lambda (width height)
(let ((id:i32* (salloc))
(tex:i32* (salloc)))
(glGenRenderbuffers 1 id)
(glBindRenderbuffer GL_RENDERBUFFER (pref id 0))
;;(glRenderbufferStorage GL_RENDERBUFFER GL_RGBA16F width height)
(glRenderbufferStorage GL_RENDERBUFFER GL_RGBA8 width height)
(glFramebufferRenderbuffer GL_FRAMEBUFFER GL_COLOR_ATTACHMENT0 GL_RENDERBUFFER (pref id 0))