From 153e5c784a0eb9fe50d10d414c404b2c6990ea6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jun 2013 16:45:14 +0200 Subject: [PATCH] Sanity check for OpenGL version in Context. I though this check was present since forever, but isn't. Maybe it's hidden somewhere else. --- src/Context.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Context.cpp b/src/Context.cpp index d4d88cce8..49d5948c7 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -292,6 +292,14 @@ Context::Context() { #endif _version = static_cast(_majorVersion*100+_minorVersion*10); + #ifndef MAGNUM_TARGET_GLES + CORRADE_ASSERT(isVersionSupported(Version::GL210), "Context: unsupported OpenGL version" << Int(_version), ); + #elif defined(MAGNUM_TARGET_GLES2) + CORRADE_ASSERT(isVersionSupported(Version::GLES200), "Context: unsupported OpenGL ES version" << Int(_version), ); + #else + CORRADE_ASSERT(isVersionSupported(Version::GLES300), "Context: unsupported OpenGL ES version" << Int(_version), ); + #endif + /* Context flags are supported since GL 3.0 */ #ifndef MAGNUM_TARGET_GLES /**