summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-23 13:44:37 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-23 13:50:37 +0300
commitdee913f0153584ab913a7d8304abe643991e50bc (patch)
tree9a6ddbfe4aa455cb999dbe18cc30f50c5bc599c2 /src/resources/openglimagehelper.cpp
parentdd55eb469163b4863130a6adba96eb334a10e017 (diff)
downloadmv-dee913f0153584ab913a7d8304abe643991e50bc.tar.gz
mv-dee913f0153584ab913a7d8304abe643991e50bc.tar.bz2
mv-dee913f0153584ab913a7d8304abe643991e50bc.tar.xz
mv-dee913f0153584ab913a7d8304abe643991e50bc.zip
Move OpenGL error conversion to string to graphicsmanager.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index b250ad29d..3b93460ad 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -266,31 +266,9 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage)
GLenum error = glGetError();
if (error)
{
- std::string errmsg = "Unknown error";
- switch (error)
- {
- case GL_INVALID_ENUM:
- errmsg = "GL_INVALID_ENUM";
- break;
- case GL_INVALID_VALUE:
- errmsg = "GL_INVALID_VALUE";
- break;
- case GL_INVALID_OPERATION:
- errmsg = "GL_INVALID_OPERATION";
- break;
- case GL_STACK_OVERFLOW:
- errmsg = "GL_STACK_OVERFLOW";
- break;
- case GL_STACK_UNDERFLOW:
- errmsg = "GL_STACK_UNDERFLOW";
- break;
- case GL_OUT_OF_MEMORY:
- errmsg = "GL_OUT_OF_MEMORY";
- break;
- default:
- break;
- }
- logger->log("Error: Image GL import failed: %s", errmsg.c_str());
+ std::string errmsg = GraphicsManager::errorToString(error);
+ logger->log("Error: Image GL import failed: %s (%d)",
+ errmsg.c_str(), error);
return nullptr;
}