Created
July 27, 2012 17:35
-
-
Save JakobOvrum/3189281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReturnType!func checkGl(alias func, Args...)(Args args) { | |
debug scope(success) { | |
GLenum error_code = glGetError(); | |
if(error_code != GL_NO_ERROR) { | |
stderr.writefln(`OpenGL function "%s" failed: "%s."`, func.stringof, gl_error_string(error_code)); | |
} | |
} | |
return func(args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment