From deb69d11974684a3ac474eeeaa8044494e881d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 23 Jan 2014 23:19:21 +0100 Subject: [PATCH] Print more information when cannot retrieve OpenGL version. At least the OpenGL error should be enough to pinpoint what went wrong. --- src/Magnum/Context.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 8cd802928..cca441d77 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -305,8 +305,11 @@ Context::Context() { #endif _version = static_cast(_majorVersion*100+_minorVersion*10); - CORRADE_ASSERT(Renderer::error() == Renderer::Error::NoError, - "Context: cannot retrieve OpenGL version", ); + #ifndef CORRADE_NO_ASSERT + const auto error = Renderer::error(); + CORRADE_ASSERT(error == Renderer::Error::NoError, + "Context: cannot retrieve OpenGL version:" << error, ); + #endif #ifndef MAGNUM_TARGET_GLES CORRADE_ASSERT(isVersionSupported(Version::GL210), "Context: unsupported OpenGL version" << Int(_version), );