bool contextSupports (ContextType ctxType, ApiType requiredApiType) { // \todo [2014-10-06 pyry] Check exact forward-compatible restrictions. const bool forwardCompatible = (ctxType.getFlags() & CONTEXT_FORWARD_COMPATIBLE) != 0; if (isContextTypeES(ctxType)) { DE_ASSERT(!forwardCompatible); return requiredApiType.getProfile() == PROFILE_ES && versionGreaterOrEqual(ctxType.getAPI(), requiredApiType); } else if (isContextTypeGLCore(ctxType)) { if (forwardCompatible) return ctxType.getAPI() == requiredApiType; else return requiredApiType.getProfile() == PROFILE_CORE && versionGreaterOrEqual(ctxType.getAPI(), requiredApiType); } else if (isContextTypeGLCompatibility(ctxType)) { DE_ASSERT(!forwardCompatible); return (requiredApiType.getProfile() == PROFILE_CORE || requiredApiType.getProfile() == PROFILE_COMPATIBILITY) && versionGreaterOrEqual(ctxType.getAPI(), requiredApiType); } else { DE_ASSERT(false); return false; } }