Example #1
0
func (c *glContext) checkError(str string) {
	if c.flags&Debug == 0 {
		return
	}
	err := gl.GetError()
	if err != gl.NO_ERROR {
		dumpLog("Error %08x after %s\n", err, str)
	}
}
Example #2
0
func checkError(p *glContext, str string) {
	if p.flags&Debug == 0 {
		return
	}
	err := gl.GetError()
	if err != gl.NO_ERROR {
		dumpLog("Error %08x after %s\n", int(err), str)
	}
}
Example #3
0
func checkError() {
	if v := gl.GetError(); v != 0 {
		switch v {
		case gl.INVALID_ENUM:
			panic("GL returned error GL_INVALID_ENUM")
		case gl.INVALID_FRAMEBUFFER_OPERATION:
			panic("GL returned error GL_INVALID_FRAMEBUFFER_OPERATION")
		case gl.INVALID_OPERATION:
			panic("GL returned error GL_INVALID_OPERATION")
		case gl.INVALID_VALUE:
			panic("GL returned error GL_INVALID_VALUE")
		default:
			panic(fmt.Errorf("GL returned error 0x%.4x", v))
		}
	}
}