Example #1
0
static void* lookupOpenGLFunctionAddress(const char* functionName, bool* success = 0)
{
    if (success && !*success)
        return 0;

    void* target = getProcAddress(functionName);
    if (target)
        return target;

    String fullFunctionName(functionName);
    fullFunctionName.append("ARB");
    target = getProcAddress(fullFunctionName.utf8().data());
    if (target)
        return target;

    fullFunctionName = functionName;
    fullFunctionName.append("EXT");
    target = getProcAddress(fullFunctionName.utf8().data());

#if defined(GL_ES_VERSION_2_0)
    fullFunctionName = functionName;
    fullFunctionName.append("ANGLE");
    target = getProcAddress(fullFunctionName.utf8().data());

    fullFunctionName = functionName;
    fullFunctionName.append("APPLE");
    target = getProcAddress(fullFunctionName.utf8().data());
#endif

    // A null address is still a failure case.
    if (!target && success)
        *success = false;

    return target;
}
Example #2
0
static void* lookupOpenGLFunctionAddress(const char* functionName, bool& success)
{
    if (!success)
        return 0;

    void* target = getProcAddress(functionName);
    if (target)
        return target;

    String fullFunctionName(functionName);
    fullFunctionName.append("ARB");
    target = getProcAddress(fullFunctionName.utf8().data());
    if (target)
        return target;

    fullFunctionName = functionName;
    fullFunctionName.append("EXT");
    target = getProcAddress(fullFunctionName.utf8().data());

    // A null address is still a failure case.
    if (!target)
        success = false;

    return target;
}