mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58: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 {
|
||||
if !c.initialized {
|
||||
if err := graphics.Initialize(context); err != nil {
|
||||
if err := graphics.Reset(context); err != nil {
|
||||
return err
|
||||
}
|
||||
c.initialized = true
|
||||
@ -159,7 +159,7 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
||||
}
|
||||
|
||||
func (c *graphicsContext) restore(context *opengl.Context) error {
|
||||
if err := graphics.Initialize(context); err != nil {
|
||||
if err := graphics.Reset(context); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := theImages.restorePixels(context); err != nil {
|
||||
|
@ -119,7 +119,7 @@ func (c *Context) Init() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Context) Resume() error {
|
||||
func (c *Context) Reset() error {
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastFramebuffer = invalidFramebuffer
|
||||
c.lastViewportWidth = 0
|
||||
|
@ -127,7 +127,7 @@ func (c *Context) init() {
|
||||
c.screenFramebuffer = Framebuffer{f}
|
||||
}
|
||||
|
||||
func (c *Context) Resume() error {
|
||||
func (c *Context) Reset() error {
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastFramebuffer = invalidFramebuffer
|
||||
c.lastViewportWidth = 0
|
||||
|
@ -88,7 +88,7 @@ func NewContext() (*Context, error) {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *Context) Resume() error {
|
||||
func (c *Context) Reset() error {
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastFramebuffer = invalidFramebuffer
|
||||
c.lastViewportWidth = 0
|
||||
|
@ -52,13 +52,12 @@ const (
|
||||
float32Size = 4
|
||||
)
|
||||
|
||||
func Initialize(context *opengl.Context) error {
|
||||
return theOpenGLState.initialize(context)
|
||||
func Reset(context *opengl.Context) error {
|
||||
return theOpenGLState.reset(context)
|
||||
}
|
||||
|
||||
func (s *openGLState) initialize(context *opengl.Context) error {
|
||||
// TODO: Rename
|
||||
context.Resume()
|
||||
func (s *openGLState) reset(context *opengl.Context) error {
|
||||
context.Reset()
|
||||
s.lastProgram = zeroProgram
|
||||
s.lastProjectionMatrix = nil
|
||||
s.lastModelviewMatrix = nil
|
||||
|
Loading…
Reference in New Issue
Block a user