checkgl should be only in debug

This commit is contained in:
gazer 2015-12-12 22:05:59 +03:00
parent ba5a27ce9e
commit 2280b56171
1 changed files with 7 additions and 3 deletions

View File

@ -79,10 +79,14 @@ static this() {
* TODO use one of the DEBUG extensions
*/
/// Using: checkgl!glFunction(funcParams);
auto checkgl(alias func, string functionName=__FUNCTION__, int line=__LINE__, Args...)(Args args)
template checkgl(alias func)
{
scope(success) checkError(func.stringof, functionName, line);
return func(args);
debug auto checkgl(alias func, string functionName=__FUNCTION__, int line=__LINE__, Args...)(Args args)
{
scope(success) checkError(func.stringof, functionName, line);
return func(args);
} else
alias checkgl = func;
}
bool checkError(string context="", string functionName=__FUNCTION__, int line=__LINE__)
{