-
-
Save rightfold/0c54663873b87216a649 to your computer and use it in GitHub Desktop.
This file contains 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
template<typename F, typename... Args> | |
auto gl(F f, Args&&... args) -> decltype(f(std::forward<Args>(args)...)) { | |
BOOST_SCOPE_EXIT() { | |
auto error = glGetError(); | |
if (error != GL_NO_ERROR) { | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |
auto errstr = reinterpret_cast<char const*>(gluErrorString(error)); | |
#pragma GCC diagnostic pop | |
throw std::runtime_error(errstr); | |
} | |
}; | |
return f(std::forward<Args>(args)...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment