aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/FunctionEmitter.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-02-05 18:09:23 +0000
committerKenneth Russel <[email protected]>2006-02-05 18:09:23 +0000
commit875652cab75b68ac30b9b1cc81ee62f7ff1e165d (patch)
tree7e6d85cee9453f6864d9067ac1c90213244ab4e0 /src/java/com/sun/gluegen/FunctionEmitter.java
parent98da87017cb72785ca13f5b0657ce2c5d8a067c3 (diff)
Intermediate checkin for FBO support in Java2D/JOGL bridge. Needed to
keep track of server-side OpenGL objects, like textures and display lists, created by the end user to preserve the illusion of independent contexts even though they will all share textures and display lists with the Java2D OpenGL context in order to access its FBO. Added GLObjectTracker class to track creation and destruction of these objects and to support cleanup when the last referring context has been destroyed. Modified GLContextShareSet to create and install GLObjectTrackers when necessary and GLContext to ref and unref tracker appropriately. Changed GlueGen's JavaPrologue and JavaEpilogue directives (and their documentation) to perform argument name substitution. Wrote documentation section on argument name substitution and specified behavior for primitive arrays (converts to string "array_name, array_name_offset" in substitution). Rephrased GlueGen's RangeCheck directives in terms of JavaPrologue directives and deleted old specialized code. Fixed bug in handling of VBO support in GLConfiguration when JavaPrologue was present for affected functions. Added JavaPrologue and JavaEpilogue directives to all existing OpenGL routines creating server-side objects (though it's possible some were missed) to call GLObjectTracker when necessary. Added RangeCheck directives for these routines as well. Worked around bug in JOGL demos where shutdownDemo() was being called more than once. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@13 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/FunctionEmitter.java')
-rw-r--r--src/java/com/sun/gluegen/FunctionEmitter.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/java/com/sun/gluegen/FunctionEmitter.java b/src/java/com/sun/gluegen/FunctionEmitter.java
index 3fa6f03..0d0f225 100644
--- a/src/java/com/sun/gluegen/FunctionEmitter.java
+++ b/src/java/com/sun/gluegen/FunctionEmitter.java
@@ -47,7 +47,7 @@ public abstract class FunctionEmitter
{
public static final EmissionModifier STATIC = new EmissionModifier("static");
- private HashSet modifiers = new HashSet(4);
+ private ArrayList modifiers = new ArrayList();
private CommentEmitter commentEmitter = null;
private PrintWriter defaultOutput;
@@ -64,7 +64,7 @@ public abstract class FunctionEmitter
* Makes this FunctionEmitter a copy of the passed one.
*/
public FunctionEmitter(FunctionEmitter arg) {
- modifiers = (HashSet) arg.modifiers.clone();
+ modifiers = (ArrayList) arg.modifiers.clone();
commentEmitter = arg.commentEmitter;
defaultOutput = arg.defaultOutput;
}
@@ -203,6 +203,19 @@ public abstract class FunctionEmitter
public final String toString() { return emittedForm; }
private String emittedForm;
+
+ public int hashCode() {
+ return emittedForm.hashCode();
+ }
+
+ public boolean equals(Object arg) {
+ if (arg == null || (!(arg instanceof EmissionModifier))) {
+ return false;
+ }
+
+ return emittedForm.equals(((EmissionModifier) arg).emittedForm);
+ }
+
protected EmissionModifier(String emittedForm) { this.emittedForm = emittedForm; }
}
}