iOS 8 - getting the Demo building



I've taken the plunge and downloaded xCode 6 and iOS 8 and am trying to get things working.

So far the Juce demo will run in the simulator (yay), but only if bypassing the OpenGL renderer. There are 4 errors in juce_OpenGL_ios.h. I've been googling and searching Apple's docs but I don't see any reason for these failures. Is there maybe something that's not being correctly linked?


line 197:

context = contextToShare != nullptr

                ? [context initWithAPI: type  sharegroup: [(EAGLContext*) contextToShare sharegroup]]

                : [context initWithAPI: type];

"Cannot initialize a parameter of type 'EAGLRenderingAPI' with an lvalue of type 'NSUInteger' (aka 'unsigned long')"

in this case "type" would be "kEAGLRenderingAPIOpenGLES3" and if I replace it directly there's no warning -- no idea why this doesn't work!


line 247:

glRenderbufferStorageMultisampleAPPLE (GL_RENDERBUFFER, 4, GL_DEPTH_COMPONENT16, width, height);

"Use of undeclared identifier 'glRenderbufferStorageMultisampleAPPLE'; did you mean 'glRenderbufferStorageMultisample'?"

no, I didn't mean that :)


line 236:

glRenderbufferStorageMultisampleAPPLE (GL_RENDERBUFFER, 4, GL_RGBA8_OES, width, height); 

"Use of undeclared identifier 'GL_RGBA8_OES'"







I think those calls were using older versions of the APIs - I've updated it now in a way that works in Xcode 5 but will hopefully also work for you.


Great, thanks for looking at that.

Still some semantic errors:

lines 147-148:

Use of undeclared identifier 'GL_DRAW_FRAMEBUFFER_APPLE'


Use of undeclared identifier 'glResolveMultisampleFramebufferAPPLE'


Use of undeclared identifier 'GL_RGBA8_OES'


just saw a forum post somewhere saying that xCode6 no longer impicitly includes OpenGL headers, so maybe this is something to do with that?


Thanks - give it another shot now..


it's still not finding glResolveMultisampleFramebuffer() and glResolveMultisampleFramebufferAPPLE(). 


Well, any ideas what that function has become in the latest version?


not a clue. That call is still used in Apple's own OpenGL ES guide which was updated just a month ago angry. Still poking around but no luck so far!


back to the earlier point of xCode possibly not importing everything automatically, if I import OpenGLES/ES1/glext.h it builds (if you go back to using glResolveMultisampleFramebufferAPPLE() ).  

However now the app has gone black, so guess there's more work to be done somewhere...


Yeah, I don't think ES1 has shaders, so won't be able to do anything very interesting.


ha. can it be more obvious that I'm stumbling around in the dark at this point?


arg. ok, finally some explanation buried in the docs:

Using Multisampling

OpenGL ES 3.0 incorporates all features of the APPLE_framebuffer_multisample extension, except for theglResolveMultisampleFramebufferAPPLE function. Instead the glBlitFramebuffer function provides this and other other framebuffer copying options. To resolve a multisampling buffer, set the read and draw framebuffers (as in Using Multisampling to Improve Image Quality) and then use glBlitFramebuffer to copy the entire read framebuffer into the entire draw framebuffer:

glBlitFramebuffer(0,0,w,h, 0,0,w,h, GL_COLOR_BUFFER_BIT, GL_NEAREST);

full article is here:


I am assuming that Jules will find a way as usual...

In the meantime, any suggestion for a workaround ?

I am stuck and really have no clue on what to do... apart from re-installing Xcode 5...


try replacing line 151 (GLResolveMultisampleFrameBufferAPPLE();) with the following:

glBlitFramebuffer(0, 0, lastWidth, lastHeight, 0, 0, lastWidth, lastHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);

that's working for me, but I haven't done much testing yet. 


Ok, thanks, even if it's not perfect, that's at least a start! Presumably the __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 stuff is doing its job correctly?


yes, but actually, you might want to check line 59 of juce_opengl.h. It only checks against iOS7, so I believe ES3 won't get included for 8 unless you update this. 


Good point. Looks like all these functions are available on iOS7 too so I'll test for that.


Ndika's workaround seems to work for me. Thanks !


That seems to be working, thanks.

Things are looking ok in general in the demo, but rotating the screen causes problems.  Rotating the screen to landscape will show the interface still in portrait orientation, just turned sideways. 

They've changed how the coordinate system works and also deprecated a bunch of screen rotation stuff this time round, so I'd guess it's related to one of those. 


Just wanted to pop in and confirm - my old projects built fine but the graphics are rotated incorrectly.

Thank yall for figuring this out so quick.