Rename symbol.

This commit is contained in:
EXetoC 2014-04-19 15:38:16 +02:00
commit 40aac2ab6a

View file

@ -272,7 +272,7 @@ type
proc glGetError*: TGLenum {.stdcall, importc, ogl.} proc glGetError*: TGLenum {.stdcall, importc, ogl.}
proc getGlError*: TGlError = glGetError().TGlError proc getGlError*: TGlError = glGetError().TGlError
## Like `glGetError` but returns an enumerator instead. ## Like ``glGetError`` but returns an enumerator instead.
type type
E_GL* = object of E_Base E_GL* = object of E_Base
@ -281,7 +281,7 @@ type
## an outdated list of errors or a bad driver. ## an outdated list of errors or a bad driver.
proc checkGlError* = proc checkGlError* =
## Raise `E_GL` if the last call to an OpenGL function generated an error. ## Raise ``E_GL`` if the last call to an OpenGL function generated an error.
## You might want to call this once every frame for example if automatic ## You might want to call this once every frame for example if automatic
## error checking has been disabled. ## error checking has been disabled.
let error = getGlError() let error = getGlError()
@ -300,17 +300,18 @@ proc checkGlError* =
raise exc raise exc
const const
NoGlAutoErrorCheck* = defined(noGlAutoErrorCheck) #\ NoAutoGlErrorCheck* = defined(noAutoGlErrorCheck) ##\
## This determines whether an exception should be raised if an OpenGL call ## This determines (at compile time) whether an exception should be raised
## generates an error. No additional code will be generated when ## if an OpenGL call generates an error. No additional code will be generated
## `noGlAutoErrorCheck` has been defined. ## and ``enableAutoGlErrorCheck(bool)`` will have no effect when
## ``noAutoGlErrorCheck`` is defined.
var glAutoErrorCheck = true var glAutoErrorCheck = true
proc enableGlAutoErrorCheck*(yes: bool) = proc enableAutoGlErrorCheck*(yes: bool) =
## This determines whether an exception should be raised if an OpenGL call ## This determines (at run time) whether an exception should be raised if an
## generates an error. This has no effect when ## OpenGL call generates an error. This has no effect when
## ``NoGlAutoErrorCheck == true``. ## ``noAutoGlErrorCheck`` is defined.
glAutoErrorCheck = yes glAutoErrorCheck = yes
macro wrapErrorChecking(f: stmt): stmt = macro wrapErrorChecking(f: stmt): stmt =
@ -341,7 +342,7 @@ macro wrapErrorChecking(f: stmt): stmt =
glCall glCall
template errCheck: stmt = template errCheck: stmt =
when not (NoGlAutoErrorCheck): when not (NoAutoGlErrorCheck):
if glAutoErrorCheck: if glAutoErrorCheck:
checkGlError() checkGlError()