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 { func (c *graphicsContext) initializeIfNeeded() error {
if !c.initialized { if !c.initialized {
if err := shareable.InitializeGLState(); err != nil { if err := shareable.InitializeGraphicsDriverState(); err != nil {
return err return err
} }
c.initialized = true c.initialized = true

View File

@ -512,9 +512,7 @@ func (c *newScreenFramebufferImageCommand) CanMerge(dst, src *Image, color *affi
return false return false
} }
// ResetGLState resets or initializes the current OpenGL state. // ResetGraphicsDriverState resets or initializes the current graphics driver state.
// func ResetGraphicsDriverState() error {
// TODO: Rename this return opengl.Reset()
func ResetGLState() error {
return opengl.ResetGLState()
} }

View File

@ -147,8 +147,8 @@ const (
maxQuads = maxTriangles / 2 maxQuads = maxTriangles / 2
) )
// ResetGLState resets or initializes the current OpenGL state. // Reset resets or initializes the current OpenGL state.
func ResetGLState() error { func Reset() error {
return theOpenGLState.reset() return theOpenGLState.reset()
} }

View File

@ -65,7 +65,7 @@ func ResolveStaleImages() {
// //
// Restoring means to make all *graphicscommand.Image objects have their textures and framebuffers. // Restoring means to make all *graphicscommand.Image objects have their textures and framebuffers.
func Restore() error { func Restore() error {
if err := graphicscommand.ResetGLState(); err != nil { if err := graphicscommand.ResetGraphicsDriverState(); err != nil {
return err return err
} }
return theImages.restore() return theImages.restore()
@ -206,9 +206,9 @@ func (i *images) restore() error {
return nil return nil
} }
// InitializeGLState initializes the GL state. // InitializeGraphicsDriverState initializes the graphics driver state.
func InitializeGLState() error { func InitializeGraphicsDriverState() error {
return graphicscommand.ResetGLState() return graphicscommand.ResetGraphicsDriverState()
} }
func Error() error { func Error() error {

View File

@ -449,10 +449,10 @@ func NewScreenFramebufferImage(width, height int) *Image {
return i return i
} }
func InitializeGLState() error { func InitializeGraphicsDriverState() error {
backendsM.Lock() backendsM.Lock()
defer backendsM.Unlock() defer backendsM.Unlock()
return restorable.InitializeGLState() return restorable.InitializeGraphicsDriverState()
} }
func ResolveStaleImages() { func ResolveStaleImages() {