Ejemplo n.º 1
0
glbinding::Version ContextFormat::validateVersion(
    const glbinding::Version & requestedVersion
,   const glbinding::Version & supportedMaximumVersion)
{
#ifdef __APPLE__
    return glbinding::Version(3, 2);
#endif

    glbinding::Version maxv(supportedMaximumVersion);

    if (maxv.isNull())
        maxv = glbinding::Version(3, 0);

    if (requestedVersion.isNull() || requestedVersion > maxv)
        return maxv;

    if (!requestedVersion.isValid())
    {
        glbinding::Version nearest = requestedVersion.nearest();
        return nearest > maxv ? maxv : nearest;
    }
    return requestedVersion;
}
Ejemplo n.º 2
0
glbinding::Version ContextFormat::validateVersion(const glbinding::Version &requestedVersion
,   const glbinding::Version &_maximumVersion)
{
    glbinding::Version maximumVersion = _maximumVersion;
    if (maximumVersion.isNull())
    {
#ifdef MAC_OS
        maximumVersion = glbinding::Version(3, 2);
#else
        maximumVersion = glbinding::Version(3, 0);
#endif
    }

    if (requestedVersion.isNull() || requestedVersion > maximumVersion)
        return maximumVersion;

    if (!requestedVersion.isValid())
    {
        glbinding::Version nearest = requestedVersion.nearest();
        return nearest > maximumVersion ? maximumVersion : nearest;
    }
    return requestedVersion;
}