Native Plugin - OpenGL Calls no longer work in Unity5

HI all,

I’ve written a native plugin in using xcode. It spits out a static library. It’s pretty simple. It sets up a frame buffer object, attaches a texture to it then uses glReadPixels to get its color data. However, it fails on glGenFramebuffers, returning 0 for the generated frame buffer, which I believe is the default back buffer(?) I grab the pixels into memory and return the pointer over the interop back to C# for manipulation/usage.

This plugin works fine in Unity 4.6.2f. Below is the offending code. Any insight into this appreciated. The plugin has little else in it and is just this function exposed to usage. This is using OpenGL ES2.0

GLuint gltex = (GLuint)(size_t)(g_TexturePointer);
    
    GLint defaultFBO;
    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
    
    GLuint FramebufferName = 0;
    glGenFramebuffers(1, &FramebufferName);
    glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName);
        
    // Set "renderedTexture" as our colour attachement #0
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gltex, 0);
        
    if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
    {
        printf("%s", "Error: Could not setup frame buffer.");
        return nullptr;
    }
    
    unsigned char* data = new unsigned char[width*height * sizeof(unsigned char) * 4];
    glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
        
    glDeleteFramebuffers(1, &FramebufferName);
    glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
    
    return (void*)data;

Of course, two minutes after posting I find my problem. Turns out I neglected to force the renderer to OpenGL ES 2.0 in the project settings. Does the iOS build default to metal when automatic is selected? Cheers.