diff options
author | Sven Gothel <[email protected]> | 2011-07-31 20:35:55 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-31 20:35:55 +0200 |
commit | 502c51bc5a549a79d03249863261af59aedeaeb3 (patch) | |
tree | 2ab7f6bc4c860c6c5a43124079fe77d340b92161 /src/jogl/classes/jogamp/opengl/egl/EGLContext.java | |
parent | 8a456e30f400fff6bc9983fed5b10e561f4f3ddc (diff) |
EGL: Set CTX_PROFILE_ES2_COMPAT if ES2; Allow any native device; Don't use libGL.so; Cosmetics
EGL: Set CTX_PROFILE_ES2_COMPAT if ES2;
Allow any native device for EGL
- EGLDrawableFactory::getIsDeviceCompatible() -> true always,
impl. shall handle all native windowing toolkit layers, if available.
Don't use libGL.so
- desktop GL library is exclusive for desktop bindings
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLContext.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index dbdfcd5d9..cdddb1bd9 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -37,6 +37,7 @@ package jogamp.opengl.egl; import javax.media.opengl.*; import jogamp.opengl.*; + import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver; import java.nio.*; @@ -170,8 +171,8 @@ public abstract class EGLContext extends GLContextImpl { } contextHandle = EGL.eglCreateContext(eglDisplay, eglConfig, shareWith, contextAttrs, 0); if (contextHandle == 0) { - throw new GLException("Error creating OpenGL context: eglDisplay 0x"+Long.toHexString(eglDisplay)+ - ", "+glProfile+", error 0x"+Integer.toHexString(EGL.eglGetError())); + throw new GLException("Error creating OpenGL context: eglDisplay "+toHexString(eglDisplay)+ + ", eglConfig "+toHexString(eglConfig)+", "+glProfile+", error "+toHexString(EGL.eglGetError())); } GLContextShareSet.contextCreated(this); if (DEBUG) { @@ -189,7 +190,15 @@ public abstract class EGLContext extends GLContextImpl { throw new GLException("Error making context 0x" + Long.toHexString(contextHandle) + " current: error code " + EGL.eglGetError()); } - setGLFunctionAvailability(true, glProfile.usesNativeGLES2()?2:1, 0, CTX_PROFILE_ES|CTX_OPTION_ANY); + int ctp = CTX_PROFILE_ES|CTX_OPTION_ANY; + int major; + if(glProfile.usesNativeGLES2()) { + ctp |= CTX_PROFILE_ES2_COMPAT; + major = 2; + } else { + major = 1; + } + setGLFunctionAvailability(true, major, 0, ctp); return true; } |