aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-26 05:38:24 +0200
committerSven Gothel <[email protected]>2013-04-26 05:38:24 +0200
commit36dc4f5ab6957a4078842c488afb51df2fdc0630 (patch)
tree5e5629f085f7d244faf1c1e5e15cfe935e87e1b4 /src/jogl/classes/javax/media/opengl
parent75b3d37a3b15c071b49609921244bcb62d329fa9 (diff)
Simplify GLDrawableFactory's SharedResource Query Methods; Move WindowsWGLDrawableFactory Quirks to GLRendererQuirks (NeedCurrCtx4ARBPixFmtQueries, NeedCurrCtx4ARBCreateContext); Bug 706: Confine NeedCurrCtx4ARBCreateContext to [Windows, ATI, driver < 12.102.3); Avoid possible NPE @ GLContext.getGLVendorVersionNumber()
- Simplify GLDrawableFactory's SharedResource Query Methods - Moving common methods to GLDrawableFactory/GLDrawableFactoryImpl while reusing common methods to SharedResourceRunner.Resource. - All factories SharedResources impl. SharedResourceRunner.Resource. - Move WindowsWGLDrawableFactory Quirks to GLRendererQuirks (NeedCurrCtx4ARBPixFmtQueries, NeedCurrCtx4ARBCreateContext) - For better maintenance, move the mentioned quirks from the windows factory to our common place, being detected within GLContextImpl after each context creation. - Bug 706: Confine NeedCurrCtx4ARBCreateContext to [Windows, ATI, driver < 12.102.3) - Before we added this quirk if [Windows, ATI], however, we have hopes that the new drivers will suffice for all as tested successful on my test machine (AMD Radeon HD 6300M Series, amd_catalyst_13.5_mobility_beta2). - Avoid possible NPE @ GLContext.getGLVendorVersionNumber() - GLContext.getGLVendorVersionNumber() never returns 'null' but a zero version instance instead! - Add API doc. - Use mixed case names in GLContextImpl.setRendererQuirks(..).
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java15
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java9
2 files changed, 18 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index d26076344..f303c5b1c 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -176,7 +176,6 @@ public abstract class GLContext {
protected VersionNumber ctxGLSLVersion;
private int currentSwapInterval;
protected GLRendererQuirks glRendererQuirks;
- private static final VersionNumberString nullVersion = new VersionNumberString(-1, -1, -1, "n/a");
/** Did the drawable association changed ? see {@link GLRendererQuirks#NoSetSwapIntervalPostRetarget} */
protected boolean drawableRetargeted;
@@ -186,8 +185,8 @@ public abstract class GLContext {
System.err.println(getThreadName() + ": GLContext.resetStates()");
// Thread.dumpStack();
}
- ctxVersion = nullVersion;
- ctxVendorVersion = nullVersion;
+ ctxVersion = VersionNumberString.zeroVersion;
+ ctxVendorVersion = VersionNumberString.zeroVersion;
ctxOptions=0;
ctxVersionString=null;
ctxGLSLVersion=null;
@@ -668,6 +667,16 @@ public abstract class GLContext {
* @see #getGLSLVersionNumber()
**/
public final VersionNumber getGLVersionNumber() { return ctxVersion; }
+ /**
+ * Returns the vendor's version, i.e. version number at the end of <code>GL_VERSION</code> not being the GL version.
+ * <p>
+ * In case no such version exists within <code>GL_VERSION</code>,
+ * the {@link VersionNumberString#zeroVersion zero version} instance is being returned.
+ * </p>
+ * <p>
+ * The vendor's version is usually the vendor's OpenGL driver version.
+ * </p>
+ */
public final VersionNumberString getGLVendorVersionNumber() { return ctxVendorVersion; }
public final boolean isGLCompatibilityProfile() { return ( 0 != ( CTX_PROFILE_COMPAT & ctxOptions ) ); }
public final boolean isGLCoreProfile() { return ( 0 != ( CTX_PROFILE_CORE & ctxOptions ) ); }
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 9feb54a46..dbf6df0de 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -285,7 +285,7 @@ public abstract class GLDrawableFactory {
if(null==device) {
device = getDefaultDevice();
if(null==device) {
- throw new InternalError("no default device");
+ throw new InternalError("no default device available");
}
if (GLProfile.DEBUG) {
System.err.println("Info: "+getClass().getSimpleName()+".validateDevice: using default device : "+device);
@@ -322,7 +322,10 @@ public abstract class GLDrawableFactory {
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
* @return true if a shared resource could been created, otherwise false.
*/
- protected abstract boolean createSharedResource(AbstractGraphicsDevice device);
+ protected final boolean createSharedResource(AbstractGraphicsDevice device) {
+ return createSharedResourceImpl(device);
+ }
+ protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device);
/**
* Returns true if the <code>quirk</code> exist in the shared resource's context {@link GLRendererQuirks}.
@@ -419,7 +422,7 @@ public abstract class GLDrawableFactory {
public final List<GLCapabilitiesImmutable> getAvailableCapabilities(AbstractGraphicsDevice device) {
device = validateDevice(device);
if(null!=device) {
- return getAvailableCapabilitiesImpl(device);
+ return getAvailableCapabilitiesImpl(device);
}
return null;
}