mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
opengl: Rename ResetGLState -> Reset and other functions
This commit is contained in:
parent
b8aa35373a
commit
bc3ca38f76
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user