diff options
Diffstat (limited to 'src/classes/com/sun/opengl/impl/egl/EGLContext.java')
-rwxr-xr-x | src/classes/com/sun/opengl/impl/egl/EGLContext.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/classes/com/sun/opengl/impl/egl/EGLContext.java index f55b611ca..25ac2c726 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLContext.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLContext.java @@ -123,11 +123,16 @@ public class EGLContext extends GLContextImpl { } EGLDrawableFactory factory = (EGLDrawableFactory) GLDrawableFactory.getFactory(); - int clientVersion = (EGLDrawableFactory.PROFILE_GLES2.equals(factory.getProfile()) ? 2 : 1); - int[] contextAttrs = new int[] { - EGL.EGL_CONTEXT_CLIENT_VERSION, clientVersion, - EGL.EGL_NONE - }; + boolean isGLES2 = EGLDrawableFactory.PROFILE_GLES2.equals(factory.getProfile()); + int[] contextAttrs = null; + // FIXME: need to determine whether to specify the context + // attributes based on the EGL version + if (isGLES2) { + contextAttrs = new int[] { + EGL.EGL_CONTEXT_CLIENT_VERSION, 2, + EGL.EGL_NONE + }; + } context = EGL.eglCreateContext(display, config, shareWith, contextAttrs, 0); if (context == 0) { throw new GLException("Error creating OpenGL context"); |