From d9c4b58680b7a1e1e5c69f3bffa548c6f4898723 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Apr 2012 14:32:39 +0300 Subject: Logging opengl vendor and renderer. --- src/openglgraphics.cpp | 15 +++++++++++++++ src/openglgraphics.h | 2 ++ 2 files changed, 17 insertions(+) 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( +// 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(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; -- cgit v1.2.3-60-g2f50