mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 20:28:54 +01:00
24 lines
564 B
Go
24 lines
564 B
Go
package texture
|
|
|
|
type RenderTarget struct {
|
|
framebuffer interface{}
|
|
offscreenWidth int
|
|
offscreenHeight int
|
|
}
|
|
|
|
func NewRenderTarget(framebuffer interface{}, width, height int) *RenderTarget {
|
|
return &RenderTarget{
|
|
framebuffer: framebuffer,
|
|
offscreenWidth: AdjustSize(width),
|
|
offscreenHeight: AdjustSize(height),
|
|
}
|
|
}
|
|
|
|
type OffscreenSetter interface {
|
|
Set(framebuffer interface{}, x, y, width, height int)
|
|
}
|
|
|
|
func (r *RenderTarget) SetAsOffscreen(setter OffscreenSetter) {
|
|
setter.Set(r.framebuffer, 0, 0, r.offscreenWidth, r.offscreenHeight)
|
|
}
|