Skip to content

Instantly share code, notes, and snippets.

@rubber-duck
Created May 15, 2013 12:21
Show Gist options
  • Save rubber-duck/5583615 to your computer and use it in GitHub Desktop.
Save rubber-duck/5583615 to your computer and use it in GitHub Desktop.
ReturnType!fn checkedgl(alias fn) (ParameterTypeTuple!fn params, string file = __FILE__, size_t line = __LINE__)
{
scope(success)
{
auto errorCode = gl.getError();
if(errorCode != 0)
throw new GlException(errorCode, file, line);
}
return fn(params);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment