add debug markers for easier gl debugging

This commit is contained in:
Konstantin Käfer
2014-04-15 14:30:05 -04:00
parent f859945e06
commit 3c656d2bf2
6 changed files with 61 additions and 11 deletions

View File

@@ -6,13 +6,18 @@
namespace llmr {
namespace util {
template<typename... Args>
template<size_t max, typename... Args>
inline std::string sprintf(const char *msg, Args... args) {
char res[1024];
char res[max];
int len = snprintf(res, sizeof(res), msg, args...);
return std::string(res, len);
}
template<size_t max, typename... Args>
inline std::string sprintf(const std::string &msg, Args... args) {
return sprintf<max>(msg.c_str(), args...);
}
}
}