Mild updates to Window and other pieces to match the rest
This commit is contained in:
@@ -5,30 +5,4 @@
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace NB {
|
||||
|
||||
static unsigned int __NB_GL_DEBUG_ERROR_CODE__;
|
||||
|
||||
static std::string formatDebugString(const std::string& msg, const std::string& file="", int line=-1) {
|
||||
std::string ret = "";
|
||||
if (file != "") {
|
||||
ret += "In file " + file;
|
||||
if (line >= 0) {
|
||||
ret += " at line " + std::to_string(line);
|
||||
}
|
||||
ret += ":\n\t";
|
||||
}
|
||||
return ret + msg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#define NB_GL_DEBUG_THROW(cmd, when) while(NB::__NB_GL_DEBUG_ERROR_CODE__=glGetError()){\
|
||||
std::cout << "[GL ERROR]: " << NB::__NB_GL_DEBUG_ERROR_CODE__;\
|
||||
std::cout << " " << when << " " << cmd << "\n";\
|
||||
}
|
||||
#define NB_GL_DEBUG(cmd) NB_GL_DEBUG_THROW(#cmd, "before"); cmd; NB_GL_DEBUG_THROW(#cmd, "after");
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user