diff --git a/internal/driver/graphics.go b/internal/driver/graphics.go index a4d32d0a5..30fbe3ae6 100644 --- a/internal/driver/graphics.go +++ b/internal/driver/graphics.go @@ -32,7 +32,7 @@ type Graphics interface { Reset() error Draw(indexLen int, indexOffset int, mode CompositeMode, colorM *affine.ColorM, filter Filter, address Address) error SetVsyncEnabled(enabled bool) - VDirection() VDirection + FramebufferYDirection() YDirection NeedsRestoring() bool IsGL() bool HasHighPrecisionFloat() bool @@ -59,9 +59,9 @@ type ReplacePixelsArgs struct { Height int } -type VDirection int +type YDirection int const ( - VUpward VDirection = iota - VDownward + Upward YDirection = iota + Downward ) diff --git a/internal/graphicsdriver/metal/graphics.go b/internal/graphicsdriver/metal/graphics.go index 132d7f925..0cace3c80 100644 --- a/internal/graphicsdriver/metal/graphics.go +++ b/internal/graphicsdriver/metal/graphics.go @@ -684,8 +684,8 @@ func (g *Graphics) SetVsyncEnabled(enabled bool) { g.view.setDisplaySyncEnabled(enabled) } -func (g *Graphics) VDirection() driver.VDirection { - return driver.VUpward +func (g *Graphics) FramebufferYDirection() driver.YDirection { + return driver.Downward } func (g *Graphics) NeedsRestoring() bool { diff --git a/internal/graphicsdriver/monogame/graphics.go b/internal/graphicsdriver/monogame/graphics.go index ffdc3c340..efaf8586b 100644 --- a/internal/graphicsdriver/monogame/graphics.go +++ b/internal/graphicsdriver/monogame/graphics.go @@ -91,8 +91,8 @@ func (g *Graphics) SetVsyncEnabled(enabled bool) { panic("monogame: SetVsyncEnabled is not implemented yet") } -func (g *Graphics) VDirection() driver.VDirection { - return driver.VUpward +func (g *Graphics) FramebufferYDirection() driver.YDirection { + return driver.Downward } func (g *Graphics) NeedsRestoring() bool { diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 65408858b..e48b0cd8b 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -129,8 +129,8 @@ func (g *Graphics) SetVsyncEnabled(enabled bool) { // Do nothing } -func (g *Graphics) VDirection() driver.VDirection { - return driver.VDownward +func (g *Graphics) FramebufferYDirection() driver.YDirection { + return driver.Upward } func (g *Graphics) NeedsRestoring() bool { diff --git a/uicontext.go b/uicontext.go index 19c76748f..f6ac168da 100644 --- a/uicontext.go +++ b/uicontext.go @@ -307,14 +307,14 @@ func (c *uiContext) draw() { op := &DrawImageOptions{} s := c.screenScale() - switch vd := uiDriver().Graphics().VDirection(); vd { - case driver.VDownward: + switch vd := uiDriver().Graphics().FramebufferYDirection(); vd { + case driver.Upward: // c.screen is special: its Y axis is down to up, // and the origin point is lower left. op.GeoM.Scale(s, -s) _, h := c.offscreen.Size() op.GeoM.Translate(0, float64(h)*s) - case driver.VUpward: + case driver.Downward: op.GeoM.Scale(s, s) default: panic(fmt.Sprintf("ebiten: invalid v-direction: %d", vd))