mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphics: Rename Initialize/Resume -> Reset
This commit is contained in:
parent
d0a779e272
commit
163ee01bd5
@ -83,7 +83,7 @@ func (c *graphicsContext) needsRestoring(context *opengl.Context) (bool, error)
|
|||||||
|
|
||||||
func (c *graphicsContext) initializeIfNeeded(context *opengl.Context) error {
|
func (c *graphicsContext) initializeIfNeeded(context *opengl.Context) error {
|
||||||
if !c.initialized {
|
if !c.initialized {
|
||||||
if err := graphics.Initialize(context); err != nil {
|
if err := graphics.Reset(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.initialized = true
|
c.initialized = true
|
||||||
@ -159,7 +159,7 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *graphicsContext) restore(context *opengl.Context) error {
|
func (c *graphicsContext) restore(context *opengl.Context) error {
|
||||||
if err := graphics.Initialize(context); err != nil {
|
if err := graphics.Reset(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := theImages.restorePixels(context); err != nil {
|
if err := theImages.restorePixels(context); err != nil {
|
||||||
|
@ -119,7 +119,7 @@ func (c *Context) Init() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) Resume() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
|
@ -127,7 +127,7 @@ func (c *Context) init() {
|
|||||||
c.screenFramebuffer = Framebuffer{f}
|
c.screenFramebuffer = Framebuffer{f}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) Resume() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
|
@ -88,7 +88,7 @@ func NewContext() (*Context, error) {
|
|||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) Resume() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
|
@ -52,13 +52,12 @@ const (
|
|||||||
float32Size = 4
|
float32Size = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
func Initialize(context *opengl.Context) error {
|
func Reset(context *opengl.Context) error {
|
||||||
return theOpenGLState.initialize(context)
|
return theOpenGLState.reset(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *openGLState) initialize(context *opengl.Context) error {
|
func (s *openGLState) reset(context *opengl.Context) error {
|
||||||
// TODO: Rename
|
context.Reset()
|
||||||
context.Resume()
|
|
||||||
s.lastProgram = zeroProgram
|
s.lastProgram = zeroProgram
|
||||||
s.lastProjectionMatrix = nil
|
s.lastProjectionMatrix = nil
|
||||||
s.lastModelviewMatrix = nil
|
s.lastModelviewMatrix = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user