From c1282964c5d834f8872ed6042a928a741802efae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 3 Jan 2014 00:11:55 +0100 Subject: [PATCH] Verify that version retrieval went right. Sometimes the context is created improperly and all gl* functions are causing errors. Added check for that case. --- src/Context.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Context.cpp b/src/Context.cpp index 7c7d31929..33d8c87b1 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -295,6 +295,9 @@ Context::Context() { #endif _version = static_cast(_majorVersion*100+_minorVersion*10); + CORRADE_ASSERT(Renderer::error() == Renderer::Error::NoError, + "Context: cannot retrieve OpenGL version", ); + #ifndef MAGNUM_TARGET_GLES CORRADE_ASSERT(isVersionSupported(Version::GL210), "Context: unsupported OpenGL version" << Int(_version), ); #elif defined(MAGNUM_TARGET_GLES2)