mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
parent
de8707f6a1
commit
de02bcf19f
@ -129,3 +129,7 @@ func (s *screen) ReplacePixels(args []*driver.ReplacePixelsArgs) {
|
|||||||
func (s *screen) Dispose() {
|
func (s *screen) Dispose() {
|
||||||
// Do nothing?
|
// Do nothing?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *screen) IsScreen() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
@ -26,6 +26,7 @@ type RenderTarget2D interface {
|
|||||||
SetAsSource()
|
SetAsSource()
|
||||||
ReplacePixels(args []*driver.ReplacePixelsArgs)
|
ReplacePixels(args []*driver.ReplacePixelsArgs)
|
||||||
Dispose()
|
Dispose()
|
||||||
|
IsScreen() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
@ -49,7 +50,10 @@ func (*Image) Pixels() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) SetAsDestination() {
|
func (i *Image) SetAsDestination() {
|
||||||
w, h := graphics.InternalImageSize(i.width), graphics.InternalImageSize(i.height)
|
w, h := i.width, i.height
|
||||||
|
if !i.v.IsScreen() {
|
||||||
|
w, h = graphics.InternalImageSize(w), graphics.InternalImageSize(h)
|
||||||
|
}
|
||||||
i.v.SetAsDestination(w, h)
|
i.v.SetAsDestination(w, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ func (g *Game) SetVertices(vertices []float32, indices []uint16) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) Draw(indexLen int, indexOffset int, mode driver.CompositeMode, colorM *affine.ColorM, filter driver.Filter, address driver.Address) {
|
func (g *Game) Draw(indexLen int, indexOffset int, mode driver.CompositeMode, colorM *affine.ColorM, filter driver.Filter, address driver.Address) {
|
||||||
// TODO: Implement this
|
src, dst := mode.Operations()
|
||||||
g.binding.Call("Draw", indexLen, indexOffset)
|
g.binding.Call("Draw", indexLen, indexOffset, int(src), int(dst))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) ResetDestination(viewportWidth, viewportHeight int) {
|
func (g *Game) ResetDestination(viewportWidth, viewportHeight int) {
|
||||||
@ -139,3 +139,7 @@ func (r *RenderTarget2D) SetAsDestination(viewportWidth, viewportHeight int) {
|
|||||||
func (r *RenderTarget2D) SetAsSource() {
|
func (r *RenderTarget2D) SetAsSource() {
|
||||||
r.binding.Call("SetSource", r.v)
|
r.binding.Call("SetSource", r.v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *RenderTarget2D) IsScreen() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user