summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-21 15:51:55 +0200
committerSven Gothel <[email protected]>2012-08-21 15:51:55 +0200
commit27e81bf4d851ce2b81763920b4d1981c6a44b42a (patch)
tree1ff4181035ad0103064da240c83c0db786db87b9 /src/jogl/classes/javax
parentdd4ca98f24583eba6ca5a0e48f81c7a53799bef3 (diff)
Fix EGLDrawableFactory ES1/ES2 detection for !pbuffer ; Misc robustness changes for GLDrawableFactory ..
- EGLDrawableFactory ES1/ES2 detection for !pbuffer - isEGLContextAvailable(..) -> mapAvailableEGLESConfig(..) - handle case where no pbuffer configuration is available (nokia n9 meego ..). in such case, assume availability if onscreen profile is avail. - EGLDrawableFactory.getOrCreateEGLSharedResource(..) - avoid double creation attempt (similar to SharedResourceRunner) - EGLGraphicsConfiguration.EGLConfig2Capabilities(..) respect EGL.EGL_CONFIG_CAVEAT's EGL.EGL_SLOW_CONFIG - if EGL.EGL_SLOW_CONFIG -> no hw accel. - Fix GLContext.getRequestMajorAndCompat(..): Proper handling of ES1 and ES2 - Add abstract GLDrawableFactory.isComplete(): Only if true use the factory for 'getFactory(..)' avoid using incomplete ones.
Diffstat (limited to 'src/jogl/classes/javax')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java6
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java11
2 files changed, 13 insertions, 4 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 63a02ad9c..a2ce619e7 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -1141,7 +1141,7 @@ public abstract class GLContext {
}
/**
- * Returns the GLProfile's major version number and it's context property (CTP) for availability mapping request.
+ * Returns the GLProfile's major version number at reqMajorCTP[0] and it's context property (CTP) at reqMajorCTP[1] for availability mapping request.
*/
protected static final void getRequestMajorAndCompat(final GLProfile glp, int[/*2*/] reqMajorCTP) {
final GLProfile glpImpl = glp.getImpl();
@@ -1149,7 +1149,9 @@ public abstract class GLContext {
reqMajorCTP[0]=4;
} else if (glpImpl.isGL3()) {
reqMajorCTP[0]=3;
- } else /* if (glpImpl.isGL2()) */ {
+ } else if (glpImpl.isGLES1()) {
+ reqMajorCTP[0]=1;
+ } else /* if (glpImpl.isGL2() || glpImpl.isGLES2()) */ {
reqMajorCTP[0]=2;
}
if( glpImpl.isGLES() ) {
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index fbdc51022..acda45bff 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -158,7 +158,9 @@ public abstract class GLDrawableFactory {
}
}
}
- nativeOSFactory = tmp;
+ if(null != tmp && tmp.isComplete()) {
+ nativeOSFactory = tmp;
+ }
tmp = null;
try {
@@ -169,7 +171,9 @@ public abstract class GLDrawableFactory {
jre.printStackTrace();
}
}
- eglFactory = tmp;
+ if(null != tmp && tmp.isComplete()) {
+ eglFactory = tmp;
+ }
}
protected static void shutdown(ShutdownType shutdownType) {
@@ -233,6 +237,9 @@ public abstract class GLDrawableFactory {
glDrawableFactories.add(this);
}
}
+
+ /** Returns true if this factory is complete, i.e. ready to be used. Otherwise return false. */
+ protected abstract boolean isComplete();
protected void enterThreadCriticalZone() {};
protected void leaveThreadCriticalZone() {};