add remote logging system using curl, normalize log messages removing \n, fix fra shaders precision issue, enable core and forward comp. in WGL, disable multisampling,

This commit is contained in:
2017-03-31 15:39:51 +01:00
parent ade95724e8
commit b1a3cb0309
18 changed files with 352 additions and 129 deletions

View File

@@ -33,3 +33,32 @@ glm::vec3 convert_rgb2hsv(const glm::vec3 c)
float e = 1.0e-10f;
return glm::vec3(fabs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
static const char* gl2str(GLenum err)
{
switch (err)
{
case GL_NO_ERROR: return "GL_NO_ERROR";
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
case GL_INVALID_VALUE: return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
case GL_INVALID_FRAMEBUFFER_OPERATION: return "GL_INVALID_FRAMEBUFFER_OPERATION";
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
default: return "Unknown";
}
}
void check_OpenGLError(const char* stmt, const char* fname, int line)
{
GLenum err;
while ((err = glGetError()) != GL_NO_ERROR)
{
LOG("OpenGL error %08x (%s), at %s:%i - for %s", err, gl2str(err), fname, line, stmt);
}
}
#ifdef _DEBUG
#define GL(stmt) stmt; CheckOpenGLError(#stmt, __FILE__, __LINE__);
#else
#define GL(stmt) stmt
#endif