aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/egl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/egl')
-rwxr-xr-xsrc/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java10
-rwxr-xr-xsrc/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java12
-rwxr-xr-xsrc/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java12
-rwxr-xr-xsrc/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java2
4 files changed, 23 insertions, 13 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java
index 8c3e9a1c4..48f80977c 100755
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java
@@ -95,11 +95,11 @@ public abstract class EGLContext extends GLContextImpl {
boolean created = false;
if (eglContext == 0) {
create();
+ created = true;
if (DEBUG) {
System.err.println(getThreadName() + ": !!! Created GL context 0x" +
Long.toHexString(eglContext) + " for " + getClass().getName());
}
- created = true;
}
if (EGL.eglGetCurrentContext() != eglContext) {
if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
@@ -112,7 +112,7 @@ public abstract class EGLContext extends GLContextImpl {
}
if (created) {
- setGLFunctionAvailability(false, -1, -1, -1);
+ setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY);
return CONTEXT_CURRENT_NEW;
}
return CONTEXT_CURRENT;
@@ -153,6 +153,10 @@ public abstract class EGLContext extends GLContextImpl {
return 0; // FIXME
}
+ protected void destroyContextARBImpl(long _context) {
+ // FIXME
+ }
+
protected void create() throws GLException {
long eglDisplay = ((EGLDrawable)drawable).getDisplay();
EGLGraphicsConfiguration config = ((EGLDrawable)drawable).getGraphicsConfiguration();
@@ -218,7 +222,7 @@ public abstract class EGLContext extends GLContextImpl {
throw new GLException("Error making context 0x" +
Long.toHexString(eglContext) + " current: error code " + EGL.eglGetError());
}
- setGLFunctionAvailability(true, contextAttrs[1], 0, CTX_IS_ARB_CREATED|CTX_PROFILE_CORE|CTX_OPTION_ANY);
+ setGLFunctionAvailability(true, glProfile.usesNativeGLES2()?2:1, 0, CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY);
}
public boolean isCreated() {
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
index 5a193b2ff..4fccf22f8 100755
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
@@ -37,8 +37,10 @@ package com.jogamp.opengl.impl.egl;
import javax.media.nativewindow.*;
import javax.media.opengl.*;
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.*;
import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.*;
+import com.jogamp.nativewindow.impl.NullWindow;
public class EGLDrawableFactory extends GLDrawableFactoryImpl {
@@ -50,8 +52,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
// Check for other underlying stuff ..
if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) {
try {
- NWReflection.createInstance("com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory");
- } catch (Throwable t) {}
+ ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory");
+ } catch (JogampRuntimeException jre) { /* n/a .. */ }
}
}
@@ -59,6 +61,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
super();
}
+
+ protected final GLDrawableImpl getSharedDrawable() { return null; }
+ protected final GLContextImpl getSharedContext() { return null; }
+
public GLDrawableImpl createOnscreenDrawable(NativeWindow target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java
index 70f0540bf..9e34dc9e9 100755
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java
@@ -64,9 +64,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
EGLDynamicLookupHelper tmp=null;
try {
tmp = new EGLES1DynamicLookupHelper();
- } catch (Throwable t) {
+ } catch (GLException gle) {
if(DEBUG) {
- t.printStackTrace();
+ gle.printStackTrace();
}
}
eglES1DynamicLookupHelper = tmp;
@@ -74,9 +74,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
tmp=null;
try {
tmp = new EGLES2DynamicLookupHelper();
- } catch (Throwable t) {
+ } catch (GLException gle) {
if(DEBUG) {
- t.printStackTrace();
+ gle.printStackTrace();
}
}
eglES2DynamicLookupHelper = tmp;
@@ -191,9 +191,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
}
if (esProfile==2) {
- NativeLibLoader.loadES2();
+ GLJNILibLoader.loadES2();
} else if (esProfile==1) {
- NativeLibLoader.loadES1();
+ GLJNILibLoader.loadES1();
} else {
throw new GLException("Unsupported: ES"+esProfile);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java
index 0adede4ea..5a8454ea7 100755
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java
@@ -47,7 +47,7 @@ public class EGLExternalContext extends EGLContext {
public EGLExternalContext(AbstractGraphicsScreen screen) {
super(null, null);
GLContextShareSet.contextCreated(this);
- setGLFunctionAvailability(false, 0, 0, 0);
+ setGLFunctionAvailability(false, 0, 0, CTX_IS_ARB_CREATED|CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY);
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}