// TODO pass in an actual Texture ... func NewTextureBuffer(ctx gl.Context, width, height int) *TextureFramebuffer { buf := &TextureFramebuffer{w: width, h: height} buf.fbo = Framebuffer{ctx.CreateFramebuffer()} buf.tex = Texture{ctx.CreateTexture()} buf.def = TextureDef(0, width, height, gl.RGBA, nil) buf.filter = TextureFilter(gl.LINEAR, gl.LINEAR) buf.wrap = TextureWrap(gl.REPEAT, gl.REPEAT) buf.withtex = FramebufferWithTex(buf.tex, 0, buf.def, buf.filter, buf.wrap) return buf }
func (fbo *Framebuffer) Create(ctx gl.Context) { fbo.Framebuffer = ctx.CreateFramebuffer() }