OpenGLRenderer: Move error to string to Utils

This commit is contained in:
Jérôme Leclercq
2020-09-26 20:43:55 +02:00
parent abf58857d7
commit d243e7bcd2
3 changed files with 33 additions and 126 deletions

View File

@@ -378,42 +378,7 @@ namespace Nz::GL
{
hasAnyError = true;
switch (lastError)
{
// OpenGL/OpenGL ES error codes
case GL_INVALID_ENUM:
NazaraError("OpenGL error: an unacceptable value is specified for an enumerated argument");
break;
case GL_INVALID_VALUE:
NazaraError("OpenGL error: a numeric argument is out of range");
break;
case GL_INVALID_OPERATION:
NazaraError("OpenGL error: the specified operation is not allowed in the current state");
break;
case GL_INVALID_FRAMEBUFFER_OPERATION:
NazaraError("OpenGL error: the framebuffer object is not complete");
break;
case GL_OUT_OF_MEMORY:
NazaraError("OpenGL error: there is not enough memory left to execute the command");
break;
// OpenGL error codes
case GL_STACK_UNDERFLOW:
NazaraError("OpenGL error: an attempt has been made to perform an operation that would cause an internal stack to underflow.");
break;
case GL_STACK_OVERFLOW:
NazaraError("OpenGL error: an attempt has been made to perform an operation that would cause an internal stack to overflow.");
break;
default:
NazaraError("OpenGL error: an unknown error was reported (code: " + std::to_string(lastError) + ")");
break;
}
NazaraError("OpenGL error: " + TranslateOpenGLError(lastError));
}
return hasAnyError;