Question

I am looking for a way to get a list of supported OpenGL ES versions OR max OpenGL ES version available on a iOS device at runtime ?

Ideally the solution MUST not:

  • not check for the particular device model

PS: Project settings: Base SDK = Latest iOS (7.0) Deployment Target: 4.3

Was it helpful?

Solution

The preferred way to do this is to try to create contexts for the various OpenGL ES versions and fall back to older ones if they fail. For example, you could check for OpenGL ES 3 support using:

    EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];

if aContext is nil, that device doesn't support OpenGL ES 3.0. You can then fall back to

    aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];

to test for 2.0 support. If that fails (aContext is nil again), then the device only supports OpenGL ES 1.1. This doesn't require you to check device types (and it accounts for future, unreleased devices).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top