mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphicsdriver/opengl: Rename GetDriver -> Get
This commit is contained in:
parent
2313f79160
commit
e24f6b7848
@ -20,5 +20,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func driver() graphicsdriver.GraphicsDriver {
|
func driver() graphicsdriver.GraphicsDriver {
|
||||||
return opengl.GetDriver()
|
return opengl.Get()
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
|
|
||||||
var theDriver Driver
|
var theDriver Driver
|
||||||
|
|
||||||
func GetDriver() *Driver {
|
func Get() *Driver {
|
||||||
return &theDriver
|
return &theDriver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,8 +206,8 @@ func (u *userInterface) update(g GraphicsContext) error {
|
|||||||
}
|
}
|
||||||
hooks.ResumeAudio()
|
hooks.ResumeAudio()
|
||||||
|
|
||||||
if opengl.GetDriver().IsContextLost() {
|
if opengl.Get().IsContextLost() {
|
||||||
opengl.GetDriver().RestoreContext()
|
opengl.Get().RestoreContext()
|
||||||
g.Invalidate()
|
g.Invalidate()
|
||||||
|
|
||||||
// Need to return once to wait restored (#526)
|
// Need to return once to wait restored (#526)
|
||||||
|
@ -53,7 +53,7 @@ func Render(chError <-chan error) error {
|
|||||||
// TODO: Check this is called on the rendering thread
|
// TODO: Check this is called on the rendering thread
|
||||||
select {
|
select {
|
||||||
case renderCh <- struct{}{}:
|
case renderCh <- struct{}{}:
|
||||||
return opengl.GetDriver().DoWork(chError, renderChEnd)
|
return opengl.Get().DoWork(chError, renderChEnd)
|
||||||
case <-time.After(500 * time.Millisecond):
|
case <-time.After(500 * time.Millisecond):
|
||||||
// This function must not be blocked. We need to break for timeout.
|
// This function must not be blocked. We need to break for timeout.
|
||||||
return nil
|
return nil
|
||||||
@ -152,9 +152,9 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
|
|||||||
|
|
||||||
if mainloop {
|
if mainloop {
|
||||||
ctx := <-glContextCh
|
ctx := <-glContextCh
|
||||||
opengl.GetDriver().InitWithContext(ctx)
|
opengl.Get().InitWithContext(ctx)
|
||||||
} else {
|
} else {
|
||||||
opengl.GetDriver().Init()
|
opengl.Get().Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force to set the screen size
|
// Force to set the screen size
|
||||||
|
Loading…
Reference in New Issue
Block a user