1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Fixed an iOS GL compile error.

This commit is contained in:
jules 2015-04-20 17:29:11 +01:00
parent c825bc378f
commit 28123033cd

View file

@ -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;