aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/gluegen/JavaEmitter.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-08-06 04:58:31 +0000
committerKenneth Russel <[email protected]>2003-08-06 04:58:31 +0000
commit661fec76c5ccd030016d66675024ec604752ccda (patch)
treeeeb61fdea2164d358809eed4d73b6654815c01d8 /src/net/java/games/gluegen/JavaEmitter.java
parentd224c85aa7c2e420ffec62ce77f2ca02430f6c76 (diff)
Changed behavior of ManuallyImplement to not emit GLEmitter's dispatch
routine, but to still emit entry in proc address table. Added first implementation of glMapBufferARB; may need to reimplement due to creation of finalizable direct ByteBuffer objects each time this routine is called (which will be every frame). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@45 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/JavaEmitter.java')
-rw-r--r--src/net/java/games/gluegen/JavaEmitter.java51
1 files changed, 28 insertions, 23 deletions
diff --git a/src/net/java/games/gluegen/JavaEmitter.java b/src/net/java/games/gluegen/JavaEmitter.java
index 824b703b4..63350b2e8 100644
--- a/src/net/java/games/gluegen/JavaEmitter.java
+++ b/src/net/java/games/gluegen/JavaEmitter.java
@@ -391,31 +391,30 @@ public class JavaEmitter implements GlueEmitter {
allEmitters.add(entryPointInterface);
}
- if (cfg.emitImpl() && binding.needsBody() && !isUnimplemented) {
- // Generate the method which calls the underlying function
- // after unboxing has occurred
- PrintWriter output = cfg.allStatic() ? javaWriter() : javaImplWriter();
- JavaMethodBindingEmitter wrappedEntryPoint =
- new JavaMethodBindingEmitter(specialBinding, output, cfg.runtimeExceptionType(), true);
- wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.PRIVATE);
- wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.STATIC); // Doesn't really matter
- wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.NATIVE);
- allEmitters.add(wrappedEntryPoint);
- }
-
- // If the user has stated that the function will be
- // manually implemented, then don't auto-generate a function body.
if (cfg.emitImpl()) {
- if (!cfg.manuallyImplement(sym.getName()) && !isUnimplemented)
- {
- CMethodBindingEmitter cEmitter =
- makeCEmitter(specialBinding,
- overloaded,
- (binding != specialBinding),
- cfg.implPackageName(), cfg.implClassName(),
- cWriter());
- allEmitters.add(cEmitter);
+ // If the user has stated that the function will be
+ // manually implemented, then don't auto-generate a function body.
+ if (!cfg.manuallyImplement(sym.getName()) && !isUnimplemented) {
+ if (binding.needsBody()) {
+ // Generate the method which calls the underlying function
+ // after unboxing has occurred
+ PrintWriter output = cfg.allStatic() ? javaWriter() : javaImplWriter();
+ JavaMethodBindingEmitter wrappedEntryPoint =
+ new JavaMethodBindingEmitter(specialBinding, output, cfg.runtimeExceptionType(), true);
+ wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.PRIVATE);
+ wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.STATIC); // Doesn't really matter
+ wrappedEntryPoint.addModifier(JavaMethodBindingEmitter.NATIVE);
+ allEmitters.add(wrappedEntryPoint);
}
+
+ CMethodBindingEmitter cEmitter =
+ makeCEmitter(specialBinding,
+ overloaded,
+ (binding != specialBinding),
+ cfg.implPackageName(), cfg.implClassName(),
+ cWriter());
+ allEmitters.add(cEmitter);
+ }
}
} // end iteration over expanded bindings
} catch (Exception e) {
@@ -1118,6 +1117,12 @@ public class JavaEmitter implements GlueEmitter {
protected void emitCHeader(PrintWriter cWriter, String className) {
cWriter.println("#include <jni.h>");
cWriter.println();
+
+ if (getConfig().emitImpl()) {
+ cWriter.println("#include <assert.h>");
+ cWriter.println();
+ }
+
for (Iterator iter = cfg.customCCode().iterator(); iter.hasNext(); ) {
cWriter.println((String) iter.next());
}