Esempio n. 1
0
func newFramebufferFromTexture(context *opengl.Context, texture *texture) (*framebuffer, error) {
	native, err := context.NewFramebuffer(opengl.Texture(texture.native))
	if err != nil {
		return nil, err
	}
	return &framebuffer{
		native: native,
		width:  texture.width,
		height: texture.height,
	}, nil
}
Esempio n. 2
0
func NewFramebufferFromTexture(c *opengl.Context, texture *Texture) (*Framebuffer, error) {
	f, err := c.NewFramebuffer(opengl.Texture(texture.native))
	if err != nil {
		return nil, err
	}
	w, h := texture.Size()
	return &Framebuffer{
		native: f,
		width:  w,
		height: h,
	}, nil
}