ebiten/graphics/rendertarget/render_target.go

26 lines
604 B
Go
Raw Normal View History

2013-10-25 21:15:27 +02:00
package rendertarget
import (
"github.com/hajimehoshi/go-ebiten/graphics/texture"
)
type RenderTarget struct {
texture *texture.Texture
framebuffer interface{}
}
func NewWithFramebuffer(texture *texture.Texture, framebuffer interface{}) *RenderTarget {
return &RenderTarget{
texture: texture,
framebuffer: framebuffer,
}
}
func (renderTarget *RenderTarget) SetAsViewport(setter func(x, y, width, height int)) {
renderTarget.texture.SetAsViewport(setter)
}
2013-10-27 13:27:16 +01:00
func (renderTarget *RenderTarget) SetAsOffscreen(setter func(framebuffer interface{})) {
setter(renderTarget.framebuffer)
}