Added EXT_timer_query extension
Added support for long (int64) types
This commit is contained in:
parent
cce631748d
commit
843ce1bc27
|
@ -69,7 +69,7 @@ public final class ARBOcclusionQuery {
|
|||
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 final class ARBOcclusionQuery {
|
|||
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 final class ARBOcclusionQuery {
|
|||
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);
|
||||
|
|
|
@ -8,9 +8,9 @@ import java.nio.*;
|
|||
|
||||
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,
|
||||
|
|
|
@ -98,6 +98,7 @@ public class ContextCapabilities {
|
|||
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 @@ public class ContextCapabilities {
|
|||
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 @@ public class ContextCapabilities {
|
|||
(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 @@ public class ContextCapabilities {
|
|||
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 @@ public class ContextCapabilities {
|
|||
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");
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -279,7 +279,7 @@ public final class GL15 {
|
|||
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 final class GL15 {
|
|||
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 final class GL15 {
|
|||
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);
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class NVOcclusionQuery {
|
|||
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 final class NVOcclusionQuery {
|
|||
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);
|
||||
|
|
|
@ -37,6 +37,7 @@ import java.nio.DoubleBuffer;
|
|||
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 @@ import java.nio.ShortBuffer;
|
|||
* @author cix_foo <cix_foo@users.sourceforge.net>
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
* $Id$
|
||||
* $Id$
|
||||
*/
|
||||
public class BufferChecks {
|
||||
/** Static methods only! */
|
||||
|
@ -80,7 +81,7 @@ public class BufferChecks {
|
|||
if (o == null)
|
||||
throw new IllegalArgumentException("Null argument");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a buffer is direct or null.
|
||||
*/
|
||||
|
@ -90,12 +91,6 @@ public class BufferChecks {
|
|||
}
|
||||
}
|
||||
|
||||
public static void checkDirectOrNull(FloatBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirectOrNull(ShortBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
|
@ -108,6 +103,18 @@ public class BufferChecks {
|
|||
}
|
||||
}
|
||||
|
||||
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 @@ public class BufferChecks {
|
|||
* 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 class BufferChecks {
|
|||
}
|
||||
}
|
||||
|
||||
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 class BufferChecks {
|
|||
}
|
||||
}
|
||||
|
||||
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 @@ public class BufferChecks {
|
|||
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,11 +241,15 @@ public class BufferChecks {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 @@ import java.nio.ShortBuffer;
|
|||
*/
|
||||
|
||||
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.
|
||||
|
@ -80,6 +80,16 @@ public final class BufferUtils {
|
|||
return createByteBuffer(size << 2).asIntBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
@ -90,6 +100,16 @@ public final class BufferUtils {
|
|||
return createByteBuffer(size << 2).asFloatBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -106,16 +126,6 @@ public final class BufferUtils {
|
|||
throw new IllegalStateException("Unsupported buffer type");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -76,6 +76,8 @@ public class GLTypeMap implements TypeMap {
|
|||
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 @@ public class GLTypeMap implements TypeMap {
|
|||
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 @@ public class GLTypeMap implements TypeMap {
|
|||
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 @@ public class GLTypeMap implements TypeMap {
|
|||
case BYTE:
|
||||
type = GLbyte.class;
|
||||
break;
|
||||
case LONG:
|
||||
type = GLint64EXT.class;
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = GLboolean.class;
|
||||
break;
|
||||
|
@ -182,13 +195,15 @@ public class GLTypeMap implements TypeMap {
|
|||
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 @@ public class GLTypeMap implements TypeMap {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
|
@ -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 {
|
||||
}
|
|
@ -106,6 +106,8 @@ public class NativeTypeTranslator implements TypeVisitor {
|
|||
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 class NativeTypeTranslator implements TypeVisitor {
|
|||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
|
|
@ -81,6 +81,8 @@ public class PostfixTranslator implements TypeVisitor {
|
|||
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 @@ public class PostfixTranslator implements TypeVisitor {
|
|||
case BYTE:
|
||||
type = "b";
|
||||
break;
|
||||
case LONG:
|
||||
type = "l";
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
|
|
|
@ -116,6 +116,9 @@ public class TypeInfo {
|
|||
case SHORT:
|
||||
type = ShortBuffer.class;
|
||||
break;
|
||||
case LONG:
|
||||
type = LongBuffer.class;
|
||||
break;
|
||||
case BYTE: /* fall through */
|
||||
case BOOLEAN:
|
||||
type = ByteBuffer.class;
|
||||
|
|
|
@ -107,37 +107,37 @@ extern "C" {
|
|||
/* 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 @@ typedef unsigned char GLcharARB;
|
|||
// 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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -67,11 +67,11 @@ public interface ARB_occlusion_query {
|
|||
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);
|
||||
}
|
|
@ -34,9 +34,9 @@ package org.lwjgl.opengl;
|
|||
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,
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -167,11 +167,11 @@ public interface GL15 {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ public interface NV_occlusion_query {
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue