mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58: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 {
|
||||
return opengl.GetDriver()
|
||||
return opengl.Get()
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
|
||||
var theDriver Driver
|
||||
|
||||
func GetDriver() *Driver {
|
||||
func Get() *Driver {
|
||||
return &theDriver
|
||||
}
|
||||
|
||||
|
@ -206,8 +206,8 @@ func (u *userInterface) update(g GraphicsContext) error {
|
||||
}
|
||||
hooks.ResumeAudio()
|
||||
|
||||
if opengl.GetDriver().IsContextLost() {
|
||||
opengl.GetDriver().RestoreContext()
|
||||
if opengl.Get().IsContextLost() {
|
||||
opengl.Get().RestoreContext()
|
||||
g.Invalidate()
|
||||
|
||||
// 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
|
||||
select {
|
||||
case renderCh <- struct{}{}:
|
||||
return opengl.GetDriver().DoWork(chError, renderChEnd)
|
||||
return opengl.Get().DoWork(chError, renderChEnd)
|
||||
case <-time.After(500 * time.Millisecond):
|
||||
// This function must not be blocked. We need to break for timeout.
|
||||
return nil
|
||||
@ -152,9 +152,9 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
|
||||
|
||||
if mainloop {
|
||||
ctx := <-glContextCh
|
||||
opengl.GetDriver().InitWithContext(ctx)
|
||||
opengl.Get().InitWithContext(ctx)
|
||||
} else {
|
||||
opengl.GetDriver().Init()
|
||||
opengl.Get().Init()
|
||||
}
|
||||
|
||||
// Force to set the screen size
|
||||
|
Loading…
Reference in New Issue
Block a user