aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2012-02-15 00:44:19 +0100
committerJohannes Schickel2012-02-15 02:23:01 +0100
commite5d48797d9866c155e3a4af8a6dd614a8978d428 (patch)
tree54b9eb74ead90cc91d34a43f7d427cfe3bcfadad /backends/graphics
parentbeab93e746cb0600c922a68d3ba6409f530a7b38 (diff)
downloadscummvm-rg350-e5d48797d9866c155e3a4af8a6dd614a8978d428.tar.gz
scummvm-rg350-e5d48797d9866c155e3a4af8a6dd614a8978d428.tar.bz2
scummvm-rg350-e5d48797d9866c155e3a4af8a6dd614a8978d428.zip
OPENGL: Let getGlErrStr return a Common::String.
This also makes getGlErrStr use Common::String::format instead of snprintf.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/glerrorcheck.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/backends/graphics/opengl/glerrorcheck.cpp b/backends/graphics/opengl/glerrorcheck.cpp
index 682207c7ef..439593577d 100644
--- a/backends/graphics/opengl/glerrorcheck.cpp
+++ b/backends/graphics/opengl/glerrorcheck.cpp
@@ -26,6 +26,7 @@
#include "backends/graphics/opengl/glerrorcheck.h"
#include "common/textconsole.h"
+#include "common/str.h"
#ifdef WIN32
#if defined(ARRAYSIZE) && !defined(_WINDOWS_)
@@ -44,7 +45,7 @@
#include <GL/gl.h>
#endif
-static const char *getGlErrStr(GLenum error) {
+static Common::String getGlErrStr(GLenum error) {
switch (error) {
case GL_NO_ERROR: return "GL_NO_ERROR";
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
@@ -54,16 +55,13 @@ static const char *getGlErrStr(GLenum error) {
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
}
- // FIXME: Convert to use Common::String::format()
- static char buf[40];
- snprintf(buf, sizeof(buf), "(Unknown GL error code 0x%x)", error);
- return buf;
+ return Common::String::format("(Unknown GL error code 0x%x)", error);
}
void checkGlError(const char *file, int line) {
GLenum error = glGetError();
if (error != GL_NO_ERROR)
- warning("%s:%d: GL error: %s", file, line, getGlErrStr(error));
+ warning("%s:%d: GL error: %s", file, line, getGlErrStr(error).c_str());
}
#endif