From f85c84659659525ff75200f5dff96b863baf85f2 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 19 Feb 2018 02:22:05 +0900 Subject: [PATCH] opengl: Remove invalidFramebuffer and use nil instead --- internal/opengl/context_js.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/opengl/context_js.go b/internal/opengl/context_js.go index a0349f51e..24476a0df 100644 --- a/internal/opengl/context_js.go +++ b/internal/opengl/context_js.go @@ -51,8 +51,7 @@ type attribLocation int type programID int var ( - invalidTexture = Texture{} - invalidFramebuffer = Framebuffer(nil) + invalidTexture = Texture{} ) func getProgramID(p Program) programID { @@ -120,7 +119,7 @@ func Init() error { func (c *Context) Reset() error { c.locationCache = newLocationCache() c.lastTexture = invalidTexture - c.lastFramebuffer = invalidFramebuffer + c.lastFramebuffer = nil c.lastViewportWidth = 0 c.lastViewportHeight = 0 c.lastCompositeMode = CompositeModeUnknown @@ -255,7 +254,7 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) { // will be a default framebuffer. // https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteFramebuffers.xml if c.lastFramebuffer == f { - c.lastFramebuffer = invalidFramebuffer + c.lastFramebuffer = nil c.lastViewportWidth = 0 c.lastViewportHeight = 0 }