diff options
author | Kenneth Russel <[email protected]> | 2004-04-22 03:37:57 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-04-22 03:37:57 +0000 |
commit | 9512c9fa62ece3960472b6ab2cd6ce5244da8501 (patch) | |
tree | 87112d7ade6b1ec2fd364f77012838cde49b9c7b /src/net/java/games/gluegen/opengl | |
parent | 6ea7e2388164abd26aa8a88ffe615fb6e7780ee6 (diff) |
Added OpenGL 1.5 support. Updated glext.h, wglext.h, and glxext.h from
extension registry; these now include only very few changes relative
to the master version. Fixed bugs in GlueGen and PCPP to make it parse
the verbatim headers and to emit correct glue code for some
newly-exercised constructs like char**.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@115 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/opengl')
-rw-r--r-- | src/net/java/games/gluegen/opengl/CGLPAWrapperEmitter.java | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/net/java/games/gluegen/opengl/CGLPAWrapperEmitter.java b/src/net/java/games/gluegen/opengl/CGLPAWrapperEmitter.java index 2a1559e52..bb80190d3 100644 --- a/src/net/java/games/gluegen/opengl/CGLPAWrapperEmitter.java +++ b/src/net/java/games/gluegen/opengl/CGLPAWrapperEmitter.java @@ -113,24 +113,27 @@ public class CGLPAWrapperEmitter extends CMethodBindingEmitter super.emitBodyVariableDeclarations(writer); } - protected void emitBodyVariablePreCallSetup(PrintWriter writer) + protected void emitBodyVariablePreCallSetup(PrintWriter writer, + boolean emittingPrimitiveArrayCritical) { - super.emitBodyVariablePreCallSetup(writer); + super.emitBodyVariablePreCallSetup(writer, emittingPrimitiveArrayCritical); - // set the function pointer to the value of the passed-in glProcAddress - FunctionSymbol cSym = getBinding().getCSymbol(); - String funcPointerTypedefName = - GLEmitter.getGLFunctionPointerTypedefName(cSym); + if (!emittingPrimitiveArrayCritical) { + // set the function pointer to the value of the passed-in glProcAddress + FunctionSymbol cSym = getBinding().getCSymbol(); + String funcPointerTypedefName = + GLEmitter.getGLFunctionPointerTypedefName(cSym); - String ptrVarName = "ptr_" + cSym.getName(); + String ptrVarName = "ptr_" + cSym.getName(); - writer.print(" "); - writer.print(ptrVarName); - writer.print(" = ("); - writer.print(funcPointerTypedefName); - writer.println(") (intptr_t) glProcAddress;"); + writer.print(" "); + writer.print(ptrVarName); + writer.print(" = ("); + writer.print(funcPointerTypedefName); + writer.println(") (intptr_t) glProcAddress;"); - writer.println(" assert(" + ptrVarName + " != NULL);"); + writer.println(" assert(" + ptrVarName + " != NULL);"); + } } // FIXME: refactor this and the superclass version so we don't have to copy @@ -192,6 +195,9 @@ public class CGLPAWrapperEmitter extends CMethodBindingEmitter } if (javaType.isArray() || javaType.isNIOBuffer()) { writer.print(pointerConversionArgumentName(i)); + if (javaArgTypeNeedsDataCopy(javaType)) { + writer.print("_copy"); + } } else { if (javaType.isString()) { writer.print("_UTF8"); } writer.print(binding.getArgumentName(i)); |