From be3d7e5c1cf5d4d0342da36c3ab3eae91da51ec1 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 22 May 2009 22:21:29 +0000 Subject: 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 --- src/jogl/classes/javax/media/opengl/GLContext.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl') 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,20 +201,35 @@ 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 */ -- cgit v1.2.3