iOS 8 - getting the Demo building


#1

 

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'"

 

-nick

 

 


 


#2

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.


#3

Great, thanks for looking at that.

Still some semantic errors:

lines 147-148:

Use of undeclared identifier 'GL_DRAW_FRAMEBUFFER_APPLE'

149:

Use of undeclared identifier 'glResolveMultisampleFramebufferAPPLE'

243:

Use of undeclared identifier 'GL_RGBA8_OES'


#4

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


#5

Thanks - give it another shot now..


#6

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


#7

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


#8

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!


#9

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...


#10

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


#11

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


#12

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:

https://developer.apple.com/library/prerelease/ios/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/AdoptingOpenGLES3/AdoptingOpenGLES3.html


#13

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...


#14

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. 


#15

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?


#16

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. 


#17

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


#18

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


#19

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. 


#20

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.