mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
parent
7f64043ba5
commit
f0c2c0e8e9
@ -114,8 +114,8 @@ type screen struct {
|
||||
game *monogame.Game
|
||||
}
|
||||
|
||||
func (s *screen) SetAsDestination() {
|
||||
s.game.ResetDestination()
|
||||
func (s *screen) SetAsDestination(viewportWidth, viewportHeight int) {
|
||||
s.game.ResetDestination(viewportWidth, viewportHeight)
|
||||
}
|
||||
|
||||
func (s *screen) SetAsSource() {
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
type RenderTarget2D interface {
|
||||
SetAsDestination()
|
||||
SetAsDestination(viewportWidth, viewportHeight int)
|
||||
SetAsSource()
|
||||
ReplacePixels(args []*driver.ReplacePixelsArgs)
|
||||
Dispose()
|
||||
@ -48,7 +48,7 @@ func (*Image) Pixels() ([]byte, error) {
|
||||
}
|
||||
|
||||
func (i *Image) SetAsDestination() {
|
||||
i.v.SetAsDestination()
|
||||
i.v.SetAsDestination(i.width, i.height)
|
||||
}
|
||||
|
||||
func (i *Image) SetAsSource() {
|
||||
|
@ -110,8 +110,8 @@ func (g *Game) Draw(indexLen int, indexOffset int, mode driver.CompositeMode, co
|
||||
g.binding.Call("Draw", indexLen, indexOffset)
|
||||
}
|
||||
|
||||
func (g *Game) ResetDestination() {
|
||||
g.binding.Set("Dst", nil)
|
||||
func (g *Game) ResetDestination(viewportWidth, viewportHeight int) {
|
||||
g.binding.Call("SetDestination", nil, viewportWidth, viewportHeight)
|
||||
}
|
||||
|
||||
type RenderTarget2D struct {
|
||||
@ -132,10 +132,10 @@ func (r *RenderTarget2D) ReplacePixels(args []*driver.ReplacePixelsArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *RenderTarget2D) SetAsDestination() {
|
||||
r.binding.Set("Dst", r.v)
|
||||
func (r *RenderTarget2D) SetAsDestination(viewportWidth, viewportHeight int) {
|
||||
r.binding.Call("SetDestination", r.v, viewportWidth, viewportHeight)
|
||||
}
|
||||
|
||||
func (r *RenderTarget2D) SetAsSource() {
|
||||
r.binding.Set("Src", r.v)
|
||||
r.binding.Call("SetSource", r.v)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user