From 146c1db44aa871100d597d04534a8587edc51de1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 21 Dec 2014 02:45:50 +0900 Subject: [PATCH] Rename RenderTarget.Texture -> .Image --- example/alphablending/main.go | 2 +- example/blocks/blocks/scenemanager.go | 4 ++-- example/mosaic/main.go | 2 +- example/paint/main.go | 4 ++-- rendertarget.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/alphablending/main.go b/example/alphablending/main.go index 53f9a9fe5..383b9f9aa 100644 --- a/example/alphablending/main.go +++ b/example/alphablending/main.go @@ -62,7 +62,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { for i := 0; i < 10; i++ { geo := ebiten.TranslateGeometry(0, float64(i)*(diff)) clr := ebiten.ColorMatrixI() - if err := ebiten.DrawWholeImage(r, g.tmpRenderTarget.Texture(), geo, clr); err != nil { + if err := ebiten.DrawWholeImage(r, g.tmpRenderTarget.Image(), geo, clr); err != nil { return err } } diff --git a/example/blocks/blocks/scenemanager.go b/example/blocks/blocks/scenemanager.go index f2afcc7f5..b67fb3ec0 100644 --- a/example/blocks/blocks/scenemanager.go +++ b/example/blocks/blocks/scenemanager.go @@ -74,11 +74,11 @@ func (s *SceneManager) Draw(r *ebiten.RenderTarget, textures *Textures) { s.next.Draw(to, textures) color := ebiten.ColorMatrixI() - ebiten.DrawWholeImage(r, from.Texture(), ebiten.GeometryMatrixI(), color) + ebiten.DrawWholeImage(r, from.Image(), ebiten.GeometryMatrixI(), color) alpha := float64(s.transitionCount) / float64(transitionMaxCount) color.Elements[3][3] = alpha - ebiten.DrawWholeImage(r, to.Texture(), ebiten.GeometryMatrixI(), color) + ebiten.DrawWholeImage(r, to.Image(), ebiten.GeometryMatrixI(), color) } func (s *SceneManager) GoTo(scene Scene) { diff --git a/example/mosaic/main.go b/example/mosaic/main.go index 0d2fca6e1..c4918a793 100644 --- a/example/mosaic/main.go +++ b/example/mosaic/main.go @@ -40,7 +40,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { ebiten.DrawWholeImage(g.gophersRenderTarget, g.gophersTexture, geo, ebiten.ColorMatrixI()) geo = ebiten.ScaleGeometry(mosaicRatio/2.0, mosaicRatio/2.0) - ebiten.DrawWholeImage(r, g.gophersRenderTarget.Texture(), geo, ebiten.ColorMatrixI()) + ebiten.DrawWholeImage(r, g.gophersRenderTarget.Image(), geo, ebiten.ColorMatrixI()) return nil } diff --git a/example/paint/main.go b/example/paint/main.go index d85eb9a4e..770a4f987 100644 --- a/example/paint/main.go +++ b/example/paint/main.go @@ -54,10 +54,10 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { clr := ebiten.ScaleColor(color.RGBA{0xff, 0x40, 0x40, 0xff}) theta := 2.0 * math.Pi * float64(g.count%60) / 60.0 clr.Concat(ebiten.RotateHue(theta)) - ebiten.DrawWholeImage(g.canvasRenderTarget, g.brushRenderTarget.Texture(), geo, clr) + ebiten.DrawWholeImage(g.canvasRenderTarget, g.brushRenderTarget.Image(), geo, clr) } - ebiten.DrawWholeImage(r, g.canvasRenderTarget.Texture(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI()) + ebiten.DrawWholeImage(r, g.canvasRenderTarget.Image(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI()) ebitenutil.DebugPrint(r, fmt.Sprintf("(%d, %d)", mx, my)) return nil diff --git a/rendertarget.go b/rendertarget.go index 461a5df28..3bed7b552 100644 --- a/rendertarget.go +++ b/rendertarget.go @@ -119,7 +119,7 @@ type RenderTarget struct { inner *innerRenderTarget } -func (r *RenderTarget) Texture() *Texture { +func (r *RenderTarget) Image() *Texture { return r.inner.texture }