summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLContext.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-23 14:01:08 +0200
committerSven Gothel <[email protected]>2012-08-23 14:01:08 +0200
commit6d241fc2a46413ee478985d676d2481c5a7ed119 (patch)
treeb8a44743e1115a835027cfcbba8d354408d8024f /src/jogl/classes/javax/media/opengl/GLContext.java
parent4abaf513bcc91a2d4b3ec4842c532807cbe66167 (diff)
GLContext: Remove integer-key based attach/detach object - use String based (minor API change)
The integer based attachement is currently not used and since it has no benefit over the String based hash map - remove it.
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index a2ce619e7..c2f94b9af 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -52,7 +52,6 @@ import jogamp.opengl.Debug;
import jogamp.opengl.GLContextImpl;
import com.jogamp.common.os.Platform;
-import com.jogamp.common.util.IntObjectHashMap;
import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
import com.jogamp.opengl.GLExtensions;
@@ -140,8 +139,7 @@ public abstract class GLContext {
private static final ThreadLocal<GLContext> currentContext = new ThreadLocal<GLContext>();
- private final HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();
- private final IntObjectHashMap attachedObjectsByInt = new IntObjectHashMap();
+ private final HashMap<String, Object> attachedObjects = new HashMap<String, Object>();
// RecursiveLock maintains a queue of waiting Threads, ensuring the longest waiting thread will be notified at unlock.
protected final RecursiveLock lock = LockFactory.createRecursiveLock();
@@ -168,8 +166,7 @@ public abstract class GLContext {
ctxMinorVersion=-1;
ctxOptions=0;
ctxVersionString=null;
- attachedObjectsByString.clear();
- attachedObjectsByInt.clear();
+ attachedObjects.clear();
contextHandle=0;
currentSwapInterval = -1;
}
@@ -425,27 +422,8 @@ public abstract class GLContext {
/**
* Returns the attached user object for the given name to this GLContext.
*/
- public final Object getAttachedObject(int name) {
- return attachedObjectsByInt.get(name);
- }
-
- /**
- * Returns the attached user object for the given name to this GLContext.
- */
public final Object getAttachedObject(String name) {
- return attachedObjectsByString.get(name);
- }
-
- /**
- * Sets the attached user object for the given name to this GLContext.
- * Returns the previously set object or null.
- */
- public final Object attachObject(int name, Object obj) {
- return attachedObjectsByInt.put(name, obj);
- }
-
- public final Object detachObject(int name) {
- return attachedObjectsByInt.remove(name);
+ return attachedObjects.get(name);
}
/**
@@ -453,11 +431,11 @@ public abstract class GLContext {
* Returns the previously set object or null.
*/
public final Object attachObject(String name, Object obj) {
- return attachedObjectsByString.put(name, obj);
+ return attachedObjects.put(name, obj);
}
public final Object detachObject(String name) {
- return attachedObjectsByString.remove(name);
+ return attachedObjects.remove(name);
}
/**