diff --git a/modules/juce_opengl/native/juce_OpenGL_ios.h b/modules/juce_opengl/native/juce_OpenGL_ios.h index 22a3181015..0ed12f1b84 100644 --- a/modules/juce_opengl/native/juce_OpenGL_ios.h +++ b/modules/juce_opengl/native/juce_OpenGL_ios.h @@ -48,7 +48,8 @@ public: void* contextToShare, bool multisampling, OpenGLVersion version) - : context (nil), frameBufferHandle (0), colorBufferHandle (0), + : context (nil), openGLversion (version), + frameBufferHandle (0), colorBufferHandle (0), depthBufferHandle (0), msaaColorHandle (0), msaaBufferHandle (0), lastWidth (0), lastHeight (0), needToRebuildBuffers (false), swapFrames (0), useDepthBuffer (pixFormat.depthBufferBits > 0), @@ -76,7 +77,7 @@ public: [((UIView*) peer->getNativeHandle()) addSubview: view]; #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 - if (version == OpenGLContext::openGL3_2 && [[UIDevice currentDevice].systemVersion floatValue] >= 7.0) + if (version == openGL3_2 && [[UIDevice currentDevice].systemVersion floatValue] >= 7.0) { if (! createContext (kEAGLRenderingAPIOpenGLES3, contextToShare)) { @@ -148,11 +149,17 @@ public: glBindFramebuffer (GL_READ_FRAMEBUFFER, msaaBufferHandle); #if defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 - if (version >= OpenGLContext::openGL3_2) + if (openGLversion >= openGL3_2) + { glBlitFramebuffer (0, 0, lastWidth, lastHeight, 0, 0, lastWidth, lastHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + } else #endif + { + #ifdef GL_APPLE_framebuffer_multisample glResolveMultisampleFramebufferAPPLE(); + #endif + } } glBindRenderbuffer (GL_RENDERBUFFER, colorBufferHandle); @@ -194,6 +201,7 @@ private: JuceGLView* view; CAEAGLLayer* glLayer; EAGLContext* context; + const OpenGLVersion openGLversion; GLuint frameBufferHandle, colorBufferHandle, depthBufferHandle, msaaColorHandle, msaaBufferHandle;