From: <sp...@us...> - 2006-05-25 13:04:58
|
Revision: 2340 Author: spasi Date: 2006-05-25 06:03:35 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2340&view=rev Log Message: ----------- Added EXT_timer_query extension Added support for long (int64) types Modified Paths: -------------- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBOcclusionQuery.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ATITextFragmentShader.java trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java trunk/LWJGL/src/generated/org/lwjgl/opengl/NVOcclusionQuery.java trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java trunk/LWJGL/src/java/org/lwjgl/util/generator/GLTypeMap.java trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/PostfixTranslator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/TypeInfo.java trunk/LWJGL/src/native/common/extgl.h trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_occlusion_query.java Added Paths: ----------- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTimerQuery.java trunk/LWJGL/src/java/org/lwjgl/util/generator/GLint64EXT.java trunk/LWJGL/src/java/org/lwjgl/util/generator/GLuint64EXT.java trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTimerQuery.c trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_timer_query.java Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBOcclusionQuery.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBOcclusionQuery.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ARBOcclusionQuery.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -69,7 +69,7 @@ public static void glGetQueryARB(int target, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().ARB_occlusion_query_glGetQueryivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryivARB(target, pname, params, params.position(), function_pointer); } private static native void nglGetQueryivARB(int target, int pname, IntBuffer params, int params_position, long function_pointer); @@ -77,7 +77,7 @@ public static void glGetQueryObjectARB(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().ARB_occlusion_query_glGetQueryObjectivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryObjectivARB(id, pname, params, params.position(), function_pointer); } private static native void nglGetQueryObjectivARB(int id, int pname, IntBuffer params, int params_position, long function_pointer); @@ -85,7 +85,7 @@ public static void glGetQueryObjectuARB(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().ARB_occlusion_query_glGetQueryObjectuivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryObjectuivARB(id, pname, params, params.position(), function_pointer); } private static native void nglGetQueryObjectuivARB(int id, int pname, IntBuffer params, int params_position, long function_pointer); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ATITextFragmentShader.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ATITextFragmentShader.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ATITextFragmentShader.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -8,9 +8,9 @@ public final class ATITextFragmentShader { /** - * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, - * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - * and GetDoublev, and by the <target> parameter of ProgramStringARB, + * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, + * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, + * and GetDoublev, and by the <target> parameter of ProgramStringARB, * BindProgramARB, ProgramEnvParameter4{d,dv,f,fv}ARB, * ProgramLocalParameter4{d,dv,f,fv}ARB, * GetProgramEnvParameter{dv,fv}ARB, GetProgramLocalParameter{dv,fv}ARB, Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -98,6 +98,7 @@ public final boolean GL_EXT_texture_mirror_clamp; public final boolean GL_EXT_texture_rectangle; public final boolean GL_EXT_texture_sRGB; + public final boolean GL_EXT_timer_query; public final boolean GL_EXT_vertex_shader; public final boolean GL_EXT_vertex_weighting; public final boolean OpenGL11; @@ -460,6 +461,8 @@ long EXT_secondary_color_glSecondaryColorPointerEXT_pointer; long EXT_stencil_clear_tag_glStencilClearTagEXT_pointer; long EXT_stencil_two_side_glActiveStencilFaceEXT_pointer; + long EXT_timer_query_glGetQueryObjecti64vEXT_pointer; + long EXT_timer_query_glGetQueryObjectui64vEXT_pointer; long EXT_vertex_shader_glBeginVertexShaderEXT_pointer; long EXT_vertex_shader_glEndVertexShaderEXT_pointer; long EXT_vertex_shader_glBindVertexShaderEXT_pointer; @@ -1477,6 +1480,12 @@ (EXT_stencil_two_side_glActiveStencilFaceEXT_pointer = GLContext.getFunctionAddress("glActiveStencilFaceEXT")) != 0; } + private boolean EXT_timer_query_initNativeFunctionAddresses() { + return + (EXT_timer_query_glGetQueryObjecti64vEXT_pointer = GLContext.getFunctionAddress("glGetQueryObjecti64vEXT")) != 0 && + (EXT_timer_query_glGetQueryObjectui64vEXT_pointer = GLContext.getFunctionAddress("glGetQueryObjectui64vEXT")) != 0; + } + private boolean EXT_vertex_shader_initNativeFunctionAddresses() { return (EXT_vertex_shader_glBeginVertexShaderEXT_pointer = GLContext.getFunctionAddress("glBeginVertexShaderEXT")) != 0 && @@ -2198,6 +2207,8 @@ supported_extensions.remove("GL_EXT_stencil_clear_tag"); if (supported_extensions.contains("GL_EXT_stencil_two_side") && !EXT_stencil_two_side_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_stencil_two_side"); + if (supported_extensions.contains("GL_EXT_timer_query") && !EXT_timer_query_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_timer_query"); if (supported_extensions.contains("GL_EXT_vertex_shader") && !EXT_vertex_shader_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_vertex_shader"); if (supported_extensions.contains("GL_EXT_vertex_weighting") && !EXT_vertex_weighting_initNativeFunctionAddresses()) @@ -2339,6 +2350,7 @@ this.GL_EXT_texture_mirror_clamp = supported_extensions.contains("GL_EXT_texture_mirror_clamp"); this.GL_EXT_texture_rectangle = supported_extensions.contains("GL_EXT_texture_rectangle"); this.GL_EXT_texture_sRGB = supported_extensions.contains("GL_EXT_texture_sRGB"); + this.GL_EXT_timer_query = supported_extensions.contains("GL_EXT_timer_query"); this.GL_EXT_vertex_shader = supported_extensions.contains("GL_EXT_vertex_shader"); this.GL_EXT_vertex_weighting = supported_extensions.contains("GL_EXT_vertex_weighting"); this.OpenGL11 = supported_extensions.contains("OpenGL11"); Added: trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTimerQuery.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTimerQuery.java (rev 0) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/EXTTimerQuery.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -0,0 +1,35 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTTimerQuery { + /** + * Accepted by the <target> parameter of BeginQuery, EndQuery, and + * GetQueryiv: + */ + public static final int GL_TIME_ELAPSED_EXT = 0x88bf; + + private EXTTimerQuery() { + } + + + public static void glGetQueryObjecti64EXT(int id, int pname, LongBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_timer_query_glGetQueryObjecti64vEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, 1); + nglGetQueryObjecti64vEXT(id, pname, params, params.position(), function_pointer); + } + private static native void nglGetQueryObjecti64vEXT(int id, int pname, LongBuffer params, int params_position, long function_pointer); + + public static void glGetQueryObjectui64EXT(int id, int pname, LongBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_timer_query_glGetQueryObjectui64vEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, 1); + nglGetQueryObjectui64vEXT(id, pname, params, params.position(), function_pointer); + } + private static native void nglGetQueryObjectui64vEXT(int id, int pname, LongBuffer params, int params_position, long function_pointer); +} Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/GL15.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -279,7 +279,7 @@ public static void glGetQuery(int target, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().GL15_glGetQueryiv_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryiv(target, pname, params, params.position(), function_pointer); } private static native void nglGetQueryiv(int target, int pname, IntBuffer params, int params_position, long function_pointer); @@ -287,7 +287,7 @@ public static void glGetQueryObject(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().GL15_glGetQueryObjectiv_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryObjectiv(id, pname, params, params.position(), function_pointer); } private static native void nglGetQueryObjectiv(int id, int pname, IntBuffer params, int params_position, long function_pointer); @@ -295,7 +295,7 @@ public static void glGetQueryObjectu(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().GL15_glGetQueryObjectuiv_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetQueryObjectuiv(id, pname, params, params.position(), function_pointer); } private static native void nglGetQueryObjectuiv(int id, int pname, IntBuffer params, int params_position, long function_pointer); Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/NVOcclusionQuery.java =================================================================== --- trunk/LWJGL/src/generated/org/lwjgl/opengl/NVOcclusionQuery.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/generated/org/lwjgl/opengl/NVOcclusionQuery.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -59,7 +59,7 @@ public static void glGetOcclusionQueryuNV(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glGetOcclusionQueryuivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetOcclusionQueryuivNV(id, pname, params, params.position(), function_pointer); } private static native void nglGetOcclusionQueryuivNV(int id, int pname, IntBuffer params, int params_position, long function_pointer); @@ -67,7 +67,7 @@ public static void glGetOcclusionQueryNV(int id, int pname, IntBuffer params) { long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glGetOcclusionQueryivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); - BufferChecks.checkBuffer(params, 4); + BufferChecks.checkBuffer(params, 1); nglGetOcclusionQueryivNV(id, pname, params, params.position(), function_pointer); } private static native void nglGetOcclusionQueryivNV(int id, int pname, IntBuffer params, int params_position, long function_pointer); Modified: trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/BufferChecks.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -37,6 +37,7 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.ShortBuffer; +import java.nio.LongBuffer; /** * <p>A class to check buffer boundaries in general. If there is unsufficient space @@ -46,7 +47,7 @@ * @author cix_foo <ci...@us...> * @author elias_naur <eli...@us...> * @version $Revision$ - * $Id$ + * $Id$ */ public class BufferChecks { /** Static methods only! */ @@ -80,7 +81,7 @@ if (o == null) throw new IllegalArgumentException("Null argument"); } - + /** * Helper methods to ensure a buffer is direct or null. */ @@ -90,24 +91,30 @@ } } - public static void checkDirectOrNull(FloatBuffer buf) { + public static void checkDirectOrNull(ShortBuffer buf) { if (buf != null) { checkDirect(buf); } } - public static void checkDirectOrNull(ShortBuffer buf) { + public static void checkDirectOrNull(IntBuffer buf) { if (buf != null) { checkDirect(buf); } } - public static void checkDirectOrNull(IntBuffer buf) { + public static void checkDirectOrNull(LongBuffer buf) { if (buf != null) { checkDirect(buf); } } + public static void checkDirectOrNull(FloatBuffer buf) { + if (buf != null) { + checkDirect(buf); + } + } + public static void checkDirectOrNull(DoubleBuffer buf) { if (buf != null) { checkDirect(buf); @@ -118,14 +125,16 @@ * Helper methods to ensure a buffer is direct (and, implicitly, non-null). */ public static void checkDirectBuffer(Buffer buf) { - if (buf instanceof ByteBuffer) + if (buf instanceof FloatBuffer) + checkDirect((FloatBuffer)buf); + else if (buf instanceof ByteBuffer) checkDirect((ByteBuffer)buf); else if (buf instanceof ShortBuffer) checkDirect((ShortBuffer)buf); else if (buf instanceof IntBuffer) checkDirect((IntBuffer)buf); - else if (buf instanceof FloatBuffer) - checkDirect((FloatBuffer)buf); + else if (buf instanceof LongBuffer) + checkDirect((LongBuffer)buf); else if (buf instanceof DoubleBuffer) checkDirect((DoubleBuffer)buf); else @@ -138,12 +147,6 @@ } } - public static void checkDirect(FloatBuffer buf) { - if (!buf.isDirect()) { - throw new IllegalArgumentException("FloatBuffer is not direct"); - } - } - public static void checkDirect(ShortBuffer buf) { if (!buf.isDirect()) { throw new IllegalArgumentException("ShortBuffer is not direct"); @@ -156,9 +159,21 @@ } } + public static void checkDirect(LongBuffer buf) { + if (!buf.isDirect()) { + throw new IllegalArgumentException("LongBuffer is not direct"); + } + } + + public static void checkDirect(FloatBuffer buf) { + if (!buf.isDirect()) { + throw new IllegalArgumentException("FloatBuffer is not direct"); + } + } + public static void checkDirect(DoubleBuffer buf) { if (!buf.isDirect()) { - throw new IllegalArgumentException("IntBuffer is not direct"); + throw new IllegalArgumentException("DoubleBuffer is not direct"); } } @@ -183,12 +198,17 @@ checkDirect(buf); } + public static void checkBuffer(ShortBuffer buf, int size) { + checkBufferSize(buf, size); + checkDirect(buf); + } + public static void checkBuffer(IntBuffer buf, int size) { checkBufferSize(buf, size); checkDirect(buf); } - public static void checkBuffer(ShortBuffer buf, int size) { + public static void checkBuffer(LongBuffer buf, int size) { checkBufferSize(buf, size); checkDirect(buf); } @@ -221,14 +241,18 @@ checkBuffer(buf, DEFAULT_BUFFER_SIZE); } - public static void checkBuffer(FloatBuffer buf) { + public static void checkBuffer(IntBuffer buf) { checkBuffer(buf, DEFAULT_BUFFER_SIZE); } - public static void checkBuffer(IntBuffer buf) { + public static void checkBuffer(LongBuffer buf) { checkBuffer(buf, DEFAULT_BUFFER_SIZE); } + public static void checkBuffer(FloatBuffer buf) { + checkBuffer(buf, DEFAULT_BUFFER_SIZE); + } + public static void checkBuffer(DoubleBuffer buf) { checkBuffer(buf, DEFAULT_BUFFER_SIZE); } Modified: trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -1,31 +1,31 @@ -/* +/* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -50,16 +50,16 @@ */ public final class BufferUtils { - + /** * Construct a direct native-ordered bytebuffer with the specified size. * @param size The size, in bytes * @return a ByteBuffer - */ + */ public static ByteBuffer createByteBuffer(int size) { return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder()); } - + /** * Construct a direct native-order shortbuffer with the specified number * of elements. @@ -81,6 +81,16 @@ } /** + * Construct a direct native-order intbuffer with the specified number + * of elements. + * @param size The size, in ints + * @return an IntBuffer + */ + public static LongBuffer createLongBuffer(int size) { + return createByteBuffer(size << 3).asLongBuffer(); + } + + /** * Construct a direct native-order floatbuffer with the specified number * of elements. * @param size The size, in floats @@ -91,6 +101,16 @@ } /** + * Construct a direct native-order doublebuffer with the specified number + * of elements. + * @param size The size, in floats + * @return a FloatBuffer + */ + public static DoubleBuffer createDoubleBuffer(int size) { + return createByteBuffer(size << 3).asDoubleBuffer(); + } + + /** * @return n, where buffer_element_size=2^n. */ public static int getElementSizeExponent(Buffer buf) { @@ -107,16 +127,6 @@ } /** - * Construct a direct native-order doublebuffer with the specified number - * of elements. - * @param size The size, in floats - * @return a FloatBuffer - */ - public static DoubleBuffer createDoubleBuffer(int size) { - return createByteBuffer(size << 3).asDoubleBuffer(); - } - - /** * A helper function which is used to get the byte offset in an arbitrary buffer * based on its position * @return the position of the buffer, in BYTES Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/GLTypeMap.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/GLTypeMap.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/GLTypeMap.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -76,6 +76,8 @@ 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); + native_types_to_primitive.put(GLint64EXT.class, PrimitiveType.Kind.LONG); + native_types_to_primitive.put(GLuint64EXT.class, PrimitiveType.Kind.LONG); } public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) { @@ -106,6 +108,10 @@ return Signedness.UNSIGNED; else if (GLbyte.class.equals(type)) return Signedness.SIGNED; + else if (GLuint64EXT.class.equals(type)) + return Signedness.UNSIGNED; + else if (GLint64EXT.class.equals(type)) + return Signedness.SIGNED; else return Signedness.NONE; } @@ -129,6 +135,10 @@ return "d"; else if (annotation_type.equals(GLhalf.class)) return "h"; + else if (annotation_type.equals(GLuint64EXT.class)) + return "l"; + else if (annotation_type.equals(GLint64EXT.class)) + return "l"; else if (annotation_type.equals(GLboolean.class) || annotation_type.equals(GLvoid.class)) return ""; else @@ -153,6 +163,9 @@ case BYTE: type = GLbyte.class; break; + case LONG: + type = GLint64EXT.class; + break; case BOOLEAN: type = GLboolean.class; break; @@ -182,13 +195,15 @@ return new Class[]{GLhalf.class, GLshort.class, GLushort.class}; else if (type.equals(DoubleBuffer.class)) return new Class[]{GLclampd.class, GLdouble.class}; + else if (type.equals(LongBuffer.class)) + return new Class[]{GLint64EXT.class, GLuint64EXT.class}; else return new Class[]{}; } private static Class[] getValidPrimitiveTypes(Class type) { - if (type.equals(long .class)) - return new Class[]{GLintptrARB.class, GLuint.class, GLintptr.class, GLsizeiptrARB.class, GLsizeiptr.class}; + if (type.equals(long.class)) + return new Class[]{GLintptrARB.class, GLuint.class, GLintptr.class, GLsizeiptrARB.class, GLsizeiptr.class, GLint64EXT.class, GLuint64EXT.class}; else if (type.equals(int.class)) return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLuint.class, GLsizei.class}; @@ -242,6 +257,10 @@ return GLbyte.class; else if (GLbyte.class.equals(type)) return GLubyte.class; + else if (GLuint64EXT.class.equals(type)) + return GLint64EXT.class; + else if (GLint64EXT.class.equals(type)) + return GLuint64EXT.class; else return null; } Added: trunk/LWJGL/src/java/org/lwjgl/util/generator/GLint64EXT.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/GLint64EXT.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/GLint64EXT.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.util.generator; + +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; + +@NativeType +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface GLint64EXT { +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/util/generator/GLuint64EXT.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/GLuint64EXT.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/GLuint64EXT.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.util.generator; + +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; + +@NativeType +@Target({ElementType.PARAMETER, ElementType.METHOD}) +public @interface GLuint64EXT { +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -106,6 +106,8 @@ return PrimitiveType.Kind.BYTE; else if (FloatBuffer.class.equals(c)) return PrimitiveType.Kind.FLOAT; + else if (LongBuffer.class.equals(c)) + return PrimitiveType.Kind.LONG; else throw new RuntimeException(c + " is not allowed"); } @@ -183,7 +185,7 @@ public void visitReferenceType(ReferenceType t) { throw new RuntimeException(t + " is not allowed"); } - + public void visitTypeMirror(TypeMirror t) { throw new RuntimeException(t + " is not allowed"); } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/PostfixTranslator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/PostfixTranslator.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/PostfixTranslator.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -81,6 +81,8 @@ return PrimitiveType.Kind.BYTE; else if (FloatBuffer.class.equals(c)) return PrimitiveType.Kind.FLOAT; + else if (LongBuffer.class.equals(c)) + return PrimitiveType.Kind.LONG; else throw new RuntimeException(c + " is not allowed"); } @@ -150,6 +152,9 @@ case BYTE: type = "b"; break; + case LONG: + type = "l"; + break; default: throw new RuntimeException(kind + " is not allowed"); } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/TypeInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/TypeInfo.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/TypeInfo.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -116,6 +116,9 @@ case SHORT: type = ShortBuffer.class; break; + case LONG: + type = LongBuffer.class; + break; case BYTE: /* fall through */ case BOOLEAN: type = ByteBuffer.class; Modified: trunk/LWJGL/src/native/common/extgl.h =================================================================== --- trunk/LWJGL/src/native/common/extgl.h 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/native/common/extgl.h 2006-05-25 13:03:35 UTC (rev 2340) @@ -107,37 +107,37 @@ /* OpenGL 1.1 definition */ #ifdef _MACOSX -typedef unsigned long GLenum; -typedef unsigned char GLboolean; -typedef unsigned long GLbitfield; -typedef signed char GLbyte; -typedef short GLshort; -typedef long GLint; -typedef long GLsizei; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned long GLuint; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void GLvoid; + typedef unsigned long GLenum; + typedef unsigned char GLboolean; + typedef unsigned long GLbitfield; + typedef signed char GLbyte; + typedef short GLshort; + typedef long GLint; + typedef long GLsizei; + typedef unsigned char GLubyte; + typedef unsigned short GLushort; + typedef unsigned long GLuint; + typedef float GLfloat; + typedef float GLclampf; + typedef double GLdouble; + typedef double GLclampd; + typedef void GLvoid; #else -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef signed char GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void GLvoid; + typedef unsigned int GLenum; + typedef unsigned char GLboolean; + typedef unsigned int GLbitfield; + typedef signed char GLbyte; + typedef short GLshort; + typedef int GLint; + typedef int GLsizei; + typedef unsigned char GLubyte; + typedef unsigned short GLushort; + typedef unsigned int GLuint; + typedef float GLfloat; + typedef float GLclampf; + typedef double GLdouble; + typedef double GLclampd; + typedef void GLvoid; #endif // OpenGL 2.0 types @@ -155,6 +155,10 @@ // NV_half_float types typedef unsigned short GLhalf; +// EXT_timer_query types +typedef unsigned long GLuint64EXT; +typedef long GLint64EXT; + /* helper stuff */ /* initializes everything, call this right after the rc is created. the function returns true if successful */ Added: trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTimerQuery.c =================================================================== --- trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTimerQuery.c (rev 0) +++ trunk/LWJGL/src/native/generated/org_lwjgl_opengl_EXTTimerQuery.c 2006-05-25 13:03:35 UTC (rev 2340) @@ -0,0 +1,20 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include <jni.h> +#include "extgl.h" + +typedef void (APIENTRY *glGetQueryObjecti64vEXTPROC) (GLuint id, GLenum pname, GLint64EXT * params); +typedef void (APIENTRY *glGetQueryObjectui64vEXTPROC) (GLuint id, GLenum pname, GLuint64EXT * params); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTimerQuery_nglGetQueryObjecti64vEXT(JNIEnv *env, jclass clazz, jint id, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLint64EXT *params_address = ((GLint64EXT *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetQueryObjecti64vEXTPROC glGetQueryObjecti64vEXT = (glGetQueryObjecti64vEXTPROC)((intptr_t)function_pointer); + glGetQueryObjecti64vEXT(id, pname, params_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTimerQuery_nglGetQueryObjectui64vEXT(JNIEnv *env, jclass clazz, jint id, jint pname, jobject params, jint params_position, jlong function_pointer) { + GLuint64EXT *params_address = ((GLuint64EXT *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glGetQueryObjectui64vEXTPROC glGetQueryObjectui64vEXT = (glGetQueryObjectui64vEXTPROC)((intptr_t)function_pointer); + glGetQueryObjectui64vEXT(id, pname, params_address); +} + Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_occlusion_query.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -67,11 +67,11 @@ void glEndQueryARB(@GLenum int target); @StripPostfix("params") - void glGetQueryivARB(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params); + void glGetQueryivARB(@GLenum int target, @GLenum int pname, @Check("1") IntBuffer params); @StripPostfix("params") - void glGetQueryObjectivARB(@GLuint int id, @GLenum int pname, @Check("4") IntBuffer params); + void glGetQueryObjectivARB(@GLuint int id, @GLenum int pname, @Check("1") IntBuffer params); @StripPostfix("params") - void glGetQueryObjectuivARB(@GLuint int id, @GLenum int pname, @Check("4") IntBuffer params); -} + void glGetQueryObjectuivARB(@GLuint int id, @GLenum int pname, @Check("1") IntBuffer params); +} \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ATI_text_fragment_shader.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -34,9 +34,9 @@ public interface ATI_text_fragment_shader { /** - * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, - * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, - * and GetDoublev, and by the <target> parameter of ProgramStringARB, + * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, + * and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, + * and GetDoublev, and by the <target> parameter of ProgramStringARB, * BindProgramARB, ProgramEnvParameter4{d,dv,f,fv}ARB, * ProgramLocalParameter4{d,dv,f,fv}ARB, * GetProgramEnvParameter{dv,fv}ARB, GetProgramLocalParameter{dv,fv}ARB, Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_timer_query.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_timer_query.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_timer_query.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +import org.lwjgl.util.generator.*; + +import java.nio.*; + +public interface EXT_timer_query { + + /** + * Accepted by the <target> parameter of BeginQuery, EndQuery, and + * GetQueryiv: + */ + int GL_TIME_ELAPSED_EXT = 0x88BF; + + @StripPostfix("params") + void glGetQueryObjecti64vEXT(@GLuint int id, @GLenum int pname, @Check("1") @GLint64EXT LongBuffer params); + + @StripPostfix("params") + void glGetQueryObjectui64vEXT(@GLuint int id, @GLenum int pname, @Check("1") @GLuint64EXT LongBuffer params); + +} \ No newline at end of file Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -167,11 +167,11 @@ void glEndQuery(@GLenum int target); @StripPostfix("params") - void glGetQueryiv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params); + void glGetQueryiv(@GLenum int target, @GLenum int pname, @Check("1") IntBuffer params); @StripPostfix("params") - void glGetQueryObjectiv(@GLenum int id, @GLenum int pname, @Check("4") @GLint IntBuffer params); + void glGetQueryObjectiv(@GLenum int id, @GLenum int pname, @Check("1") @GLint IntBuffer params); @StripPostfix("params") - void glGetQueryObjectuiv(@GLenum int id, @GLenum int pname, @Check("4") @GLuint IntBuffer params); + void glGetQueryObjectuiv(@GLenum int id, @GLenum int pname, @Check("1") @GLuint IntBuffer params); } Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_occlusion_query.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_occlusion_query.java 2006-05-18 12:11:37 UTC (rev 2339) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_occlusion_query.java 2006-05-25 13:03:35 UTC (rev 2340) @@ -55,8 +55,8 @@ void glEndOcclusionQueryNV(); @StripPostfix("params") - void glGetOcclusionQueryuivNV(@GLuint int id, @GLenum int pname, @Check("4") @GLuint IntBuffer params); + void glGetOcclusionQueryuivNV(@GLuint int id, @GLenum int pname, @Check("1") @GLuint IntBuffer params); @StripPostfix("params") - void glGetOcclusionQueryivNV(@GLuint int id, @GLenum int pname, @Check("4") IntBuffer params); + void glGetOcclusionQueryivNV(@GLuint int id, @GLenum int pname, @Check("1") IntBuffer params); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |