diff options
author | Kenneth Russel <[email protected]> | 2008-12-07 20:58:10 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-12-07 20:58:10 +0000 |
commit | 6b72c6747b4e57c3112f3a3ce5c2f17b57af3b6b (patch) | |
tree | fe9ac4f3da96f79b621ff0639af688ac06196ab2 /src/java/com | |
parent | 1e497c3663afb8b2ef0beb6a350855c07288fa4b (diff) |
Turned off error checking for synthetic calls like "getGL2ES2" in
debug pipelines in unsuccessful attempt to work around buggy Mac OS X
OpenGL drivers which flag errors even when there is none
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/branches/JOGL_2_SANDBOX@117 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java b/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java index 2507393..e250d85 100644 --- a/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java +++ b/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java @@ -119,7 +119,12 @@ public class BuildComposablePipeline List/*<Method>*/ publicMethodsRaw = Arrays.asList(classToComposeAround.getMethods()); Set/*<Method>*/ publicMethodsPlain = new HashSet(); for (Iterator iter=publicMethodsRaw.iterator(); iter.hasNext(); ) { - publicMethodsPlain.add(new PlainMethod((Method)iter.next())); } + Method method = (Method) iter.next(); + // Don't hook methods which aren't real GL methods, + // such as the synthetic "getGL2ES2" + boolean runHooks = (method.getName().startsWith("gl")); + publicMethodsPlain.add(new PlainMethod(method, runHooks)); + } (new DebugPipeline(pDir, pInterface)).emit(publicMethodsPlain.iterator()); (new TracePipeline(pDir, pInterface)).emit(publicMethodsPlain.iterator()); @@ -130,13 +135,17 @@ public class BuildComposablePipeline protected class PlainMethod { Method m; + boolean runHooks; - public PlainMethod(Method m) { + public PlainMethod(Method m, boolean runHooks) { this.m=m; + this.runHooks = runHooks; } public Method getWrappedMethod() { return m; } + public boolean runHooks() { return runHooks; } + public boolean equals(Object obj) { if(obj instanceof PlainMethod) { PlainMethod b = (PlainMethod)obj; @@ -241,16 +250,17 @@ public class BuildComposablePipeline } ); - preMethodEmissionHook(output); + preMethodEmissionHook(output); constructorHook(output); while (methodsToWrap.hasNext()) { - Method m = ((PlainMethod)methodsToWrap.next()).getWrappedMethod(); + PlainMethod pm = (PlainMethod)methodsToWrap.next(); + Method m = pm.getWrappedMethod(); emitMethodDocComment(output, m); emitSignature(output, m); - emitBody(output, m); + emitBody(output, m, pm.runHooks()); } postMethodEmissionHook(output); @@ -289,13 +299,15 @@ public class BuildComposablePipeline output.println(")"); } - protected void emitBody(PrintWriter output, Method m) + protected void emitBody(PrintWriter output, Method m, boolean runHooks) { output.println(" {"); output.print(" "); Class retType = m.getReturnType(); - preDownstreamCallHook(output, m); + if (runHooks) { + preDownstreamCallHook(output, m); + } if (retType != Void.TYPE) { @@ -309,7 +321,9 @@ public class BuildComposablePipeline output.print(getArgListAsString(m, false, true)); output.println(");"); - postDownstreamCallHook(output, m); + if (runHooks) { + postDownstreamCallHook(output, m); + } if (retType != Void.TYPE) { |