Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors showing for OES OpenGL statements in Xcode 6 for iOS8

Xcode 6 iOS SDK 8.0 in Yosemite is giving me errors for OpenGL ES2 code which compiles fine under Xcode 5

GLuint depthStencilRenderbuffer;
glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthStencilRenderbuffer);
glRenderbufferStorageOES(GL_RENDERBUFFER_OES,
                         GL_DEPTH24_STENCIL8_OES,
                         self.view.bounds.size.width,
                         self.view.bounds.size.height);

Generates errors:

line 2:

Conflicting types for 'glBindRenderBufferOES'

Use of undeclared identifier 'GL_RENDERBUFFER_OES'

line 3:

implicit declaration of contain 'glBindRenderBufferOES' is invalid in C99

Edit: OK, I can get things working again by substituting:

GLuint depthStencilRenderbuffer;
glBindRenderbuffer(GL_RENDERBUFFER, depthStencilRenderbuffer);
glRenderbufferStorage(GL_RENDERBUFFER,
                      GL_STENCIL_INDEX8,
                      self.view.bounds.size.width,
                      self.view.bounds.size.height);

Still - I don't know why this change is needed and I'd appreciate some further insight as to what's going on here.

like image 808
Christian J. B. Avatar asked Jun 03 '14 20:06

Christian J. B.


2 Answers

Try:

#import <OpenGLES/ES2/glext.h>

or

#import <OpenGLES/ES3/glext.h>

works for me.

Without it, app which correctlyworking on xcode 6 + ios7 can find GL_FALSE and others..

like image 78
Niedved Avatar answered Nov 05 '22 20:11

Niedved


I think @reto-koradi's comment is correct. I had a problem in my code that was similarly broken in iOS8. They've changed how some of the headers include other headers so here are the steps I took:

  1. Got to Xcode5 and locate the same line that is broken in Xcode6/iOS8.
  2. Command-click that link and find out which header file it's in.
  3. Go back to Xcode6/iOS8 and find that file.

For me it was #import <OpenGLES/ES2/glext.h> because some of the glextensions I was using was missing.

like image 24
plluke Avatar answered Nov 05 '22 20:11

plluke