Skip to content

Instantly share code, notes, and snippets.

@JakobOvrum
Created July 27, 2012 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakobOvrum/3189281 to your computer and use it in GitHub Desktop.
Save JakobOvrum/3189281 to your computer and use it in GitHub Desktop.
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