diff --git a/graphicscontext.go b/graphicscontext.go index 18a12d1a3..514c31bec 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -75,7 +75,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo func (c *graphicsContext) initializeIfNeeded() error { if !c.initialized { - if err := shareable.InitializeGLState(); err != nil { + if err := shareable.InitializeGraphicsDriverState(); err != nil { return err } c.initialized = true diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 1aed45ad8..3d845aaac 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -512,9 +512,7 @@ func (c *newScreenFramebufferImageCommand) CanMerge(dst, src *Image, color *affi return false } -// ResetGLState resets or initializes the current OpenGL state. -// -// TODO: Rename this -func ResetGLState() error { - return opengl.ResetGLState() +// ResetGraphicsDriverState resets or initializes the current graphics driver state. +func ResetGraphicsDriverState() error { + return opengl.Reset() } diff --git a/internal/opengl/program.go b/internal/opengl/program.go index e5a19202e..c01f12614 100644 --- a/internal/opengl/program.go +++ b/internal/opengl/program.go @@ -147,8 +147,8 @@ const ( maxQuads = maxTriangles / 2 ) -// ResetGLState resets or initializes the current OpenGL state. -func ResetGLState() error { +// Reset resets or initializes the current OpenGL state. +func Reset() error { return theOpenGLState.reset() } diff --git a/internal/restorable/images.go b/internal/restorable/images.go index 90a10718e..84d46b1cd 100644 --- a/internal/restorable/images.go +++ b/internal/restorable/images.go @@ -65,7 +65,7 @@ func ResolveStaleImages() { // // Restoring means to make all *graphicscommand.Image objects have their textures and framebuffers. func Restore() error { - if err := graphicscommand.ResetGLState(); err != nil { + if err := graphicscommand.ResetGraphicsDriverState(); err != nil { return err } return theImages.restore() @@ -206,9 +206,9 @@ func (i *images) restore() error { return nil } -// InitializeGLState initializes the GL state. -func InitializeGLState() error { - return graphicscommand.ResetGLState() +// InitializeGraphicsDriverState initializes the graphics driver state. +func InitializeGraphicsDriverState() error { + return graphicscommand.ResetGraphicsDriverState() } func Error() error { diff --git a/internal/shareable/shareable.go b/internal/shareable/shareable.go index 2b3dc1673..6c72a2c35 100644 --- a/internal/shareable/shareable.go +++ b/internal/shareable/shareable.go @@ -449,10 +449,10 @@ func NewScreenFramebufferImage(width, height int) *Image { return i } -func InitializeGLState() error { +func InitializeGraphicsDriverState() error { backendsM.Lock() defer backendsM.Unlock() - return restorable.InitializeGLState() + return restorable.InitializeGraphicsDriverState() } func ResolveStaleImages() {