[core] don't show OpenGL debug information on startup

This commit is contained in:
Konstantin Käfer
2016-11-09 11:15:10 +01:00
parent edf40bb6d9
commit 35a66eb2bd

View File

@@ -1,6 +1,5 @@
#include <mbgl/gl/extension.hpp>
#include <mbgl/gl/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mutex>
#include <string>
@@ -26,31 +25,10 @@ ExtensionFunctionBase::ExtensionFunctionBase(std::initializer_list<Probe> probes
static std::once_flag initializeExtensionsOnce;
const char* getGLString(GLenum name) {
return reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(name)));
}
void InitializeExtensions(glProc (*getProcAddress)(const char*)) {
std::call_once(initializeExtensionsOnce, [getProcAddress] {
#ifndef NDEBUG
if (const char* vendor = getGLString(GL_VENDOR)) {
mbgl::Log::Info(mbgl::Event::OpenGL, "Vendor: %s", vendor);
}
if (const char* renderer = getGLString(GL_RENDERER)) {
mbgl::Log::Info(mbgl::Event::OpenGL, "Renderer: %s", renderer);
}
if (const char* version = getGLString(GL_VERSION)) {
mbgl::Log::Info(mbgl::Event::OpenGL, "Version: %s", version);
}
if (const char* shaderVersion = getGLString(GL_SHADING_LANGUAGE_VERSION)) {
mbgl::Log::Info(mbgl::Event::OpenGL, "Shading Language Version: %s", shaderVersion);
}
#endif
if (const char* extensions = getGLString(GL_EXTENSIONS)) {
#ifndef NDEBUG
mbgl::Log::Info(mbgl::Event::OpenGL, "Extensions: %s", extensions);
#endif
if (const char* extensions =
reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(GL_EXTENSIONS)))) {
for (auto fn : detail::extensionFunctions()) {
for (auto probe : fn.second) {
if (strstr(extensions, probe.first) != nullptr) {