From 4addf8f9af6331b7833354cbdb303ae06c693135 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 11 Dec 2014 04:02:46 +0900 Subject: [PATCH] Rename PushOffscreen -> PushRenderTarget --- example/blocks/scenemanager.go | 8 ++++---- example/paint.go | 4 ++-- graphics.go | 4 ++-- internal/glfw/context.go | 8 ++++---- internal/opengl/context.go | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/example/blocks/scenemanager.go b/example/blocks/scenemanager.go index 67d27b427..7b0da3934 100644 --- a/example/blocks/scenemanager.go +++ b/example/blocks/scenemanager.go @@ -66,16 +66,16 @@ func (s *SceneManager) Draw(context ebiten.GraphicsContext, textures *Textures) return } from := textures.GetRenderTarget("scene_manager_transition_from") - context.PushOffscreen(from) + context.PushRenderTarget(from) context.Clear() s.current.Draw(context, textures) - context.PopOffscreen() + context.PopRenderTarget() to := textures.GetRenderTarget("scene_manager_transition_to") - context.PushOffscreen(to) + context.PushRenderTarget(to) context.Clear() s.next.Draw(context, textures) - context.PopOffscreen() + context.PopRenderTarget() color := ebiten.ColorMatrixI() ebiten.DrawWhole( diff --git a/example/paint.go b/example/paint.go index ab5a69044..cd497bd2a 100644 --- a/example/paint.go +++ b/example/paint.go @@ -36,9 +36,9 @@ func (g *Game) Draw(gr ebiten.GraphicsContext) error { if err != nil { return err } - gr.PushOffscreen(g.canvasRenderTarget) + gr.PushRenderTarget(g.canvasRenderTarget) gr.Fill(0xff, 0xff, 0xff) - gr.PopOffscreen() + gr.PopRenderTarget() } ebiten.DrawWhole(gr.RenderTarget(g.canvasRenderTarget), screenWidth, screenHeight, ebiten.GeometryMatrixI(), ebiten.ColorMatrixI()) diff --git a/graphics.go b/graphics.go index 8f1c280bd..11f3016cc 100644 --- a/graphics.go +++ b/graphics.go @@ -50,8 +50,8 @@ type GraphicsContext interface { Fill(r, g, b uint8) Texture(id TextureID) Drawer RenderTarget(id RenderTargetID) Drawer - PushOffscreen(id RenderTargetID) - PopOffscreen() + PushRenderTarget(id RenderTargetID) + PopRenderTarget() } // Filter represents the type of filter to be used when a texture or a render diff --git a/internal/glfw/context.go b/internal/glfw/context.go index b00c7b07c..970fe6f74 100644 --- a/internal/glfw/context.go +++ b/internal/glfw/context.go @@ -58,15 +58,15 @@ func (c *graphicsContext) RenderTarget(id ebiten.RenderTargetID) (d ebiten.Drawe return } -func (c *graphicsContext) PopOffscreen() { +func (c *graphicsContext) PopRenderTarget() { c.canvas.use(func() { - c.canvas.graphicsContext.PopOffscreen() + c.canvas.graphicsContext.PopRenderTarget() }) } -func (c *graphicsContext) PushOffscreen(id ebiten.RenderTargetID) { +func (c *graphicsContext) PushRenderTarget(id ebiten.RenderTargetID) { c.canvas.use(func() { - c.canvas.graphicsContext.PushOffscreen(id) + c.canvas.graphicsContext.PushRenderTarget(id) }) } diff --git a/internal/opengl/context.go b/internal/opengl/context.go index aa48f92fc..5c79dd8c5 100644 --- a/internal/opengl/context.go +++ b/internal/opengl/context.go @@ -84,22 +84,22 @@ func (c *GraphicsContext) RenderTarget(id ebiten.RenderTargetID) ebiten.Drawer { return &textureWithContext{idsInstance.toTexture(id), c} } -func (c *GraphicsContext) PushOffscreen(renderTargetID ebiten.RenderTargetID) { +func (c *GraphicsContext) PushRenderTarget(renderTargetID ebiten.RenderTargetID) { c.currentIDs = append(c.currentIDs, renderTargetID) } -func (c *GraphicsContext) PopOffscreen() { +func (c *GraphicsContext) PopRenderTarget() { c.currentIDs = c.currentIDs[:len(c.currentIDs)-1] } func (c *GraphicsContext) PreUpdate() { c.currentIDs = []ebiten.RenderTargetID{c.defaultID} - c.PushOffscreen(c.screenID) + c.PushRenderTarget(c.screenID) c.Clear() } func (c *GraphicsContext) PostUpdate() { - c.PopOffscreen() + c.PopRenderTarget() c.Clear() scale := float64(c.screenScale)