opengl: Rename ResetGLState -> Reset and other functions

This commit is contained in:
Hajime Hoshi 2018-11-01 03:02:08 +09:00
parent b8aa35373a
commit bc3ca38f76
5 changed files with 12 additions and 14 deletions

View File

@ -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

View File

@ -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()
}

View File

@ -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()
}

View File

@ -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 {

View File

@ -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() {