From f1cba2308b3f389bfd72fdc2b5a678497b474222 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 23 Nov 2008 16:59:58 +0000 Subject: proper EGL version attr setting git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1801 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/egl/EGLContext.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/classes/com/sun/opengl/impl/egl/EGLContext.java') diff --git a/src/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/classes/com/sun/opengl/impl/egl/EGLContext.java index b211a8fe2..2be9537b2 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLContext.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLContext.java @@ -198,14 +198,16 @@ public class EGLContext extends GLContextImpl { } } - int[] contextAttrs = null; - // FIXME: need to determine whether to specify the context - // attributes based on the EGL version - if (GLProfile.isGLES2()) { - contextAttrs = new int[] { - EGL.EGL_CONTEXT_CLIENT_VERSION, 2, + int[] contextAttrs = new int[] { + EGL.EGL_CONTEXT_CLIENT_VERSION, -1, EGL.EGL_NONE - }; + }; + if (GLProfile.isGLES2()) { + contextAttrs[1] = 2; + } else if (GLProfile.isGLES1()) { + contextAttrs[1] = 1; + } else { + throw new GLException("Error creating OpenGL context - invalid GLProfile"); } context = EGL.eglCreateContext(display, config, shareWith, contextAttrs, 0); if (context == 0) { -- cgit v1.2.3