diff --git a/ebitenutil/debugprint.go b/ebitenutil/debugprint.go index 1ada20997..402eea53f 100644 --- a/ebitenutil/debugprint.go +++ b/ebitenutil/debugprint.go @@ -57,7 +57,7 @@ func (d *debugPrintState) drawText(r *ebiten.RenderTarget, str string, x, y int, geom.Concat(ebiten.TranslateGeometry(float64(x)+1, float64(y))) clrm := ebiten.ColorMatrixI() clrm.Concat(ebiten.ScaleColor(clr)) - r.DrawTexture(d.textTexture, parts, geom, clrm) + r.DrawImage(d.textTexture, parts, geom, clrm) } func (d *debugPrintState) DebugPrint(r *ebiten.RenderTarget, str string) { diff --git a/example/alphablending/main.go b/example/alphablending/main.go index f92be4c64..53f9a9fe5 100644 --- a/example/alphablending/main.go +++ b/example/alphablending/main.go @@ -53,7 +53,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { for i := 0; i < 10; i++ { geo := ebiten.TranslateGeometry(15+float64(i)*(diff), 20) clr := ebiten.ScaleColor(color.RGBA{0xff, 0xff, 0xff, 0x80}) - if err := ebiten.DrawWholeTexture(g.tmpRenderTarget, g.ebitenTexture, geo, clr); err != nil { + if err := ebiten.DrawWholeImage(g.tmpRenderTarget, g.ebitenTexture, geo, clr); err != nil { return err } } @@ -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.DrawWholeTexture(r, g.tmpRenderTarget.Texture(), geo, clr); err != nil { + if err := ebiten.DrawWholeImage(r, g.tmpRenderTarget.Texture(), geo, clr); err != nil { return err } } diff --git a/example/blocks/blocks/font.go b/example/blocks/blocks/font.go index fa1eb6f95..bf5564b22 100644 --- a/example/blocks/blocks/font.go +++ b/example/blocks/blocks/font.go @@ -56,7 +56,7 @@ func drawText(r *ebiten.RenderTarget, textures *Textures, str string, ox, oy, sc geoMat := ebiten.ScaleGeometry(float64(scale), float64(scale)) geoMat.Concat(ebiten.TranslateGeometry(float64(ox), float64(oy))) clrMat := ebiten.ScaleColor(clr) - r.DrawTexture(fontTextureId, parts, geoMat, clrMat) + r.DrawImage(fontTextureId, parts, geoMat, clrMat) } func drawTextWithShadow(r *ebiten.RenderTarget, textures *Textures, str string, x, y, scale int, clr color.Color) { diff --git a/example/blocks/blocks/gamescene.go b/example/blocks/blocks/gamescene.go index 02de0f939..656793f24 100644 --- a/example/blocks/blocks/gamescene.go +++ b/example/blocks/blocks/gamescene.go @@ -117,7 +117,7 @@ func (s *GameScene) Draw(r *ebiten.RenderTarget, textures *Textures) { geoMat := ebiten.ScaleGeometry(float64(fieldWidth)/float64(w), float64(fieldHeight)/float64(h)) geoMat.Concat(ebiten.TranslateGeometry(20, 20)) // TODO: magic number? colorMat := ebiten.ScaleColor(color.RGBA{0, 0, 0, 0x80}) - ebiten.DrawWholeTexture(r, field, geoMat, colorMat) + ebiten.DrawWholeImage(r, field, geoMat, colorMat) geoMat = ebiten.GeometryMatrixI() geoMat.Concat(ebiten.TranslateGeometry(20, 20)) diff --git a/example/blocks/blocks/piece.go b/example/blocks/blocks/piece.go index d0a4bae97..6891d1388 100644 --- a/example/blocks/blocks/piece.go +++ b/example/blocks/blocks/piece.go @@ -153,7 +153,7 @@ func drawBlocks(r *ebiten.RenderTarget, textures *Textures, blocks [][]BlockType } } blocksTexture := textures.GetTexture("blocks") - r.DrawTexture(blocksTexture, parts, geo, ebiten.ColorMatrixI()) + r.DrawImage(blocksTexture, parts, geo, ebiten.ColorMatrixI()) } func (p *Piece) InitialPosition() (int, int) { diff --git a/example/blocks/blocks/scenemanager.go b/example/blocks/blocks/scenemanager.go index 670b0d67e..f2afcc7f5 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.DrawWholeTexture(r, from.Texture(), ebiten.GeometryMatrixI(), color) + ebiten.DrawWholeImage(r, from.Texture(), ebiten.GeometryMatrixI(), color) alpha := float64(s.transitionCount) / float64(transitionMaxCount) color.Elements[3][3] = alpha - ebiten.DrawWholeTexture(r, to.Texture(), ebiten.GeometryMatrixI(), color) + ebiten.DrawWholeImage(r, to.Texture(), ebiten.GeometryMatrixI(), color) } func (s *SceneManager) GoTo(scene Scene) { diff --git a/example/blocks/blocks/titlescene.go b/example/blocks/blocks/titlescene.go index 2b6496200..36ff5ebda 100644 --- a/example/blocks/blocks/titlescene.go +++ b/example/blocks/blocks/titlescene.go @@ -70,7 +70,7 @@ func drawTitleBackground(r *ebiten.RenderTarget, textures *Textures, c int) { geo := ebiten.GeometryMatrixI() geo.Concat(ebiten.TranslateGeometry(float64(dx), float64(dy))) clr := ebiten.ColorMatrixI() - r.DrawTexture(backgroundTexture, parts, geo, clr) + r.DrawImage(backgroundTexture, parts, geo, clr) } func drawLogo(r *ebiten.RenderTarget, textures *Textures, str string) { diff --git a/example/image/main.go b/example/image/main.go index 1d1b9fd03..49d704920 100644 --- a/example/image/main.go +++ b/example/image/main.go @@ -60,7 +60,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { geo.Concat(ebiten.TranslateGeometry(screenWidth/2, screenHeight/2)) //clr := ebiten.RotateHue(float64(g.count%180) * 2 * math.Pi / 180) clr := ebiten.ColorMatrixI() - ebiten.DrawWholeTexture(r, g.gophersTexture, geo, clr) + ebiten.DrawWholeImage(r, g.gophersTexture, geo, clr) return nil } diff --git a/example/mosaic/main.go b/example/mosaic/main.go index c747e4c77..0d2fca6e1 100644 --- a/example/mosaic/main.go +++ b/example/mosaic/main.go @@ -37,10 +37,10 @@ type Game struct { func (g *Game) Update(r *ebiten.RenderTarget) error { geo := ebiten.ScaleGeometry(1.0/mosaicRatio, 1.0/mosaicRatio) - ebiten.DrawWholeTexture(g.gophersRenderTarget, g.gophersTexture, geo, ebiten.ColorMatrixI()) + ebiten.DrawWholeImage(g.gophersRenderTarget, g.gophersTexture, geo, ebiten.ColorMatrixI()) geo = ebiten.ScaleGeometry(mosaicRatio/2.0, mosaicRatio/2.0) - ebiten.DrawWholeTexture(r, g.gophersRenderTarget.Texture(), geo, ebiten.ColorMatrixI()) + ebiten.DrawWholeImage(r, g.gophersRenderTarget.Texture(), geo, ebiten.ColorMatrixI()) return nil } diff --git a/example/paint/main.go b/example/paint/main.go index ec55cc692..d85eb9a4e 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.DrawWholeTexture(g.canvasRenderTarget, g.brushRenderTarget.Texture(), geo, clr) + ebiten.DrawWholeImage(g.canvasRenderTarget, g.brushRenderTarget.Texture(), geo, clr) } - ebiten.DrawWholeTexture(r, g.canvasRenderTarget.Texture(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI()) + ebiten.DrawWholeImage(r, g.canvasRenderTarget.Texture(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI()) ebitenutil.DebugPrint(r, fmt.Sprintf("(%d, %d)", mx, my)) return nil diff --git a/example/perspective/main.go b/example/perspective/main.go index cb9058632..f24f5738d 100644 --- a/example/perspective/main.go +++ b/example/perspective/main.go @@ -48,7 +48,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error { geo := ebiten.TranslateGeometry(-maxWidth/2, -float64(h)/2) geo.Concat(ebiten.ScaleGeometry(0.4, 0.4)) geo.Concat(ebiten.TranslateGeometry(screenWidth/2, screenHeight/2)) - r.DrawTexture(g.gophersTexture, parts, geo, ebiten.ColorMatrixI()) + r.DrawImage(g.gophersTexture, parts, geo, ebiten.ColorMatrixI()) return nil } diff --git a/graphics.go b/graphics.go index f5e61cff4..0c534f887 100644 --- a/graphics.go +++ b/graphics.go @@ -35,12 +35,12 @@ type TexturePart struct { } // DrawWholeTexture draws the whole texture. -func DrawWholeTexture(r *RenderTarget, texture *Texture, geo GeometryMatrix, color ColorMatrix) error { +func DrawWholeImage(r *RenderTarget, texture *Texture, geo GeometryMatrix, color ColorMatrix) error { w, h := texture.Size() parts := []TexturePart{ {Rect{0, 0, float64(w), float64(h)}, Rect{0, 0, float64(w), float64(h)}}, } - return r.DrawTexture(texture, parts, geo, color) + return r.DrawImage(texture, parts, geo, color) } // Filter represents the type of filter to be used when a texture is maginified or minified. diff --git a/graphicscontext.go b/graphicscontext.go index 93232cac7..bc70d8db5 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -69,7 +69,7 @@ func (c *graphicsContext) postUpdate() error { parts := []TexturePart{ {Rect{0, 0, float64(w), float64(h)}, Rect{0, 0, float64(w), float64(h)}}, } - if err := c.defaultR.DrawTexture(c.screen.texture, parts, geo, clr); err != nil { + if err := c.defaultR.DrawImage(c.screen.texture, parts, geo, clr); err != nil { return err } diff --git a/rendertarget.go b/rendertarget.go index b9d581ff5..9f02da40b 100644 --- a/rendertarget.go +++ b/rendertarget.go @@ -68,7 +68,7 @@ func (r *innerRenderTarget) Fill(clr color.Color) error { return nil } -func (r *innerRenderTarget) DrawTexture(texture *Texture, parts []TexturePart, geo GeometryMatrix, color ColorMatrix) error { +func (r *innerRenderTarget) DrawImage(texture *Texture, parts []TexturePart, geo GeometryMatrix, color ColorMatrix) error { if err := r.glRenderTarget.SetAsViewport(); err != nil { return err } @@ -141,9 +141,9 @@ func (r *RenderTarget) Fill(clr color.Color) (err error) { return } -func (r *RenderTarget) DrawTexture(texture *Texture, parts []TexturePart, geo GeometryMatrix, color ColorMatrix) (err error) { +func (r *RenderTarget) DrawImage(texture *Texture, parts []TexturePart, geo GeometryMatrix, color ColorMatrix) (err error) { r.syncer.Sync(func() { - err = r.inner.DrawTexture(texture, parts, geo, color) + err = r.inner.DrawImage(texture, parts, geo, color) }) return }