aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-28 03:33:00 +0100
committerSven Gothel <[email protected]>2010-11-28 03:33:00 +0100
commit0c9eb947a2ffabba2c10799f6ea50756a2749702 (patch)
treed8f68006af6d5bbec7ae2eddb7b326019daedb30
parentaaa2b1df6ba9bd30f251ddada32ba0d56b12aa81 (diff)
minor cleanup
-rw-r--r--src/jogl/classes/com/jogamp/opengl/JoglVersion.java7
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java18
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java3
3 files changed, 16 insertions, 12 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index aa0586039..b096f84ae 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -71,6 +71,7 @@ public class JoglVersion extends JogampVersion {
if(null==sb) {
sb = new StringBuffer();
}
+ GLContext ctx = gl.getContext();
sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
sb.append("Default Desktop ").append(GLProfile.getDefaultDesktopDevice().getConnection()).append(": ").append(GLProfile.glAvailabilityToString(GLProfile.getDefaultDesktopDevice()));
@@ -91,7 +92,11 @@ public class JoglVersion extends JogampVersion {
sb.append(Platform.getNewline());
sb.append("GL_EXTENSIONS ");
sb.append(Platform.getNewline());
- sb.append(" ").append(gl.glGetString(gl.GL_EXTENSIONS));
+ sb.append(" ").append(ctx.getGLExtensionsString());
+ sb.append(Platform.getNewline());
+ sb.append("GLX_EXTENSIONS ");
+ sb.append(Platform.getNewline());
+ sb.append(" ").append(ctx.getPlatformExtensionsString());
sb.append(Platform.getNewline());
sb.append(VersionUtil.SEPERATOR);
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java
index 0cc79293e..a5fa98bb3 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java
@@ -48,7 +48,7 @@ import java.util.*;
* of which OpenGL extensions are currently available on both the host machine
* and display.
*/
-public final class ExtensionAvailabilityCache {
+final class ExtensionAvailabilityCache {
protected static final boolean DEBUG = GLContextImpl.DEBUG;
private static final boolean DEBUG_AVAILABILITY = Debug.isPropertyDefined("jogl.debug.ExtensionAvailabilityCache", true);
@@ -61,7 +61,7 @@ public final class ExtensionAvailabilityCache {
* Flush the cache. The cache will be rebuilt lazily as calls to {@link
* #isExtensionAvailable(String)} are received.
*/
- public void flush()
+ final void flush()
{
if(DEBUG) {
System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+context.getGLVersion());
@@ -73,26 +73,26 @@ public final class ExtensionAvailabilityCache {
/**
* Flush the cache and rebuild the cache.
*/
- public void reset() {
+ final void reset() {
flush();
initAvailableExtensions();
}
- public boolean isInitialized() {
+ final boolean isInitialized() {
return initialized && !availableExtensionCache.isEmpty() ;
}
- public boolean isExtensionAvailable(String glExtensionName) {
+ final boolean isExtensionAvailable(String glExtensionName) {
initAvailableExtensions();
return availableExtensionCache.contains(mapGLExtensionName(glExtensionName));
}
- public String getPlatformExtensionsString() {
+ final String getPlatformExtensionsString() {
initAvailableExtensions();
return glXExtensions;
}
- public String getGLExtensions() {
+ final String getGLExtensionsString() {
initAvailableExtensions();
if(DEBUG) {
System.err.println("ExtensionAvailabilityCache: getGLExtensions() called");
@@ -100,7 +100,7 @@ public final class ExtensionAvailabilityCache {
return glExtensions;
}
- private void initAvailableExtensions() {
+ private final void initAvailableExtensions() {
GL gl = context.getGL();
// if hash is empty (meaning it was flushed), pre-cache it with the list
// of extensions that are in the GL_EXTENSIONS string
@@ -211,7 +211,7 @@ public final class ExtensionAvailabilityCache {
private HashSet availableExtensionCache = new HashSet(50);
private GLContextImpl context;
- protected static String getThreadName() {
+ static String getThreadName() {
return Thread.currentThread().getName();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index a970be158..4151c1537 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -90,8 +90,7 @@ public class Dimension implements Cloneable, DimensionReadOnly {
public int hashCode() {
// 31 * x == (x << 5) - x
int hash = 31 + width;
- hash = ((hash << 5) - hash) + height;
- return hash;
+ return ((hash << 5) - hash) + height;
}
}