summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-26 14:32:39 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-26 14:40:11 +0300
commitd9c4b58680b7a1e1e5c69f3bffa548c6f4898723 (patch)
treefd4284a547552792cfe527cb1b03e74cbbeb68d3
parentb328b78653133f05107eadba31572874e4c35e95 (diff)
downloadManaVerse-d9c4b58680b7a1e1e5c69f3bffa548c6f4898723.tar.gz
ManaVerse-d9c4b58680b7a1e1e5c69f3bffa548c6f4898723.tar.bz2
ManaVerse-d9c4b58680b7a1e1e5c69f3bffa548c6f4898723.tar.xz
ManaVerse-d9c4b58680b7a1e1e5c69f3bffa548c6f4898723.zip
Logging opengl vendor and renderer.
-rw-r--r--src/openglgraphics.cpp15
-rw-r--r--src/openglgraphics.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 40f1087d0..aba5a7233 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -118,6 +118,13 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs,
}
#endif
+ logString("gl vendor: %s", GL_VENDOR);
+ logString("gl renderer: %s", GL_RENDERER);
+ logString("gl version: %s", GL_VERSION);
+
+// logger->log("gl extensions: %s", reinterpret_cast<const char*>(
+// glGetString(GL_EXTENSIONS)));
+
// Setup OpenGL
glViewport(0, 0, w, h);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
@@ -1445,4 +1452,12 @@ void OpenGLGraphics::dumpSettings()
}
}
+void OpenGLGraphics::logString(char *format, GLenum num)
+{
+ const char *str = reinterpret_cast<const char*>(glGetString(num));
+ if (!str)
+ logger->log(format, "?");
+ else
+ logger->log(format, str);
+}
#endif // USE_OPENGL
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index 650ad668a..d602f3126 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -151,6 +151,8 @@ class OpenGLGraphics : public Graphics
protected:
void setTexturingAndBlending(bool enable);
+ void logString(char *format, GLenum num);
+
private:
GLfloat *mFloatTexArray;
GLint *mIntTexArray;