Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13117/src/java/org/lwjgl/util/generator Modified Files: GLTypeMap.java JNITypeTranslator.java JavaMethodsGenerator.java JavaTypeTranslator.java NativeMethodStubsGenerator.java TypeInfo.java Log Message: Widened VBO/PBO buffer offsets and sizes to long to better match the GLsizeiptr and GLintptr native types Index: JNITypeTranslator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/JNITypeTranslator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- JNITypeTranslator.java 20 Feb 2005 19:28:31 -0000 1.1 +++ JNITypeTranslator.java 26 Feb 2006 11:44:33 -0000 1.2 @@ -78,6 +78,9 @@ public void visitPrimitiveType(PrimitiveType t) { String type; switch (t.getKind()) { + case LONG: + type = "jlong"; + break; case INT: type = "jint"; break; Index: GLTypeMap.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/GLTypeMap.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GLTypeMap.java 2 Nov 2005 09:28:11 -0000 1.2 +++ GLTypeMap.java 26 Feb 2006 11:44:33 -0000 1.3 @@ -59,21 +59,21 @@ native_types_to_primitive.put(GLfloat.class, PrimitiveType.Kind.FLOAT); native_types_to_primitive.put(GLint.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLshort.class, PrimitiveType.Kind.SHORT); - native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.INT); + native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLuint.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLboolean.class, PrimitiveType.Kind.BOOLEAN); native_types_to_primitive.put(GLchar.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLdouble.class, PrimitiveType.Kind.DOUBLE); native_types_to_primitive.put(GLhalf.class, PrimitiveType.Kind.SHORT); - native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.INT); + native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLsizei.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLushort.class, PrimitiveType.Kind.SHORT); native_types_to_primitive.put(GLbyte.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLclampd.class, PrimitiveType.Kind.DOUBLE); native_types_to_primitive.put(GLenum.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLhandleARB.class, PrimitiveType.Kind.INT); - native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.INT); - native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.INT); + native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.LONG); + native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLubyte.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLvoid.class, PrimitiveType.Kind.BYTE); } @@ -172,8 +172,8 @@ private static Class[] getValidBufferTypes(Class type) { if (type.equals(IntBuffer.class)) - return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLintptrARB.class, GLintptrARB.class, - GLsizei.class, GLsizeiptrARB.class, GLsizeiptr.class, GLuint.class}; + return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, + GLsizei.class, GLuint.class}; else if (type.equals(FloatBuffer.class)) return new Class[]{GLclampf.class, GLfloat.class}; else if (type.equals(ByteBuffer.class)) @@ -187,9 +187,11 @@ } private static Class[] getValidPrimitiveTypes(Class type) { - if (type.equals(int.class)) - return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLintptrARB.class, GLuint.class, - GLintptr.class, GLintptr.class, GLsizei.class, GLsizeiptrARB.class, GLsizeiptr.class}; + if (type.equals(long .class)) + return new Class[]{GLintptrARB.class, GLuint.class, GLintptr.class, GLsizeiptrARB.class, GLsizeiptr.class}; + else if (type.equals(int.class)) + return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLuint.class, + GLsizei.class}; else if (type.equals(double.class)) return new Class[]{GLclampd.class, GLdouble.class}; else if (type.equals(float.class)) Index: JavaMethodsGenerator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- JavaMethodsGenerator.java 21 Mar 2005 08:27:43 -0000 1.2 +++ JavaMethodsGenerator.java 26 Feb 2006 11:44:33 -0000 1.3 @@ -141,7 +141,7 @@ if (bo_annotation != null && mode == Mode.BUFFEROBJECT) { if (buffer_type == null) throw new RuntimeException("type of " + param + " is not a nio Buffer parameter but is annotated as buffer object"); - writer.print("int " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX); + writer.print("long " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX); } else { writer.print(type_info.getType().getSimpleName()); writer.print(" " + param.getSimpleName()); Index: JavaTypeTranslator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/JavaTypeTranslator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- JavaTypeTranslator.java 20 Feb 2005 19:28:31 -0000 1.1 +++ JavaTypeTranslator.java 26 Feb 2006 11:44:33 -0000 1.2 @@ -61,6 +61,9 @@ public void visitPrimitiveType(PrimitiveType t) { switch (t.getKind()) { + case LONG: + type = long.class; + break; case INT: type = int.class; break; Index: TypeInfo.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/TypeInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TypeInfo.java 20 Feb 2005 19:28:32 -0000 1.1 +++ TypeInfo.java 26 Feb 2006 11:44:33 -0000 1.2 @@ -77,6 +77,9 @@ private static Class getTypeFromPrimitiveKind(PrimitiveType.Kind kind) { Class type; switch (kind) { + case LONG: + type = long.class; + break; case INT: type = int.class; break; Index: NativeMethodStubsGenerator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- NativeMethodStubsGenerator.java 20 Feb 2005 19:28:32 -0000 1.1 +++ NativeMethodStubsGenerator.java 26 Feb 2006 11:44:33 -0000 1.2 @@ -70,7 +70,7 @@ private static void generateParameter(PrintWriter writer, ParameterDeclaration param, Mode mode) { writer.print(", "); if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) { - writer.print("jint " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX); + writer.print("jlong " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX); } else { JNITypeTranslator translator = new JNITypeTranslator(); param.getType().accept(translator); |