aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLContext.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-05-22 22:21:29 +0000
committerKenneth Russel <[email protected]>2009-05-22 22:21:29 +0000
commitbe3d7e5c1cf5d4d0342da36c3ab3eae91da51ec1 (patch)
tree611c2d01c4bcc6b3519ead48cb279f59b0b7ca0c /src/jogl/classes/javax/media/opengl/GLContext.java
parentcccddaeb39ad19a4e8c77fdff1d4950f48e32e8e (diff)
Refactored shader-related utility routines from core GL2ES2 class into
ShaderUtil class. Added GLContext.getAttachedObject(String) and putAttachedObject(String, Object) to allow arbitrarily named objects to be attached to GLContext. Removed explicitly defined toString() operations on GL implementations which were problematic and which would have required downward references into com.sun.opengl.util.glsl package after this refactoring. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1909 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 5a4631560..8c3ca9c5b 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -201,21 +201,36 @@ public abstract class GLContext {
public abstract void setGL(GL gl);
/**
- * Returns the attached user object for the given name to this GLContext/GL.
+ * Returns the attached user object for the given name to this GLContext.
*/
public Object getAttachedObject(int name) {
return attachedObjects.get(new Integer(name));
}
/**
- * Sets the attached user object for the given name to this GLContext/GL.
- * Returns the previous set object or null.
+ * Returns the attached user object for the given name to this GLContext.
+ */
+ public Object getAttachedObject(String name) {
+ return attachedObjects.get(name);
+ }
+
+ /**
+ * Sets the attached user object for the given name to this GLContext.
+ * Returns the previously set object or null.
*/
public Object putAttachedObject(int name, Object obj) {
return attachedObjects.put(new Integer(name), obj);
}
/**
+ * Sets the attached user object for the given name to this GLContext.
+ * Returns the previously set object or null.
+ */
+ public Object putAttachedObject(String name, Object obj) {
+ return attachedObjects.put(name, obj);
+ }
+
+ /**
* Classname, GL, GLDrawable
*/
public final String toString() {