Android fix of the day (OpenGL)


#1

juce_OpenGLContext.cpp

[code]void initialiseOnThread()
{
associatedObjectNames.clear();
associatedObjects.clear();

    // drop any previous data if we're called again (eg Android)
    cachedImageFrameBuffer.release();                          // <<--------------

    nativeContext->initialiseOnRenderThread();
    glViewport (0, 0, component.getWidth(), component.getHeight());

    context.extensions.initialise();

    if (context.renderer != nullptr)
        context.renderer->newOpenGLContextCreated();
}[/code]

Annoyingly, you have to recreate the cached image texture when this is called again - which Android does because it likes to trash the OGL context at a whim.


#2

Cheers :slight_smile: