2

My OpenGL calls are behaving a bit strange on iPhone 5S and iPad Air. I don't know why, but maybe it is due to the fact that they support OpenGL ES 3, whereas previous devices do not. So I guess it is using OpenGL ES 3 and that may be the problem.

I don't know much about it. Is there a way force my app to use OpenGL ES 2?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Saturn
  • 17,888
  • 49
  • 145
  • 271
  • 3.0 should be backwards compatible with 2.0, I do not believe that's the issue. – Syntactic Fructose Jun 04 '14 at 02:07
  • @SyntacticFructose: I see. I wonder if there is a way, though. Just to be safe. – Saturn Jun 04 '14 at 02:25
  • Ah here we go. No, as long as you are using cocos2d v1.0 you are stuck with OpenGl es v1.1. You can't even mix and match gl v1.1 and v2 code in the same app (context). If you make the changes in the answer to force cocos2d to use gl v2 I bet nothing will work anymore. – CodeSmile Jun 04 '14 at 07:25

1 Answers1

3

You specify the API version when you create the OpenGL context. For ES 2.0, the call to create the context looks like this:

EAGLContext* pCtx = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];

For ES 3.0, the context creation looks like this:

EAGLContext* pCtx = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES3];
Reto Koradi
  • 53,228
  • 8
  • 93
  • 133