Rename drivers -> driver

This commit is contained in:
Hajime Hoshi 2019-03-28 01:48:45 +09:00
parent 5e38f81462
commit 8ec7ae4c08
5 changed files with 18 additions and 18 deletions

View File

@ -19,7 +19,7 @@ import (
"math"
"github.com/hajimehoshi/ebiten/internal/clock"
"github.com/hajimehoshi/ebiten/internal/drivers"
"github.com/hajimehoshi/ebiten/internal/driver"
"github.com/hajimehoshi/ebiten/internal/graphicsdriver"
"github.com/hajimehoshi/ebiten/internal/hooks"
"github.com/hajimehoshi/ebiten/internal/shareable"
@ -123,7 +123,7 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
op := &DrawImageOptions{}
switch vd := drivers.Graphics().VDirection(); vd {
switch vd := driver.Graphics().VDirection(); vd {
case graphicsdriver.VDownward:
// c.screen is special: its Y axis is down to up,
// and the origin point is lower left.

View File

@ -15,7 +15,7 @@
// +build darwin,!ios
// +build !js
package drivers
package driver
// #cgo CFLAGS: -x objective-c
// #cgo LDFLAGS: -framework Foundation

View File

@ -14,7 +14,7 @@
// +build !darwin ios js
package drivers
package driver
import (
"github.com/hajimehoshi/ebiten/internal/graphicsdriver"

View File

@ -18,7 +18,7 @@ import (
"fmt"
"github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/drivers"
"github.com/hajimehoshi/ebiten/internal/driver"
"github.com/hajimehoshi/ebiten/internal/graphics"
)
@ -167,7 +167,7 @@ func (q *commandQueue) Flush() {
nc++
}
if 0 < ne {
drivers.Graphics().SetVertices(vs[:nv], es[:ne])
driver.Graphics().SetVertices(vs[:nv], es[:ne])
es = es[ne:]
vs = vs[nv:]
}
@ -187,7 +187,7 @@ func (q *commandQueue) Flush() {
}
if 0 < nc {
// Call glFlush to prevent black flicking (especially on Android (#226) and iOS).
drivers.Graphics().Flush()
driver.Graphics().Flush()
}
q.commands = q.commands[nc:]
}
@ -233,7 +233,7 @@ func (c *drawImageCommand) Exec(indexOffset int) error {
c.dst.image.SetAsDestination()
c.src.image.SetAsSource()
if err := drivers.Graphics().Draw(c.nindices, indexOffset, c.mode, c.color, c.filter, c.address); err != nil {
if err := driver.Graphics().Draw(c.nindices, indexOffset, c.mode, c.color, c.filter, c.address); err != nil {
return err
}
return nil
@ -439,7 +439,7 @@ func (c *newImageCommand) String() string {
// Exec executes a newImageCommand.
func (c *newImageCommand) Exec(indexOffset int) error {
i, err := drivers.Graphics().NewImage(c.width, c.height)
i, err := driver.Graphics().NewImage(c.width, c.height)
if err != nil {
return err
}
@ -479,7 +479,7 @@ func (c *newScreenFramebufferImageCommand) String() string {
// Exec executes a newScreenFramebufferImageCommand.
func (c *newScreenFramebufferImageCommand) Exec(indexOffset int) error {
var err error
c.result.image, err = drivers.Graphics().NewScreenFramebufferImage(c.width, c.height)
c.result.image, err = driver.Graphics().NewScreenFramebufferImage(c.width, c.height)
return err
}
@ -503,5 +503,5 @@ func (c *newScreenFramebufferImageCommand) CanMerge(dst, src *Image, color *affi
// ResetGraphicsDriverState resets or initializes the current graphics driver state.
func ResetGraphicsDriverState() error {
return drivers.Graphics().Reset()
return driver.Graphics().Reset()
}

View File

@ -27,7 +27,7 @@ import (
"time"
"github.com/hajimehoshi/ebiten/internal/devicescale"
"github.com/hajimehoshi/ebiten/internal/drivers"
"github.com/hajimehoshi/ebiten/internal/driver"
"github.com/hajimehoshi/ebiten/internal/glfw"
"github.com/hajimehoshi/ebiten/internal/hooks"
"github.com/hajimehoshi/ebiten/internal/input"
@ -99,7 +99,7 @@ func initialize() error {
if err := glfw.Init(); err != nil {
return err
}
if !drivers.Graphics().IsGL() {
if !driver.Graphics().IsGL() {
glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI)
}
glfw.WindowHint(glfw.Visible, glfw.False)
@ -604,7 +604,7 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
}
u.window = window
if drivers.Graphics().IsGL() {
if driver.Graphics().IsGL() {
u.window.MakeContextCurrent()
}
@ -679,7 +679,7 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
w = u.nativeWindow()
return nil
})
drivers.Graphics().SetWindow(w)
driver.Graphics().SetWindow(w)
return u.loop(g)
}
@ -834,7 +834,7 @@ func (u *userInterface) loop(g GraphicsContext) error {
// swapBuffers must be called from the main thread.
func (u *userInterface) swapBuffers() {
if drivers.Graphics().IsGL() {
if driver.Graphics().IsGL() {
u.window.SwapBuffers()
}
}
@ -932,7 +932,7 @@ func (u *userInterface) forceSetScreenSize(width, height int, scale float64, ful
u.window.SetTitle(u.title)
}
if drivers.Graphics().IsGL() {
if driver.Graphics().IsGL() {
// SwapInterval is affected by the current monitor of the window.
// This needs to be called at least after SetMonitor.
// Without SwapInterval after SetMonitor, vsynch doesn't work (#375).
@ -946,7 +946,7 @@ func (u *userInterface) forceSetScreenSize(width, height int, scale float64, ful
glfw.SwapInterval(0)
}
}
drivers.Graphics().SetVsyncEnabled(vsync)
driver.Graphics().SetVsyncEnabled(vsync)
u.toChangeSize = true
}