문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top