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