From 870ce8561558147a798ff97bca615b3ceebbc3bb Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 12 Jun 2016 18:18:43 +0900 Subject: [PATCH] opengl: Remove Pause --- graphicscontext.go | 3 --- internal/graphics/opengl/context_desktop.go | 5 +---- internal/graphics/opengl/context_js.go | 5 +---- internal/graphics/opengl/context_mobile.go | 5 +---- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/graphicscontext.go b/graphicscontext.go index d45027e12..95ff1ea1f 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -106,9 +106,6 @@ func (c *graphicsContext) flush() error { func (c *graphicsContext) Resume() error { ui.GLContext().Resume() - if !c.initialized { - return nil - } if err := graphics.Initialize(ui.GLContext()); err != nil { return err } diff --git a/internal/graphics/opengl/context_desktop.go b/internal/graphics/opengl/context_desktop.go index 3ed63cba5..fbe5f9928 100644 --- a/internal/graphics/opengl/context_desktop.go +++ b/internal/graphics/opengl/context_desktop.go @@ -104,15 +104,12 @@ func (c *Context) Init() error { return nil } -func (c *Context) Pause() { +func (c *Context) Resume() { c.locationCache = newLocationCache() c.lastFramebuffer = ZeroFramebuffer c.lastViewportWidth = 0 c.lastViewportHeight = 0 c.lastCompositeMode = CompositeModeUnknown -} - -func (c *Context) Resume() { gl.Enable(gl.BLEND) c.BlendFunc(CompositeModeSourceOver) } diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index 5043ff32e..88fdf92b4 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -118,15 +118,12 @@ func (c *Context) init() { c.BlendFunc(CompositeModeSourceOver) } -func (c *Context) Pause() { +func (c *Context) Resume() { c.locationCache = newLocationCache() c.lastFramebuffer = ZeroFramebuffer c.lastViewportWidth = 0 c.lastViewportHeight = 0 c.lastCompositeMode = CompositeModeUnknown -} - -func (c *Context) Resume() { gl := c.gl gl.Enable(gl.BLEND) c.BlendFunc(CompositeModeSourceOver) diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index 412b23fe9..c73a44122 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -80,15 +80,12 @@ func NewContext() (*Context, error) { return c, nil } -func (c *Context) Pause() { +func (c *Context) Resume() { c.locationCache = newLocationCache() c.lastFramebuffer = ZeroFramebuffer c.lastViewportWidth = 0 c.lastViewportHeight = 0 c.lastCompositeMode = CompositeModeUnknown -} - -func (c *Context) Resume() { c.gl.Enable(mgl.BLEND) c.BlendFunc(CompositeModeSourceOver) }