diff options
author | Kenneth Russel <[email protected]> | 2005-02-01 23:58:50 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-02-01 23:58:50 +0000 |
commit | de311bda88bdda16e33e799a8eab7f7481d9c95c (patch) | |
tree | bb9f307ab7b5e42f5136d8bff319dca78e84765a /src/net/java/games/gluegen/opengl | |
parent | 4f9ee9f82c7171f07201d2d942a1a03a3c6b5781 (diff) |
Refactoring and rewriting of portions of GlueGen for more flexibilityBLACKBIRD
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/BLACKBIRD@201 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/opengl')
-rw-r--r-- | src/net/java/games/gluegen/opengl/GLEmitter.java | 37 | ||||
-rw-r--r-- | src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java | 1 |
2 files changed, 25 insertions, 13 deletions
diff --git a/src/net/java/games/gluegen/opengl/GLEmitter.java b/src/net/java/games/gluegen/opengl/GLEmitter.java index 861e85bb7..b63d6e8b4 100644 --- a/src/net/java/games/gluegen/opengl/GLEmitter.java +++ b/src/net/java/games/gluegen/opengl/GLEmitter.java @@ -93,14 +93,27 @@ public class GLEmitter extends JavaEmitter return new GLConfiguration(); } - protected Iterator generateMethodBindingEmitters(FunctionSymbol sym) throws Exception + protected List generateMethodBindingEmitters(FunctionSymbol sym) throws Exception { - Iterator defaultEmitters = super.generateMethodBindingEmitters(sym); + return generateMethodBindingEmittersImpl(sym); + } + + protected List generateMethodBindingEmitters(FunctionSymbol sym, boolean skipProcessing) throws Exception { + if (skipProcessing) { + return super.generateMethodBindingEmitters(sym); + } else { + return generateMethodBindingEmittersImpl(sym); + } + } + + private List generateMethodBindingEmittersImpl(FunctionSymbol sym) throws Exception + { + List defaultEmitters = super.generateMethodBindingEmitters(sym); // if the superclass didn't generate any bindings for the symbol, let's // honor that (for example, the superclass might have caught an Ignore // direction that matched the symbol's name). - if (!defaultEmitters.hasNext()) + if (defaultEmitters.isEmpty()) { return defaultEmitters; } @@ -121,9 +134,9 @@ public class GLEmitter extends JavaEmitter emitGLProcAddressTableEntryForSymbol(sym); } - while (defaultEmitters.hasNext()) + for (Iterator iter = defaultEmitters.iterator(); iter.hasNext(); ) { - FunctionEmitter emitter = (FunctionEmitter)defaultEmitters.next(); + FunctionEmitter emitter = (FunctionEmitter) iter.next(); if (emitter instanceof JavaMethodBindingEmitter) { JavaMethodBindingEmitter newEmitter = @@ -144,7 +157,7 @@ public class GLEmitter extends JavaEmitter } } - return modifiedEmitters.iterator(); + return modifiedEmitters; } /** @@ -168,7 +181,7 @@ public class GLEmitter extends JavaEmitter // Internals only below this point // - private JavaMethodBindingEmitter generateModifiedEmitter(JavaMethodBindingEmitter baseJavaEmitter) + protected JavaMethodBindingEmitter generateModifiedEmitter(JavaMethodBindingEmitter baseJavaEmitter) { if (!(baseJavaEmitter instanceof JavaMethodBindingImplEmitter)) { // We only want to wrap the native entry point in the implementation @@ -178,7 +191,7 @@ public class GLEmitter extends JavaEmitter // it needs argument conversion or similar, filter that out since we will // be providing such an emitter ourselves. Otherwise return the emitter // unmodified. - if (baseJavaEmitter.isForNIOBufferBaseRoutine()) + if (baseJavaEmitter.isForImplementingMethodCall()) return null; return baseJavaEmitter; } @@ -189,7 +202,7 @@ public class GLEmitter extends JavaEmitter return new JavaGLPAWrapperEmitter(baseJavaEmitter, getGLConfig().getProcAddressTableExpr()); } - private CMethodBindingEmitter generateModifiedEmitter(CMethodBindingEmitter baseCEmitter) + protected CMethodBindingEmitter generateModifiedEmitter(CMethodBindingEmitter baseCEmitter) { // The C-side JNI binding for this particular function will have an // extra final argument, which is the address (the OpenGL procedure @@ -202,7 +215,7 @@ public class GLEmitter extends JavaEmitter return res; } - private boolean needsProcAddressWrapper(FunctionSymbol sym) + protected boolean needsProcAddressWrapper(FunctionSymbol sym) { String symName = sym.getName(); @@ -316,7 +329,7 @@ public class GLEmitter extends JavaEmitter w.close(); } - private void emitGLProcAddressTableEntryForSymbol(FunctionSymbol cFunc) + protected void emitGLProcAddressTableEntryForSymbol(FunctionSymbol cFunc) { tableWriter.print(" public long "); tableWriter.print(PROCADDRESS_VAR_PREFIX); @@ -325,7 +338,7 @@ public class GLEmitter extends JavaEmitter ++numProcAddressEntries; } - private GLConfiguration getGLConfig() { + protected GLConfiguration getGLConfig() { return (GLConfiguration) getConfig(); } diff --git a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java index 4fb50ea21..1bb06b791 100644 --- a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java +++ b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java @@ -151,7 +151,6 @@ public class JavaGLPAWrapperEmitter extends JavaMethodBindingImplEmitter protected void emitPreCallSetup(MethodBinding binding, PrintWriter writer) { super.emitPreCallSetup(binding, writer); - JavaType returnType = binding.getJavaReturnType(); MethodBinding wrappedBinding = emitterBeingWrapped.getBinding(); String procAddressVariable = |