From bbeb1033838df36799da15a5fde37201a43a7ebb Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Mon, 18 Jan 2016 21:27:55 +1100 Subject: [PATCH] Check was missing from context_js Run calls Check whether or not gopherjs is used, and it was not implemented here. --- internal/graphics/opengl/context_js.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index ae4dfe074..fb0ddf1f4 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -112,6 +112,13 @@ func (c *Context) init() { gl.BlendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) } +func (c *Context) Check() { + gl := c.gl + if e := gl.GetError(); e != gl.NO_ERROR { + panic(fmt.Sprintf("check failed: %d", e)) + } +} + func (c *Context) NewTexture(width, height int, pixels []uint8, filter Filter) (Texture, error) { gl := c.gl t := gl.CreateTexture()