(bind-func FBO
(lambda (colour:Texture*)
(let ((fbo (FBO:[FBO*,i32,Texture*,Texture*,i32,i32]* 0 colour null (width colour) (height colour))))
(glGenFramebuffers 1 (tref-ptr fbo 0))
(gl_print_error "Error creating FBO")
(glBindFramebuffer GL_FRAMEBUFFER (tref fbo 0))
(bind colour)
(glFramebufferTexture2D GL_FRAMEBUFFER GL_COLOR_ATTACHMENT0 GL_TEXTURE_2D (id colour) 0)
(unbind colour)
(update colour)
(glBindFramebuffer GL_FRAMEBUFFER 0)
fbo)))