mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-03-29 00:25:52 +01:00
Moved all pointer arithmetic to Java code.
This commit is contained in:
parent
c7088cb44f
commit
0b0e185f47
243
src/java/org/lwjgl/MemoryUtil.java
Normal file
243
src/java/org/lwjgl/MemoryUtil.java
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.*;
|
||||
|
||||
/**
|
||||
* [INTERNAL USE ONLY]
|
||||
* <p/>
|
||||
* This class provides utility methods for passing buffer addresses to JNI API calls.
|
||||
*
|
||||
* @author Spasi
|
||||
*/
|
||||
public final class MemoryUtil {
|
||||
|
||||
private static final Accessor memUtil;
|
||||
|
||||
static {
|
||||
Accessor util;
|
||||
try {
|
||||
// Depends on java.nio.Buffer#address and sun.misc.Unsafe
|
||||
//util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorUnsafe");
|
||||
util = new AccessorJNI();
|
||||
} catch (Exception e0) {
|
||||
try {
|
||||
// Depends on java.nio.Buffer#address and sun.reflect.FieldAccessor
|
||||
util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorReflectFast");
|
||||
} catch (Exception e1) {
|
||||
try {
|
||||
// Depends on java.nio.Buffer#address
|
||||
util = new AccessorReflect();
|
||||
} catch (Exception e2) {
|
||||
LWJGLUtil.log("Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers.");
|
||||
util = new AccessorJNI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LWJGLUtil.log("MemoryUtil Accessor: " + util.getClass().getSimpleName());
|
||||
memUtil = util;
|
||||
|
||||
/*
|
||||
BENCHMARK RESULTS - Oracle Server VM:
|
||||
|
||||
Unsafe: 4ns
|
||||
ReflectFast: 8ns
|
||||
Reflect: 10ns
|
||||
JNI: 82ns
|
||||
|
||||
BENCHMARK RESULTS - Oracle Client VM:
|
||||
|
||||
Unsafe: 5ns
|
||||
ReflectFast: 81ns
|
||||
Reflect: 85ns
|
||||
JNI: 87ns
|
||||
|
||||
On non-Oracle VMs, Unsafe should be the fastest implementation as well. In the absence
|
||||
of Unsafe, performance will depend on how reflection and JNI are implemented. For now
|
||||
we'll go with what we see on the Oracle VM (that is, we'll prefer reflection over JNI).
|
||||
*/
|
||||
}
|
||||
|
||||
private MemoryUtil() {
|
||||
}
|
||||
|
||||
public static String wrap(final String test) {
|
||||
return "MemoryUtil.getAddress(" + test + ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the memory address of the specified buffer. [INTERNAL USE ONLY]
|
||||
*
|
||||
* @param buffer the buffer
|
||||
*
|
||||
* @return the memory address
|
||||
*/
|
||||
public static long getAddress0(Buffer buffer) { return memUtil.getAddress(buffer); }
|
||||
|
||||
public static long getAddress0Safe(Buffer buffer) { return buffer == null ? 0L : memUtil.getAddress(buffer); }
|
||||
|
||||
public static long getAddress0(PointerBuffer buffer) { return memUtil.getAddress(buffer.getBuffer()); }
|
||||
|
||||
public static long getAddress0Safe(PointerBuffer buffer) { return buffer == null ? 0L : memUtil.getAddress(buffer.getBuffer()); }
|
||||
|
||||
// --- [ API utilities ] ---
|
||||
|
||||
public static long getAddress(ByteBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(ByteBuffer buffer, int position) { return getAddress0(buffer) + position; }
|
||||
|
||||
public static long getAddress(ShortBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(ShortBuffer buffer, int position) { return getAddress0(buffer) + (position << 1); }
|
||||
|
||||
public static long getAddress(CharBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(CharBuffer buffer, int position) { return getAddress0(buffer) + (position << 1); }
|
||||
|
||||
public static long getAddress(IntBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(IntBuffer buffer, int position) { return getAddress0(buffer) + (position << 2); }
|
||||
|
||||
public static long getAddress(FloatBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(FloatBuffer buffer, int position) { return getAddress0(buffer) + (position << 2); }
|
||||
|
||||
public static long getAddress(LongBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(LongBuffer buffer, int position) { return getAddress0(buffer) + (position << 3); }
|
||||
|
||||
public static long getAddress(DoubleBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(DoubleBuffer buffer, int position) { return getAddress0(buffer) + (position << 3); }
|
||||
|
||||
public static long getAddress(PointerBuffer buffer) { return getAddress(buffer, buffer.position()); }
|
||||
|
||||
public static long getAddress(PointerBuffer buffer, int position) { return getAddress0(buffer) + (position * PointerBuffer.getPointerSize()); }
|
||||
|
||||
// --- [ API utilities - Safe ] ---
|
||||
|
||||
public static long getAddressSafe(ByteBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(ByteBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(ShortBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(ShortBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(CharBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(CharBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(IntBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(IntBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(FloatBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(FloatBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(LongBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(LongBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(DoubleBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(DoubleBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
public static long getAddressSafe(PointerBuffer buffer) { return buffer == null ? 0L : getAddress(buffer); }
|
||||
|
||||
public static long getAddressSafe(PointerBuffer buffer, int position) { return buffer == null ? 0L : getAddress(buffer, position); }
|
||||
|
||||
interface Accessor {
|
||||
|
||||
long getAddress(Buffer buffer);
|
||||
|
||||
}
|
||||
|
||||
private static Accessor loadAccessor(final String className) throws Exception {
|
||||
return (Accessor)Class.forName(className).newInstance();
|
||||
}
|
||||
|
||||
/** Default implementation. */
|
||||
private static class AccessorJNI implements Accessor {
|
||||
|
||||
public long getAddress(final Buffer buffer) {
|
||||
return BufferUtils.getBufferAddress(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Implementation using reflection on ByteBuffer. */
|
||||
private static class AccessorReflect implements Accessor {
|
||||
|
||||
private final Field address;
|
||||
|
||||
AccessorReflect() {
|
||||
try {
|
||||
address = getAddressField();
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
address.setAccessible(true);
|
||||
}
|
||||
|
||||
public long getAddress(final Buffer buffer) {
|
||||
try {
|
||||
return address.getLong(buffer);
|
||||
} catch (IllegalAccessException e) {
|
||||
// cannot happen
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static Field getAddressField() throws NoSuchFieldException {
|
||||
return getDeclaredFieldRecursive(ByteBuffer.class, "address");
|
||||
}
|
||||
|
||||
private static Field getDeclaredFieldRecursive(Class<?> type, final String fieldName) throws NoSuchFieldException {
|
||||
while ( type != null ) {
|
||||
try {
|
||||
return type.getDeclaredField(fieldName);
|
||||
} catch (NoSuchFieldException e) {
|
||||
type = type.getSuperclass();
|
||||
}
|
||||
}
|
||||
|
||||
throw new NoSuchFieldException(fieldName + " does not exist in " + type.getSimpleName() + " or any of its superclasses.");
|
||||
}
|
||||
|
||||
}
|
||||
135
src/java/org/lwjgl/MemoryUtilSun.java
Normal file
135
src/java/org/lwjgl/MemoryUtilSun.java
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.Buffer;
|
||||
|
||||
import sun.misc.Unsafe;
|
||||
import sun.reflect.FieldAccessor;
|
||||
|
||||
/**
|
||||
* MemoryUtil.Accessor implementations that depend on sun.misc.
|
||||
* We use reflection to grab these, so that we can compile on JDKs
|
||||
* that do not support sun.misc.
|
||||
*
|
||||
* @author Spasi
|
||||
*/
|
||||
final class MemoryUtilSun {
|
||||
|
||||
private MemoryUtilSun() {
|
||||
}
|
||||
|
||||
/** Implementation using sun.misc.Unsafe. */
|
||||
private static class AccessorUnsafe implements MemoryUtil.Accessor {
|
||||
|
||||
private final Unsafe unsafe;
|
||||
private final long address;
|
||||
|
||||
AccessorUnsafe() {
|
||||
try {
|
||||
unsafe = getUnsafeInstance();
|
||||
address = unsafe.objectFieldOffset(MemoryUtil.getAddressField());
|
||||
} catch (Exception e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public long getAddress(final Buffer buffer) {
|
||||
return unsafe.getLong(buffer, address);
|
||||
}
|
||||
|
||||
private static Unsafe getUnsafeInstance() {
|
||||
final Field[] fields = Unsafe.class.getDeclaredFields();
|
||||
|
||||
/*
|
||||
Different runtimes use different names for the Unsafe singleton,
|
||||
so we cannot use .getDeclaredField and we scan instead. For example:
|
||||
|
||||
Oracle: theUnsafe
|
||||
PERC : m_unsafe_instance
|
||||
Android: THE_ONE
|
||||
*/
|
||||
for ( Field field : fields ) {
|
||||
if ( !field.getType().equals(Unsafe.class) )
|
||||
continue;
|
||||
|
||||
final int modifiers = field.getModifiers();
|
||||
if ( !(Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) )
|
||||
continue;
|
||||
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
return (Unsafe)field.get(null);
|
||||
} catch (IllegalAccessException e) {
|
||||
// ignore
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Implementation using reflection on ByteBuffer, FieldAccessor is used directly. */
|
||||
private static class AccessorReflectFast implements MemoryUtil.Accessor {
|
||||
|
||||
private final FieldAccessor addressAccessor;
|
||||
|
||||
AccessorReflectFast() {
|
||||
Field address;
|
||||
try {
|
||||
address = MemoryUtil.getAddressField();
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
address.setAccessible(true);
|
||||
|
||||
try {
|
||||
Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
|
||||
m.setAccessible(true);
|
||||
addressAccessor = (FieldAccessor)m.invoke(address, true);
|
||||
} catch (Exception e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public long getAddress(final Buffer buffer) {
|
||||
return addressAccessor.getLong(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ public class PointerBuffer implements Comparable {
|
|||
throw new IllegalArgumentException("The source buffer is not direct.");
|
||||
|
||||
final int alignment = is64Bit ? 8 : 4;
|
||||
if ( (BufferUtils.getBufferAddress(source) + source.position()) % alignment != 0 || source.remaining() % alignment != 0 )
|
||||
if ( (MemoryUtil.getAddress0(source) + source.position()) % alignment != 0 || source.remaining() % alignment != 0 )
|
||||
throw new IllegalArgumentException("The source buffer is not aligned to " + alignment + " bytes.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@
|
|||
*/
|
||||
package org.lwjgl.opencl;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.PointerBuffer;
|
||||
import org.lwjgl.*;
|
||||
import org.lwjgl.opencl.FastLongMap.Entry;
|
||||
|
||||
import java.nio.*;
|
||||
|
|
@ -53,7 +51,7 @@ import static org.lwjgl.opencl.KHRGLSharing.*;
|
|||
*/
|
||||
final class APIUtil {
|
||||
|
||||
private static final int INITIAL_BUFFER_SIZE = 256;
|
||||
private static final int INITIAL_BUFFER_SIZE = 256;
|
||||
private static final int INITIAL_LENGTHS_SIZE = 4;
|
||||
|
||||
private static final int BUFFERS_SIZE = 32;
|
||||
|
|
@ -223,10 +221,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string) {
|
||||
static long getBuffer(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,10 +234,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string, final int offset) {
|
||||
static long getBuffer(final CharSequence string, final int offset) {
|
||||
final ByteBuffer buffer = encode(getBufferByteOffset(offset + string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -249,11 +247,11 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence string) {
|
||||
static long getBufferNT(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length() + 1), string);
|
||||
buffer.put((byte)0);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
static int getTotalLength(final CharSequence[] strings) {
|
||||
|
|
@ -271,14 +269,14 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence[] strings) {
|
||||
static long getBuffer(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings));
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
encode(buffer, string);
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -288,7 +286,7 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence[] strings) {
|
||||
static long getBufferNT(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings) + strings.length);
|
||||
|
||||
for ( CharSequence string : strings ) {
|
||||
|
|
@ -297,7 +295,7 @@ final class APIUtil {
|
|||
}
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -307,14 +305,14 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String lengths in a PointerBuffer
|
||||
*/
|
||||
static PointerBuffer getLengths(final CharSequence[] strings) {
|
||||
static long getLengths(final CharSequence[] strings) {
|
||||
PointerBuffer buffer = getLengths(strings.length);
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
buffer.put(string.length());
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -324,14 +322,14 @@ final class APIUtil {
|
|||
*
|
||||
* @return the buffer lengths in a PointerBuffer
|
||||
*/
|
||||
static PointerBuffer getLengths(final ByteBuffer[] buffers) {
|
||||
static long getLengths(final ByteBuffer[] buffers) {
|
||||
PointerBuffer lengths = getLengths(buffers.length);
|
||||
|
||||
for ( ByteBuffer buffer : buffers )
|
||||
lengths.put(buffer.remaining());
|
||||
|
||||
lengths.flip();
|
||||
return lengths;
|
||||
return MemoryUtil.getAddress0(lengths);
|
||||
}
|
||||
|
||||
static int getSize(final PointerBuffer lengths) {
|
||||
|
|
@ -342,14 +340,22 @@ final class APIUtil {
|
|||
return (int)size;
|
||||
}
|
||||
|
||||
static long getPointer(final PointerWrapper pointer) {
|
||||
return MemoryUtil.getAddress0(getBufferPointer().put(0, pointer));
|
||||
}
|
||||
|
||||
static long getPointerSafe(final PointerWrapper pointer) {
|
||||
return MemoryUtil.getAddress0(getBufferPointer().put(0, pointer == null ? 0L : pointer.getPointer()));
|
||||
}
|
||||
|
||||
private static class Buffers {
|
||||
|
||||
final ShortBuffer shorts;
|
||||
final IntBuffer ints;
|
||||
final IntBuffer intsDebug;
|
||||
final LongBuffer longs;
|
||||
final IntBuffer ints;
|
||||
final IntBuffer intsDebug;
|
||||
final LongBuffer longs;
|
||||
|
||||
final FloatBuffer floats;
|
||||
final FloatBuffer floats;
|
||||
final DoubleBuffer doubles;
|
||||
|
||||
final PointerBuffer pointers;
|
||||
|
|
@ -513,25 +519,25 @@ final class APIUtil {
|
|||
}
|
||||
}
|
||||
|
||||
private static final ObjectDestructor<CLDevice> DESTRUCTOR_CLSubDevice = new ObjectDestructor<CLDevice>() {
|
||||
private static final ObjectDestructor<CLDevice> DESTRUCTOR_CLSubDevice = new ObjectDestructor<CLDevice>() {
|
||||
public void release(final CLDevice object) { clReleaseDeviceEXT(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLMem> DESTRUCTOR_CLMem = new ObjectDestructor<CLMem>() {
|
||||
private static final ObjectDestructor<CLMem> DESTRUCTOR_CLMem = new ObjectDestructor<CLMem>() {
|
||||
public void release(final CLMem object) { clReleaseMemObject(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLCommandQueue> DESTRUCTOR_CLCommandQueue = new ObjectDestructor<CLCommandQueue>() {
|
||||
public void release(final CLCommandQueue object) { clReleaseCommandQueue(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLSampler> DESTRUCTOR_CLSampler = new ObjectDestructor<CLSampler>() {
|
||||
private static final ObjectDestructor<CLSampler> DESTRUCTOR_CLSampler = new ObjectDestructor<CLSampler>() {
|
||||
public void release(final CLSampler object) { clReleaseSampler(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLProgram> DESTRUCTOR_CLProgram = new ObjectDestructor<CLProgram>() {
|
||||
private static final ObjectDestructor<CLProgram> DESTRUCTOR_CLProgram = new ObjectDestructor<CLProgram>() {
|
||||
public void release(final CLProgram object) { clReleaseProgram(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLKernel> DESTRUCTOR_CLKernel = new ObjectDestructor<CLKernel>() {
|
||||
private static final ObjectDestructor<CLKernel> DESTRUCTOR_CLKernel = new ObjectDestructor<CLKernel>() {
|
||||
public void release(final CLKernel object) { clReleaseKernel(object); }
|
||||
};
|
||||
private static final ObjectDestructor<CLEvent> DESTRUCTOR_CLEvent = new ObjectDestructor<CLEvent>() {
|
||||
private static final ObjectDestructor<CLEvent> DESTRUCTOR_CLEvent = new ObjectDestructor<CLEvent>() {
|
||||
public void release(final CLEvent object) { clReleaseEvent(object); }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ final class InfoUtilFactory {
|
|||
final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
|
||||
CLContext __result = null;
|
||||
try {
|
||||
__result = new CLContext(nclCreateContext(properties.getBuffer(), 0, devices.size(), properties.getBuffer(), propertyCount, pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), platform);
|
||||
__result = new CLContext(nclCreateContext(MemoryUtil.getAddress0(properties.getBuffer()), devices.size(), MemoryUtil.getAddress(properties, propertyCount), pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, MemoryUtil.getAddressSafe(errcode_ret), function_pointer), platform);
|
||||
if ( LWJGLUtil.DEBUG )
|
||||
Util.checkCLError(errcode_ret.get(0));
|
||||
return __result;
|
||||
|
|
@ -304,9 +304,9 @@ final class InfoUtilFactory {
|
|||
else if ( LWJGLUtil.DEBUG )
|
||||
errcode_ret = APIUtil.getBufferInt();
|
||||
|
||||
CLMem __result = new CLMem(nclCreateImage2D(context.getPointer(), flags, formatBuffer, 0, image_width, image_height, image_row_pitch, host_ptr,
|
||||
host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0,
|
||||
errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), context);
|
||||
CLMem __result = new CLMem(nclCreateImage2D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_row_pitch, MemoryUtil.getAddress0Safe(host_ptr) +
|
||||
(host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0),
|
||||
MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context);
|
||||
if ( LWJGLUtil.DEBUG )
|
||||
Util.checkCLError(errcode_ret.get(0));
|
||||
return __result;
|
||||
|
|
@ -324,9 +324,9 @@ final class InfoUtilFactory {
|
|||
else if ( LWJGLUtil.DEBUG )
|
||||
errcode_ret = APIUtil.getBufferInt();
|
||||
|
||||
CLMem __result = new CLMem(nclCreateImage3D(context.getPointer(), flags, formatBuffer, 0, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr,
|
||||
host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0,
|
||||
errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), context);
|
||||
CLMem __result = new CLMem(nclCreateImage3D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, MemoryUtil.getAddress0Safe(host_ptr) +
|
||||
(host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0),
|
||||
MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context);
|
||||
if ( LWJGLUtil.DEBUG )
|
||||
Util.checkCLError(errcode_ret.get(0));
|
||||
return __result;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ package org.lwjgl.opengl;
|
|||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.MemoryUtil;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
|
|
@ -185,10 +186,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string) {
|
||||
static long getBuffer(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -198,10 +199,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string, final int offset) {
|
||||
static long getBuffer(final CharSequence string, final int offset) {
|
||||
final ByteBuffer buffer = encode(getBufferByteOffset(offset + string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -211,11 +212,11 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence string) {
|
||||
static long getBufferNT(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length() + 1), string);
|
||||
buffer.put((byte)0);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
static int getTotalLength(final CharSequence[] strings) {
|
||||
|
|
@ -233,14 +234,14 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence[] strings) {
|
||||
static long getBuffer(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings));
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
encode(buffer, string);
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -250,7 +251,7 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence[] strings) {
|
||||
static long getBufferNT(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings) + strings.length);
|
||||
|
||||
for ( CharSequence string : strings ) {
|
||||
|
|
@ -259,7 +260,7 @@ final class APIUtil {
|
|||
}
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -269,14 +270,22 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String lengths in an IntBuffer
|
||||
*/
|
||||
static IntBuffer getLengths(final CharSequence[] strings) {
|
||||
static long getLengths(final CharSequence[] strings) {
|
||||
IntBuffer buffer = getLengths(strings.length);
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
buffer.put(string.length());
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
static long getInt(final int value) {
|
||||
return MemoryUtil.getAddress0(getBufferInt().put(0, value));
|
||||
}
|
||||
|
||||
static long getBufferByte0() {
|
||||
return MemoryUtil.getAddress0(getBufferByte(0));
|
||||
}
|
||||
|
||||
private static class Buffers {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ package org.lwjgl.opengles;
|
|||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.MemoryUtil;
|
||||
import org.lwjgl.PointerBuffer;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
@ -207,10 +208,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string) {
|
||||
static long getBuffer(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -220,10 +221,10 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence string, final int offset) {
|
||||
static long getBuffer(final CharSequence string, final int offset) {
|
||||
final ByteBuffer buffer = encode(getBufferByteOffset(offset + string.length()), string);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -233,11 +234,11 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence string) {
|
||||
static long getBufferNT(final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(string.length() + 1), string);
|
||||
buffer.put((byte)0);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
static int getTotalLength(final CharSequence[] strings) {
|
||||
|
|
@ -255,14 +256,14 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBuffer(final CharSequence[] strings) {
|
||||
static long getBuffer(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings));
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
encode(buffer, string);
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -272,7 +273,7 @@ final class APIUtil {
|
|||
*
|
||||
* @return the Strings as a ByteBuffer
|
||||
*/
|
||||
static ByteBuffer getBufferNT(final CharSequence[] strings) {
|
||||
static long getBufferNT(final CharSequence[] strings) {
|
||||
final ByteBuffer buffer = getBufferByte(getTotalLength(strings) + strings.length);
|
||||
|
||||
for ( CharSequence string : strings ) {
|
||||
|
|
@ -281,7 +282,7 @@ final class APIUtil {
|
|||
}
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -291,14 +292,22 @@ final class APIUtil {
|
|||
*
|
||||
* @return the String lengths in an IntBuffer
|
||||
*/
|
||||
static IntBuffer getLengths(final CharSequence[] strings) {
|
||||
static long getLengths(final CharSequence[] strings) {
|
||||
IntBuffer buffer = getLengths(strings.length);
|
||||
|
||||
for ( CharSequence string : strings )
|
||||
buffer.put(string.length());
|
||||
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
static long getInt(final int value) {
|
||||
return MemoryUtil.getAddress(getBufferInt().put(0, value), 0);
|
||||
}
|
||||
|
||||
static long getBufferByte0() {
|
||||
return MemoryUtil.getAddress0(getBufferByte(0));
|
||||
}
|
||||
|
||||
private static class Buffers {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@ public class MappedObjectTests3 {
|
|||
set.view = 0;
|
||||
assert (vec2.view == 0);
|
||||
assert (vec3.view == 0);
|
||||
|
||||
set.next();
|
||||
assert (vec2.view == 1);
|
||||
assert (vec3.view == 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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.test.opengl.sprites;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
|
@ -33,8 +64,8 @@ import static org.lwjgl.opengl.GL30.*;
|
|||
*/
|
||||
public final class SpriteShootout {
|
||||
|
||||
private static final int SCREEN_WIDTH = 800;
|
||||
private static final int SCREEN_HEIGHT = 600;
|
||||
static final int SCREEN_WIDTH = 800;
|
||||
static final int SCREEN_HEIGHT = 600;
|
||||
|
||||
private static final int ANIMATION_TICKS = 60;
|
||||
|
||||
|
|
@ -45,8 +76,8 @@ public final class SpriteShootout {
|
|||
private boolean smooth;
|
||||
private boolean vsync;
|
||||
|
||||
private int ballSize = 42;
|
||||
private int ballCount = 100 * 1000;
|
||||
int ballSize = 42;
|
||||
int ballCount = 100 * 1000;
|
||||
|
||||
private SpriteRenderer renderer;
|
||||
|
||||
|
|
@ -401,43 +432,45 @@ public final class SpriteShootout {
|
|||
transform = newTransform;
|
||||
}
|
||||
|
||||
protected void animate(final FloatBuffer geom, final int ballIndex, final int batchSize, final int delta) {
|
||||
final float[] transform = this.transform;
|
||||
|
||||
protected void animate(
|
||||
final float[] sprites,
|
||||
final FloatBuffer spritesRender,
|
||||
final int ballSize, final int ballIndex, final int batchSize, final int delta
|
||||
) {
|
||||
final float ballRadius = ballSize * 0.5f;
|
||||
final float boundW = SCREEN_WIDTH - ballRadius;
|
||||
final float boundH = SCREEN_HEIGHT - ballRadius;
|
||||
|
||||
for ( int b = ballIndex * 4, len = (ballIndex + batchSize) * 4; b < len; b += 4 ) {
|
||||
float x = transform[b + 0];
|
||||
float dx = transform[b + 2];
|
||||
float x = sprites[b + 0];
|
||||
float dx = sprites[b + 2];
|
||||
|
||||
x += dx * delta;
|
||||
if ( x < ballRadius ) {
|
||||
x = ballRadius;
|
||||
transform[b + 2] = -dx;
|
||||
sprites[b + 2] = -dx;
|
||||
} else if ( x > boundW ) {
|
||||
x = boundW;
|
||||
transform[b + 2] = -dx;
|
||||
sprites[b + 2] = -dx;
|
||||
}
|
||||
transform[b + 0] = x;
|
||||
sprites[b + 0] = x;
|
||||
|
||||
float y = transform[b + 1];
|
||||
float dy = transform[b + 3];
|
||||
float y = sprites[b + 1];
|
||||
float dy = sprites[b + 3];
|
||||
|
||||
y += dy * delta;
|
||||
if ( y < ballRadius ) {
|
||||
y = ballRadius;
|
||||
transform[b + 3] = -dy;
|
||||
sprites[b + 3] = -dy;
|
||||
} else if ( y > boundH ) {
|
||||
y = boundH;
|
||||
transform[b + 3] = -dy;
|
||||
sprites[b + 3] = -dy;
|
||||
}
|
||||
transform[b + 1] = y;
|
||||
sprites[b + 1] = y;
|
||||
|
||||
geom.put(x).put(y);
|
||||
spritesRender.put(x).put(y);
|
||||
}
|
||||
geom.clear();
|
||||
spritesRender.clear();
|
||||
}
|
||||
|
||||
protected abstract void render(boolean render, boolean animate, int delta);
|
||||
|
|
@ -517,8 +550,9 @@ public final class SpriteShootout {
|
|||
}
|
||||
|
||||
private void animate(final int ballIndex, final int batchSize, final int delta) {
|
||||
animate(geom, ballIndex, batchSize, delta);
|
||||
animate(transform, geom, ballSize, ballIndex, batchSize, delta);
|
||||
|
||||
// Orphan current buffer and allocate a new one
|
||||
glBufferData(GL_ARRAY_BUFFER, geom.capacity() * 4, GL_STREAM_DRAW);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, geom);
|
||||
}
|
||||
|
|
@ -526,10 +560,7 @@ public final class SpriteShootout {
|
|||
|
||||
private class SpriteRendererMapped extends SpriteRendererBatched {
|
||||
|
||||
private ByteBuffer[] mapBuffer;
|
||||
private FloatBuffer[] geomBuffer;
|
||||
|
||||
protected int animVBO;
|
||||
private StreamVBO animVBO;
|
||||
|
||||
SpriteRendererMapped() {
|
||||
System.out.println("Shootout Implementation: CPU animation & MapBufferRange");
|
||||
|
|
@ -538,41 +569,29 @@ public final class SpriteShootout {
|
|||
public void updateBalls(final int count) {
|
||||
super.updateBalls(count);
|
||||
|
||||
final int batchCount = count / BALLS_PER_BATCH + (count % BALLS_PER_BATCH == 0 ? 0 : 1);
|
||||
mapBuffer = new ByteBuffer[batchCount];
|
||||
geomBuffer = new FloatBuffer[batchCount];
|
||||
if ( animVBO != null )
|
||||
animVBO.destroy();
|
||||
|
||||
animVBO = glGenBuffers();
|
||||
glBindBuffer(GL_ARRAY_BUFFER, animVBO);
|
||||
glBufferData(GL_ARRAY_BUFFER, ballCount * (2 * 4), GL_DYNAMIC_DRAW);
|
||||
glVertexPointer(2, GL_FLOAT, 0, 0);
|
||||
animVBO = new StreamVBO(GL_ARRAY_BUFFER, ballCount * (2 * 4));
|
||||
}
|
||||
|
||||
public void render(final boolean render, final boolean animate, final int delta) {
|
||||
int batchSize = Math.min(ballCount, BALLS_PER_BATCH);
|
||||
int ballIndex = 0;
|
||||
int batchIndex = 0;
|
||||
while ( ballIndex < ballCount ) {
|
||||
if ( animate ) {
|
||||
final ByteBuffer buffer = glMapBufferRange(GL_ARRAY_BUFFER,
|
||||
ballIndex * (2 * 4),
|
||||
batchSize * (2 * 4),
|
||||
GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT,
|
||||
mapBuffer[batchIndex]);
|
||||
if ( buffer != mapBuffer[batchIndex] ) {
|
||||
mapBuffer[batchIndex] = buffer;
|
||||
geomBuffer[batchIndex] = mapBuffer[batchIndex].asFloatBuffer();
|
||||
}
|
||||
final ByteBuffer buffer = animVBO.map(batchSize * (2 * 4));
|
||||
|
||||
animate(geomBuffer[batchIndex], ballIndex, batchSize, delta);
|
||||
animate(transform, buffer.asFloatBuffer(), ballSize, ballIndex, batchSize, delta);
|
||||
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
animVBO.unmap();
|
||||
}
|
||||
|
||||
if ( render )
|
||||
glDrawArrays(GL_POINTS, ballIndex, batchSize);
|
||||
if ( render ) {
|
||||
glVertexPointer(2, GL_FLOAT, 0, ballIndex * (2 * 4));
|
||||
glDrawArrays(GL_POINTS, 0, batchSize);
|
||||
}
|
||||
|
||||
batchIndex++;
|
||||
ballIndex += batchSize;
|
||||
batchSize = Math.min(ballCount - ballIndex, BALLS_PER_BATCH);
|
||||
}
|
||||
|
|
@ -653,6 +672,13 @@ public final class SpriteShootout {
|
|||
}
|
||||
|
||||
public void updateBalls(final int count) {
|
||||
if ( tfVBO[0] != 0 ) {
|
||||
// Fetch current animation state
|
||||
final FloatBuffer state = BufferUtils.createFloatBuffer(transform.length);
|
||||
glGetBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, 0, state);
|
||||
state.get(transform);
|
||||
}
|
||||
|
||||
super.updateBalls(count);
|
||||
|
||||
if ( tfVBO[0] != 0 ) {
|
||||
|
|
@ -660,14 +686,14 @@ public final class SpriteShootout {
|
|||
glDeleteBuffers(tfVBO[i]);
|
||||
}
|
||||
|
||||
final FloatBuffer transform = BufferUtils.createFloatBuffer(count * 4);
|
||||
transform.put(this.transform);
|
||||
transform.flip();
|
||||
final FloatBuffer state = BufferUtils.createFloatBuffer(count * 4);
|
||||
state.put(transform);
|
||||
state.flip();
|
||||
|
||||
for ( int i = 0; i < tfVBO.length; i++ ) {
|
||||
tfVBO[i] = glGenBuffers();
|
||||
glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, tfVBO[i]);
|
||||
glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, transform, GL_STATIC_DRAW);
|
||||
glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, state, GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, tfVBO[0]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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.test.opengl.sprites;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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.test.opengl.sprites;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
|
|
|||
144
src/java/org/lwjgl/test/opengl/sprites/StreamVBO.java
Normal file
144
src/java/org/lwjgl/test/opengl/sprites/StreamVBO.java
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 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.test.opengl.sprites;
|
||||
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static java.lang.Math.*;
|
||||
import static org.lwjgl.opengl.GL15.*;
|
||||
import static org.lwjgl.opengl.GL30.*;
|
||||
|
||||
/**
|
||||
* This class implements VBO orphaning, useful for streaming
|
||||
* dynamically generated geometry to the GPU. OpenGL 3.0 or
|
||||
* higher is required. See
|
||||
* {@url http://www.opengl.org/wiki/Buffer_Object_Streaming}
|
||||
* under "Buffer update" for details.
|
||||
*
|
||||
* @author Spasi
|
||||
*/
|
||||
public class StreamVBO {
|
||||
|
||||
private final int target;
|
||||
private final long size;
|
||||
private final int padding;
|
||||
|
||||
private int ID;
|
||||
|
||||
private long cursor;
|
||||
|
||||
public StreamVBO(final int target, final int size) {
|
||||
this(target, size, 64);
|
||||
}
|
||||
|
||||
public StreamVBO(final int target, final int size, final int padding) {
|
||||
this.target = target;
|
||||
this.padding = padding;
|
||||
this.size = max(pad(size), padding);
|
||||
|
||||
ID = glGenBuffers();
|
||||
|
||||
glBindBuffer(target, ID);
|
||||
glBufferData(target, this.size, GL_STREAM_DRAW);
|
||||
}
|
||||
|
||||
public int getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public int getPadding() {
|
||||
return padding;
|
||||
}
|
||||
|
||||
public void bind() {
|
||||
glBindBuffer(target, ID);
|
||||
}
|
||||
|
||||
public void init(final int offset, final ByteBuffer data) {
|
||||
glBufferSubData(target, offset, data);
|
||||
}
|
||||
|
||||
public void unmap() {
|
||||
glUnmapBuffer(target);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
glBindBuffer(target, 0);
|
||||
glDeleteBuffers(ID);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
// Orphan current buffer and allocate a new one
|
||||
glBufferData(target, size, GL_STREAM_DRAW);
|
||||
// Flush
|
||||
cursor = 0;
|
||||
}
|
||||
|
||||
public ByteBuffer map(final int bytes) {
|
||||
return map(bytes, null);
|
||||
}
|
||||
|
||||
public ByteBuffer map(final int bytes, final ByteBuffer old_buffer) {
|
||||
return doMap(pad(bytes), old_buffer);
|
||||
}
|
||||
|
||||
private int pad(int size) {
|
||||
final int mod = size % padding;
|
||||
if ( mod == 0 )
|
||||
return size;
|
||||
|
||||
return size + padding - mod;
|
||||
}
|
||||
|
||||
private ByteBuffer doMap(final int bytes, final ByteBuffer old_buffer) {
|
||||
if ( LWJGLUtil.CHECKS && size < bytes )
|
||||
throw new IllegalArgumentException(Integer.toString(bytes));
|
||||
|
||||
if ( size < cursor + bytes )
|
||||
reset();
|
||||
|
||||
final ByteBuffer map = glMapBufferRange(target, cursor, bytes, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT, old_buffer);
|
||||
cursor += bytes;
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
|
||||
package org.lwjgl.util.generator;
|
||||
|
||||
import org.lwjgl.PointerBuffer;
|
||||
|
||||
import java.nio.Buffer;
|
||||
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
|
|
@ -45,12 +49,19 @@ import com.sun.mirror.util.*;
|
|||
* $Id$
|
||||
*/
|
||||
public class JNITypeTranslator implements TypeVisitor {
|
||||
|
||||
private final StringBuilder signature = new StringBuilder();
|
||||
|
||||
private boolean objectReturn;
|
||||
|
||||
public String getSignature() {
|
||||
return signature.toString();
|
||||
}
|
||||
|
||||
public String getReturnSignature() {
|
||||
return objectReturn ? "jobject" : signature.toString();
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
|
@ -68,7 +79,12 @@ public class JNITypeTranslator implements TypeVisitor {
|
|||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
signature.append("jobject");
|
||||
final Class<?> type = Utils.getJavaType(t);
|
||||
if ( Buffer.class.isAssignableFrom(type) || PointerBuffer.class.isAssignableFrom(type) ) {
|
||||
signature.append("jlong");
|
||||
objectReturn = true;
|
||||
} else
|
||||
signature.append("jobject");
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
|
|
|
|||
|
|
@ -194,8 +194,8 @@ public class JavaMethodsGenerator {
|
|||
writer.print("long ");
|
||||
else {
|
||||
Class type = type_info.getType();
|
||||
if ( native_stub && (type == CharSequence.class || type == CharSequence[].class || type == PointerBuffer.class) )
|
||||
writer.print("ByteBuffer ");
|
||||
if ( native_stub && (type == CharSequence.class || type == CharSequence[].class || type == PointerBuffer.class || Buffer.class.isAssignableFrom(type) ) )
|
||||
writer.print("long ");
|
||||
else if ( printTypes )
|
||||
writer.print(type_info.getType().getSimpleName() + " ");
|
||||
}
|
||||
|
|
@ -203,8 +203,6 @@ public class JavaMethodsGenerator {
|
|||
if ( auto_size_annotation != null )
|
||||
writer.print(auto_size_annotation.value() + "_");
|
||||
writer.print(param.getSimpleName());
|
||||
if ( native_stub && buffer_type != null )
|
||||
writer.print(", int " + param.getSimpleName() + NativeMethodStubsGenerator.BUFFER_POSITION_POSTFIX);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -490,7 +488,7 @@ public class JavaMethodsGenerator {
|
|||
Check check_annotation = param.getAnnotation(Check.class);
|
||||
boolean hide_buffer = mode == Mode.AUTOS && getAutoTypeParameter(method, param) != null;
|
||||
if (hide_buffer) {
|
||||
writer.print("null");
|
||||
writer.print("0L");
|
||||
} else {
|
||||
if ( type == CharSequence.class || type == CharSequence[].class ) {
|
||||
final String offset = Utils.getStringOffset(method, param);
|
||||
|
|
@ -502,48 +500,25 @@ public class JavaMethodsGenerator {
|
|||
if ( offset != null )
|
||||
writer.print(", " + offset);
|
||||
writer.print(")");
|
||||
hide_buffer = true;
|
||||
} else {
|
||||
final AutoSize auto_size_annotation = param.getAnnotation(AutoSize.class);
|
||||
if ( auto_size_annotation != null )
|
||||
writer.print(auto_size_annotation.value() + "_");
|
||||
writer.print(param.getSimpleName());
|
||||
if ( PointerBuffer.class.isAssignableFrom(type) ) {
|
||||
|
||||
final Class buffer_type = Utils.getNIOBufferType(param.getType());
|
||||
if ( buffer_type == null )
|
||||
writer.print(param.getSimpleName());
|
||||
else {
|
||||
writer.print("MemoryUtil.getAddress");
|
||||
if ( check_annotation != null && check_annotation.canBeNull() )
|
||||
writer.print(" != null ? " + param.getSimpleName());
|
||||
writer.print(".getBuffer()");
|
||||
if ( check_annotation != null && check_annotation.canBeNull() )
|
||||
writer.print(" : null");
|
||||
writer.print("Safe");
|
||||
writer.print("(");
|
||||
writer.print(param.getSimpleName());
|
||||
writer.print(")");
|
||||
}
|
||||
}
|
||||
}
|
||||
Class buffer_type = Utils.getNIOBufferType(param.getType());
|
||||
if (buffer_type != null) {
|
||||
writer.print(", ");
|
||||
if (!hide_buffer) {
|
||||
int shifting;
|
||||
if (Utils.getNIOBufferType(param.getType()).equals(Buffer.class)) {
|
||||
shifting = getBufferElementSizeExponent(type == Buffer.class ? ByteBuffer.class : type); // TODO: This will always throw an exception
|
||||
//shifting = 0;
|
||||
} else
|
||||
shifting = 0;
|
||||
writer.print(param.getSimpleName());
|
||||
if (check_annotation != null && check_annotation.canBeNull())
|
||||
writer.print(" != null ? " + param.getSimpleName());
|
||||
if ( type == PointerBuffer.class && param.getAnnotation(NativeType.class).value().endsWith("void") )
|
||||
writer.print(".positionByte()");
|
||||
else
|
||||
writer.print(".position()");
|
||||
if (shifting > 0)
|
||||
writer.print(" << " + shifting);
|
||||
if (check_annotation != null && check_annotation.canBeNull())
|
||||
writer.print(" : 0");
|
||||
} else if ( type == CharSequence.class || type == CharSequence[].class ) {
|
||||
final String offset = Utils.getStringOffset(method, param);
|
||||
writer.print(offset == null ? "0" : offset);
|
||||
} else
|
||||
writer.print("0");
|
||||
} else if ( type != long.class ) {
|
||||
if ( type != long.class ) {
|
||||
PointerWrapper pointer_annotation = param.getAnnotation(PointerWrapper.class);
|
||||
if ( pointer_annotation != null ) {
|
||||
if ( pointer_annotation.canBeNull() )
|
||||
|
|
|
|||
|
|
@ -88,8 +88,6 @@ public class NativeMethodStubsGenerator {
|
|||
JNITypeTranslator translator = new JNITypeTranslator();
|
||||
param.getType().accept(translator);
|
||||
writer.print(translator.getSignature() + " " + param.getSimpleName());
|
||||
if (Utils.getNIOBufferType(param.getType()) != null)
|
||||
writer.print(", jint " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +106,7 @@ public class NativeMethodStubsGenerator {
|
|||
} else {
|
||||
JNITypeTranslator translator = new JNITypeTranslator();
|
||||
result_type.accept(translator);
|
||||
writer.print(translator.getSignature());
|
||||
writer.print(translator.getReturnSignature());
|
||||
}
|
||||
writer.print(" JNICALL ");
|
||||
|
||||
|
|
@ -298,30 +296,17 @@ public class NativeMethodStubsGenerator {
|
|||
|
||||
if ( !java_type.isArray() || CharSequence.class.isAssignableFrom(java_type.getComponentType()) ) {
|
||||
writer.print("\t" + native_type + param.getSimpleName());
|
||||
writer.print(BUFFER_ADDRESS_POSTFIX + " = ((");
|
||||
writer.print(BUFFER_ADDRESS_POSTFIX + " = (");
|
||||
writer.print(native_type);
|
||||
writer.print(")");
|
||||
|
||||
if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
|
||||
writer.print("offsetToPointer(" + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX + "))");
|
||||
writer.print("offsetToPointer(" + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX + ")");
|
||||
} else {
|
||||
if (Buffer.class.isAssignableFrom(java_type) || java_type.equals(CharSequence.class) || java_type.equals(CharSequence[].class) || PointerBuffer.class.isAssignableFrom(java_type) ) {
|
||||
boolean explicitly_byte_sized = java_type.equals(Buffer.class) ||
|
||||
translator.getAnnotationType().equals(type_map.getVoidType()) ||
|
||||
(param.getAnnotation(NativeType.class) != null && param.getAnnotation(NativeType.class).value().endsWith("void"));
|
||||
if (explicitly_byte_sized)
|
||||
writer.print("(((char *)");
|
||||
if (method.getAnnotation(GenerateAutos.class) != null || (check_annotation != null && check_annotation.canBeNull())) {
|
||||
writer.print("safeGetBufferAddress(env, " + param.getSimpleName());
|
||||
} else {
|
||||
writer.print("(*env)->GetDirectBufferAddress(env, " + param.getSimpleName());
|
||||
}
|
||||
writer.print("))");
|
||||
writer.print(" + " + param.getSimpleName() + BUFFER_POSITION_POSTFIX);
|
||||
if (explicitly_byte_sized)
|
||||
writer.print("))");
|
||||
writer.print(param.getSimpleName());
|
||||
} else if (java_type.equals(String.class)) {
|
||||
writer.print("GetStringNativeChars(env, " + param.getSimpleName() + "))");
|
||||
writer.print("GetStringNativeChars(env, " + param.getSimpleName() + ")");
|
||||
} else if ( array_annotation == null )
|
||||
throw new RuntimeException("Illegal type " + java_type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ public interface CL10 {
|
|||
@PointerWrapper(value = "cl_context", params = "APIUtil.getCLPlatform(properties)")
|
||||
CLContext clCreateContext(@NullTerminated @Check("3") @Const @NativeType("cl_context_properties") PointerBuffer properties,
|
||||
@Constant("1") @cl_uint int num_devices,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, device).getBuffer(), 0", keepParam = true) CLDevice device,
|
||||
@Constant(value = "APIUtil.getPointer(device)", keepParam = true) CLDevice device,
|
||||
@PointerWrapper(value = "cl_create_context_callback", canBeNull = true) CLContextCallback pfn_notify,
|
||||
@Constant("user_data") @PointerWrapper("void *") long user_data,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret);
|
||||
|
|
@ -683,7 +683,7 @@ public interface CL10 {
|
|||
@Code(javaAfterNative = "\t\tif ( __result != null ) command_queue.registerCLEvent(event);")
|
||||
@Check(value = "errcode_ret", canBeNull = true)
|
||||
@cl_void
|
||||
@AutoSize(value = "extcl_CalculateImageSize(region_address, *image_row_pitch_address, image_slice_pitch == NULL ? 0 : *image_slice_pitch_address)", isNative = true)
|
||||
@AutoSize(value = "extcl_CalculateImageSize(region_address, *image_row_pitch_address, image_slice_pitch_address == NULL ? 0 : *image_slice_pitch_address)", isNative = true)
|
||||
ByteBuffer clEnqueueMapImage(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@PointerWrapper("cl_mem") CLMem image,
|
||||
@cl_bool int blocking_map,
|
||||
|
|
@ -776,7 +776,7 @@ public interface CL10 {
|
|||
CLProgram clCreateProgramWithSource3(@PointerWrapper("cl_context") CLContext context,
|
||||
@Constant("strings.length") @cl_uint int count,
|
||||
@Check("1") @PointerArray(value = "count") @Const @NativeType("cl_char") ByteBuffer[] strings,
|
||||
@Constant("APIUtil.getLengths(strings).getBuffer(), 0") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@Constant("APIUtil.getLengths(strings)") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret);
|
||||
|
||||
@Alternate("clCreateProgramWithSource")
|
||||
|
|
@ -794,7 +794,7 @@ public interface CL10 {
|
|||
CLProgram clCreateProgramWithSource4(@PointerWrapper("cl_context") CLContext context,
|
||||
@Constant("strings.length") @cl_uint int count,
|
||||
@Const @PointerArray(value = "count", lengths = "lengths") CharSequence[] strings,
|
||||
@Constant("APIUtil.getLengths(strings).getBuffer(), 0") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@Constant("APIUtil.getLengths(strings)") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret);
|
||||
|
||||
// ------[ clCreateProgramWithBinary ]------
|
||||
|
|
@ -826,7 +826,7 @@ public interface CL10 {
|
|||
CLProgram clCreateProgramWithBinary3(@PointerWrapper("cl_context") CLContext context,
|
||||
@Constant("binaries.length") @cl_uint int num_devices,
|
||||
@Check("binaries.length") @Const @NativeType("cl_device_id") PointerBuffer device_list,
|
||||
@Constant("APIUtil.getLengths(binaries).getBuffer(), 0") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@Constant("APIUtil.getLengths(binaries)") @Const @NativeType("size_t") PointerBuffer lengths,
|
||||
@Check("1") @PointerArray("num_devices") @Const @NativeType("cl_uchar") ByteBuffer[] binaries,
|
||||
@OutParameter @Check("binaries.length") @cl_int IntBuffer binary_status,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret);
|
||||
|
|
@ -884,7 +884,7 @@ public interface CL10 {
|
|||
@cl_int
|
||||
int clBuildProgram(@PointerWrapper("cl_program") CLProgram program,
|
||||
@Constant("1") @cl_uint int num_devices,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, device).getBuffer(), 0", keepParam = true) CLDevice device,
|
||||
@Constant(value = "APIUtil.getPointer(device)", keepParam = true) CLDevice device,
|
||||
@NullTerminated @Const CharSequence options,
|
||||
@PointerWrapper(value = "cl_build_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify,
|
||||
@Constant("user_data") @PointerWrapper("void *") long user_data);
|
||||
|
|
@ -995,7 +995,7 @@ public interface CL10 {
|
|||
@cl_uint int arg_index,
|
||||
@Constant("PointerBuffer.getPointerSize()") @size_t long arg_size,
|
||||
@Check(canBeNull = true) @Const
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, arg_value == null ? 0 : arg_value.getPointer()).getBuffer(), 0", keepParam = true) CLObject arg_value);
|
||||
@Constant(value = "APIUtil.getPointerSafe(arg_value)", keepParam = true) CLObject arg_value);
|
||||
|
||||
// This is used by CLKernelUtil. Assumes arg_value.position() == 0.
|
||||
|
||||
|
|
@ -1005,7 +1005,7 @@ public interface CL10 {
|
|||
int clSetKernelArg3(@PointerWrapper("cl_kernel") CLKernel kernel,
|
||||
@cl_uint int arg_index,
|
||||
@size_t long arg_size,
|
||||
@Constant(value = "arg_value, 0", keepParam = true) Buffer arg_value);
|
||||
@Constant(value = "MemoryUtil.getAddress0(arg_value)", keepParam = true) Buffer arg_value);
|
||||
|
||||
@cl_int
|
||||
int clGetKernelInfo(@PointerWrapper("cl_kernel") CLKernel kernel,
|
||||
|
|
@ -1078,7 +1078,7 @@ public interface CL10 {
|
|||
@cl_int
|
||||
int clEnqueueNativeKernel(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@PointerWrapper("cl_native_kernel_func") CLNativeKernel user_func,
|
||||
@Constant("args, 0") @cl_void ByteBuffer args,
|
||||
@Constant("MemoryUtil.getAddress0(args)") @cl_void ByteBuffer args,
|
||||
@AutoSize("args") @size_t long cb_args,
|
||||
@Constant("mem_list == null ? 0 : mem_list.length") @cl_uint int num_mem_objects,
|
||||
@Check(value = "1", canBeNull = true) @PointerArray("num_mem_objects") @Const @NativeType("cl_mem") CLMem[] mem_list,
|
||||
|
|
@ -1095,7 +1095,7 @@ public interface CL10 {
|
|||
@Alternate("clWaitForEvents")
|
||||
@cl_int
|
||||
int clWaitForEvents(@Constant("1") @cl_uint int num_events,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, event).getBuffer(), 0", keepParam = true) CLEvent event);
|
||||
@Constant(value = "APIUtil.getPointer(event)", keepParam = true) CLEvent event);
|
||||
|
||||
@cl_int
|
||||
int clGetEventInfo(@PointerWrapper("cl_event") CLEvent event,
|
||||
|
|
@ -1129,7 +1129,7 @@ public interface CL10 {
|
|||
@cl_int
|
||||
int clEnqueueWaitForEvents(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@Constant("1") @cl_uint int num_events,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, event).getBuffer(), 0", keepParam = true) CLEvent event);
|
||||
@Constant(value = "APIUtil.getPointer(event)", keepParam = true) CLEvent event);
|
||||
|
||||
@cl_int
|
||||
int clGetEventProfilingInfo(@PointerWrapper("cl_event") CLEvent event,
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public interface CL10GL {
|
|||
@cl_int
|
||||
int clEnqueueAcquireGLObjects(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@Constant("1") @cl_uint int num_objects,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, mem_object).getBuffer(), 0", keepParam = true) CLMem mem_object,
|
||||
@Constant(value = "APIUtil.getPointer(mem_object)", keepParam = true) CLMem mem_object,
|
||||
@AutoSize(value = "event_wait_list", canBeNull = true) @cl_uint int num_events_in_wait_list,
|
||||
@Check(canBeNull = true) @Const @NativeType("cl_event") PointerBuffer event_wait_list,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @NativeType("cl_event") PointerBuffer event);
|
||||
|
|
@ -131,7 +131,7 @@ public interface CL10GL {
|
|||
@cl_int
|
||||
int clEnqueueReleaseGLObjects(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@Constant("1") @cl_uint int num_objects,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, mem_object).getBuffer(), 0", keepParam = true) CLMem mem_object,
|
||||
@Constant(value = "APIUtil.getPointer(mem_object)", keepParam = true) CLMem mem_object,
|
||||
@AutoSize(value = "event_wait_list", canBeNull = true) @cl_uint int num_events_in_wait_list,
|
||||
@Check(canBeNull = true) @Const @NativeType("cl_event") PointerBuffer event_wait_list,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @NativeType("cl_event") PointerBuffer event);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public interface EXT_migrate_memobject {
|
|||
@cl_int
|
||||
int clEnqueueMigrateMemObjectEXT(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue,
|
||||
@Constant("1") @cl_uint int num_mem_objects,
|
||||
@Constant(value = "APIUtil.getBufferPointer().put(0, mem_object).getBuffer(), 0", keepParam = true) CLMem mem_object,
|
||||
@Constant(value = "APIUtil.getPointer(mem_object)", keepParam = true) CLMem mem_object,
|
||||
@cl_bitfield @NativeType("cl_mem_migration_flags_ext") long flags,
|
||||
@AutoSize(value = "event_wait_list", canBeNull = true) @cl_uint int num_events_in_wait_list,
|
||||
@Check(canBeNull = true) @Const @NativeType("cl_event") PointerBuffer event_wait_list,
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public interface AMD_name_gen_delete {
|
|||
void glDeleteNamesAMD(@GLenum int identifier, @AutoSize("names") @GLsizei int num, @Const @GLuint IntBuffer names);
|
||||
|
||||
@Alternate("glDeleteNamesAMD")
|
||||
void glDeleteNamesAMD(@GLenum int identifier, @Constant("1") @GLsizei int num, @Constant(value = "APIUtil.getBufferInt().put(0, name), 0", keepParam = true) int name);
|
||||
void glDeleteNamesAMD(@GLenum int identifier, @Constant("1") @GLsizei int num, @Constant(value = "APIUtil.getInt(name)", keepParam = true) int name);
|
||||
|
||||
boolean glIsNameAMD(@GLenum int identifier, @GLuint int name);
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public interface AMD_performance_monitor {
|
|||
@Alternate("glGetPerfMonitorGroupStringAMD")
|
||||
@GLreturn(value = "groupString", maxLength = "bufSize")
|
||||
void glGetPerfMonitorGroupStringAMD2(@GLuint int group, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("groupString_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(groupString_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer groupString);
|
||||
|
||||
void glGetPerfMonitorCounterStringAMD(@GLuint int group, @GLuint int counter, @AutoSize("counterString") @GLsizei int bufSize,
|
||||
|
|
@ -86,7 +86,7 @@ public interface AMD_performance_monitor {
|
|||
@Alternate("glGetPerfMonitorCounterStringAMD")
|
||||
@GLreturn(value = "counterString", maxLength = "bufSize")
|
||||
void glGetPerfMonitorCounterStringAMD2(@GLuint int group, @GLuint int counter, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("counterString_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(counterString_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer counterString);
|
||||
|
||||
void glGetPerfMonitorCounterInfoAMD(@GLuint int group, @GLuint int counter, @GLenum int pname, @Check(value = "16") @GLvoid ByteBuffer data);
|
||||
|
|
@ -100,12 +100,12 @@ public interface AMD_performance_monitor {
|
|||
void glDeletePerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @GLuint IntBuffer monitors);
|
||||
|
||||
@Alternate("glDeletePerfMonitorsAMD")
|
||||
void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, monitor), 0", keepParam = true) int monitor);
|
||||
void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(monitor)", keepParam = true) int monitor);
|
||||
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @AutoSize("counterList") int numCounters, @GLuint IntBuffer counterList);
|
||||
|
||||
@Alternate("glSelectPerfMonitorCountersAMD")
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtil.getBufferInt().put(0, counter), 0", keepParam = true) int counter);
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtil.getInt(counter)", keepParam = true) int counter);
|
||||
|
||||
void glBeginPerfMonitorAMD(@GLuint int monitor);
|
||||
|
||||
|
|
@ -119,6 +119,6 @@ public interface AMD_performance_monitor {
|
|||
@GLreturn("data")
|
||||
void glGetPerfMonitorCounterDataAMD2(@GLuint int monitor, @GLenum int pname, @Constant("4") @GLsizei int dataSize,
|
||||
@OutParameter @GLuint IntBuffer data,
|
||||
@OutParameter @GLint @Constant("null, 0") IntBuffer bytesWritten);
|
||||
@OutParameter @GLint @Constant("0L") IntBuffer bytesWritten);
|
||||
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ public interface APPLE_fence {
|
|||
void glDeleteFencesAPPLE(@AutoSize("fences") @GLsizei int n, @Const @GLuint IntBuffer fences);
|
||||
|
||||
@Alternate("glDeleteFencesAPPLE")
|
||||
void glDeleteFencesAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getBufferInt().put(0, fence), 0", keepParam = true) int fence);
|
||||
void glDeleteFencesAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getInt(fence)", keepParam = true) int fence);
|
||||
|
||||
void glSetFenceAPPLE(@GLuint int fence);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public interface APPLE_vertex_array_object {
|
|||
void glDeleteVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
|
||||
|
||||
@Alternate("glDeleteVertexArraysAPPLE")
|
||||
void glDeleteVertexArraysAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getBufferInt().put(0, array), 0", keepParam = true) int array);
|
||||
void glDeleteVertexArraysAPPLE(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getInt(array)", keepParam = true) int array);
|
||||
|
||||
void glGenVertexArraysAPPLE(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public interface ARB_buffer_object {
|
|||
void glDeleteBuffersARB(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
|
||||
|
||||
@Alternate("glDeleteBuffersARB")
|
||||
void glDeleteBuffersARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDeleteBuffersARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
|
||||
void glGenBuffersARB(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,5 +65,5 @@ public interface ARB_draw_buffers {
|
|||
void glDrawBuffersARB(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
|
||||
|
||||
@Alternate("glDrawBuffersARB")
|
||||
void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public interface ARB_framebuffer_object {
|
|||
|
||||
@Reuse("GL30")
|
||||
@Alternate("glDeleteRenderbuffers")
|
||||
void glDeleteRenderbuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
|
||||
void glDeleteRenderbuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(renderbuffer)", keepParam = true) int renderbuffer);
|
||||
|
||||
@Reuse("GL30")
|
||||
void glGenRenderbuffers(@AutoSize("renderbuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer renderbuffers);
|
||||
|
|
@ -237,7 +237,7 @@ public interface ARB_framebuffer_object {
|
|||
|
||||
@Reuse("GL30")
|
||||
@Alternate("glDeleteFramebuffers")
|
||||
void glDeleteFramebuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
|
||||
void glDeleteFramebuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(framebuffer)", keepParam = true) int framebuffer);
|
||||
|
||||
@Reuse("GL30")
|
||||
void glGenFramebuffers(@AutoSize("framebuffers") @GLsizei int n, @OutParameter @GLuint IntBuffer framebuffers);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public interface ARB_occlusion_query {
|
|||
void glDeleteQueriesARB(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
|
||||
|
||||
@Alternate("glDeleteQueriesARB")
|
||||
void glDeleteQueriesARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, id), 0", keepParam = true) int id);
|
||||
void glDeleteQueriesARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(id)", keepParam = true) int id);
|
||||
|
||||
boolean glIsQueryARB(@GLuint int id);
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public interface ARB_program {
|
|||
void glDeleteProgramsARB(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
|
||||
|
||||
@Alternate("glDeleteProgramsARB")
|
||||
void glDeleteProgramsARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, program), 0", keepParam = true) int program);
|
||||
void glDeleteProgramsARB(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(program)", keepParam = true) int program);
|
||||
|
||||
void glGenProgramsARB(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public interface ARB_sampler_objects {
|
|||
|
||||
@Reuse("GL33")
|
||||
@Alternate("glDeleteSamplers")
|
||||
void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtil.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
|
||||
void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtil.getInt(sampler)", keepParam = true) int sampler);
|
||||
|
||||
@Reuse("GL33")
|
||||
boolean glIsSampler(@GLuint int sampler);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public interface ARB_separate_shader_objects {
|
|||
|
||||
@Reuse("GL41")
|
||||
@Alternate("glDeleteProgramPipelines")
|
||||
void glDeleteProgramPipelines(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, pipeline), 0", keepParam = true) int pipeline);
|
||||
void glDeleteProgramPipelines(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(pipeline)", keepParam = true) int pipeline);
|
||||
|
||||
@Reuse("GL41")
|
||||
void glGenProgramPipelines(@AutoSize("pipelines") @GLsizei int n, @OutParameter @GLuint IntBuffer pipelines);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public interface ARB_shader_objects {
|
|||
@Alternate(value = "glShaderSourceARB", nativeAlt = true)
|
||||
void glShaderSourceARB3(@GLhandleARB int shader, @Constant("strings.length") @GLsizei int count,
|
||||
@Const @PointerArray(value = "count", lengths = "length") CharSequence[] strings,
|
||||
@Constant("APIUtil.getLengths(strings), 0") @Const IntBuffer length);
|
||||
@Constant("APIUtil.getLengths(strings)") @Const IntBuffer length);
|
||||
|
||||
void glCompileShaderARB(@GLhandleARB int shaderObj);
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ public interface ARB_shader_objects {
|
|||
@Alternate("glGetInfoLogARB")
|
||||
@GLreturn(value = "infoLog", maxLength = "maxLength")
|
||||
void glGetInfoLogARB2(@GLhandleARB int obj, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLcharARB ByteBuffer infoLog);
|
||||
|
||||
void glGetAttachedObjectsARB(@GLhandleARB int containerObj, @AutoSize("obj") @GLsizei int maxCount,
|
||||
|
|
@ -225,35 +225,35 @@ public interface ARB_shader_objects {
|
|||
@Alternate("glGetActiveUniformARB")
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveUniformARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
|
||||
@OutParameter @GLcharARB ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
|
||||
@Alternate(value = "glGetActiveUniformARB", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveUniformARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLcharARB ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniformARB. This version returns only the uniform size. */
|
||||
@Alternate(value = "glGetActiveUniformARB", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveUniformSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniformARB. This version returns only the uniform type. */
|
||||
@Alternate(value = "glGetActiveUniformARB", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveUniformTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glGetUniformfvARB(@GLhandleARB int programObj, int location, @OutParameter @Check FloatBuffer params);
|
||||
|
|
@ -268,7 +268,7 @@ public interface ARB_shader_objects {
|
|||
@Alternate("glGetShaderSourceARB")
|
||||
@GLreturn(value = "source", maxLength = "maxLength")
|
||||
void glGetShaderSourceARB2(@GLhandleARB int obj, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(source_length)") IntBuffer length,
|
||||
@OutParameter @GLcharARB ByteBuffer source);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@ public interface ARB_shading_language_include {
|
|||
|
||||
void glCompileShaderIncludeARB(@GLuint int shader, @GLsizei int count,
|
||||
@Const @NullTerminated("count") @PointerArray("count") @GLchar ByteBuffer path,
|
||||
@Constant("null, 0") @Const IntBuffer length);
|
||||
@Constant("0L") @Const IntBuffer length);
|
||||
|
||||
@Alternate(value = "glCompileShaderIncludeARB", nativeAlt = true)
|
||||
void glCompileShaderIncludeARB2(@GLuint int shader, @Constant("path.length") @GLsizei int count,
|
||||
@Const @PointerArray(value = "count", lengths = "length") CharSequence[] path,
|
||||
@Constant("APIUtil.getLengths(path), 0") @Const IntBuffer length);
|
||||
@Constant("APIUtil.getLengths(path)") @Const IntBuffer length);
|
||||
|
||||
boolean glIsNamedStringARB(@AutoSize("name") int namelen, @Const @GLchar ByteBuffer name);
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ public interface ARB_shading_language_include {
|
|||
@GLreturn(value = "string", maxLength = "bufSize")
|
||||
void glGetNamedStringARB2(@Constant("name.length()") int namelen, CharSequence name,
|
||||
@GLsizei int bufSize,
|
||||
@OutParameter @Constant("string_length, 0") IntBuffer stringlen,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress0(string_length)") IntBuffer stringlen,
|
||||
@OutParameter @GLchar ByteBuffer string);
|
||||
|
||||
@StripPostfix("params")
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public interface ARB_transform_feedback2 {
|
|||
|
||||
@Reuse("GL40")
|
||||
@Alternate("glDeleteTransformFeedbacks")
|
||||
void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, id), 0", keepParam = true) int id);
|
||||
void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(id)", keepParam = true) int id);
|
||||
|
||||
@Reuse("GL40")
|
||||
void glGenTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public interface ARB_vertex_array_object {
|
|||
|
||||
@Reuse("GL30")
|
||||
@Alternate("glDeleteVertexArrays")
|
||||
void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, array), 0", keepParam = true) int array);
|
||||
void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(array)", keepParam = true) int array);
|
||||
|
||||
@Reuse("GL30")
|
||||
void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
|
||||
|
|
|
|||
|
|
@ -161,35 +161,35 @@ public interface ARB_vertex_shader {
|
|||
@Alternate("glGetActiveAttribARB")
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveAttribARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
|
||||
@OutParameter @GLcharARB ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttribARB. This version returns only the attrib name. */
|
||||
@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLcharARB ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
|
||||
@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveAttribSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttribARB. This version returns only the attrib type. */
|
||||
@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveAttribTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,5 +65,5 @@ public interface ATI_draw_buffers {
|
|||
void glDrawBuffersATI(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
|
||||
|
||||
@Alternate("glDrawBuffersATI")
|
||||
void glDrawBuffersATI(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDrawBuffersATI(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1075,7 +1075,7 @@ public interface EXT_direct_state_access {
|
|||
@Alternate("glTextureParameterIivEXT")
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("param")
|
||||
void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glTextureParameterIivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("params")
|
||||
|
|
@ -1084,7 +1084,7 @@ public interface EXT_direct_state_access {
|
|||
@Alternate("glTextureParameterIuivEXT")
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("param")
|
||||
void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) @GLuint int param);
|
||||
void glTextureParameterIuivEXT(@GLuint int texture, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) @GLuint int param);
|
||||
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("params")
|
||||
|
|
@ -1119,7 +1119,7 @@ public interface EXT_direct_state_access {
|
|||
@Alternate("glMultiTexParameterIivEXT")
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("param")
|
||||
void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glMultiTexParameterIivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("params")
|
||||
|
|
@ -1128,7 +1128,7 @@ public interface EXT_direct_state_access {
|
|||
@Alternate("glMultiTexParameterIuivEXT")
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("param")
|
||||
void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glMultiTexParameterIuivEXT(@GLenum int texunit, @GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@Dependent("GL_EXT_texture_integer")
|
||||
@StripPostfix("params")
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public interface EXT_framebuffer_object {
|
|||
void glDeleteRenderbuffersEXT(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
|
||||
|
||||
@Alternate("glDeleteRenderbuffersEXT")
|
||||
void glDeleteRenderbuffersEXT(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
|
||||
void glDeleteRenderbuffersEXT(@Constant("1") int n, @Constant(value = "APIUtil.getInt(renderbuffer)", keepParam = true) int renderbuffer);
|
||||
|
||||
void glGenRenderbuffersEXT(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ public interface EXT_framebuffer_object {
|
|||
void glDeleteFramebuffersEXT(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
|
||||
|
||||
@Alternate("glDeleteFramebuffersEXT")
|
||||
void glDeleteFramebuffersEXT(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
|
||||
void glDeleteFramebuffersEXT(@Constant("1") int n, @Constant(value = "APIUtil.getInt(framebuffer)", keepParam = true) int framebuffer);
|
||||
|
||||
void glGenFramebuffersEXT(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
|
||||
|
||||
|
|
|
|||
|
|
@ -118,14 +118,14 @@ public interface EXT_texture_integer {
|
|||
|
||||
@Alternate("glTexParameterIivEXT")
|
||||
@StripPostfix(value = "param", postfix = "v")
|
||||
void glTexParameterIivEXT(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glTexParameterIivEXT(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glTexParameterIuivEXT(@GLenum int target, @GLenum int pname, @Check("4") @GLuint IntBuffer params);
|
||||
|
||||
@Alternate("glTexParameterIuivEXT")
|
||||
@StripPostfix(value = "param", postfix = "v")
|
||||
void glTexParameterIuivEXT(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glTexParameterIuivEXT(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glGetTexParameterIivEXT(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public interface EXT_transform_feedback {
|
|||
@Alternate("glGetTransformFeedbackVaryingEXT")
|
||||
@GLreturn(value = "name", maxLength = "bufSize")
|
||||
void glGetTransformFeedbackVaryingEXT2(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @GLsizei @Check("1") IntBuffer size,
|
||||
@OutParameter @GLenum @Check("1") IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
|
|
|||
|
|
@ -784,7 +784,7 @@ public interface GL11 {
|
|||
void glDeleteTextures(@AutoSize("textures") @GLsizei int n, @Const @GLuint IntBuffer textures);
|
||||
|
||||
@Alternate("glDeleteTextures")
|
||||
void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, texture), 0", keepParam = true) int texture);
|
||||
void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(texture)", keepParam = true) int texture);
|
||||
|
||||
void glCullFace(@GLenum int mode);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public interface GL15 {
|
|||
void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
|
||||
|
||||
@Alternate("glDeleteBuffers")
|
||||
void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
|
||||
void glGenBuffers(@AutoSize("buffers") @GLsizei int n, @OutParameter @GLuint IntBuffer buffers);
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ public interface GL15 {
|
|||
void glDeleteQueries(@AutoSize("ids") @GLsizei int n, @GLuint IntBuffer ids);
|
||||
|
||||
@Alternate("glDeleteQueries")
|
||||
void glDeleteQueries(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, id), 0", keepParam = true) int id);
|
||||
void glDeleteQueries(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(id)", keepParam = true) int id);
|
||||
|
||||
boolean glIsQuery(@GLuint int id);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public interface GL20 {
|
|||
@Alternate(value = "glShaderSource", nativeAlt = true)
|
||||
void glShaderSource3(@GLuint int shader, @Constant("strings.length") @GLsizei int count,
|
||||
@Const @PointerArray(value = "count", lengths = "length") CharSequence[] strings,
|
||||
@Constant("APIUtil.getLengths(strings), 0") @Const IntBuffer length);
|
||||
@Constant("APIUtil.getLengths(strings)") @Const IntBuffer length);
|
||||
|
||||
int glCreateShader(@GLuint int type);
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ public interface GL20 {
|
|||
@Alternate("glGetShaderInfoLog")
|
||||
@GLreturn(value = "infoLog", maxLength = "maxLength")
|
||||
void glGetShaderInfoLog2(@GLuint int shader, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer infoLog);
|
||||
|
||||
void glGetProgramInfoLog(@GLuint int program, @AutoSize("infoLog") @GLsizei int maxLength,
|
||||
|
|
@ -219,7 +219,7 @@ public interface GL20 {
|
|||
@Alternate("glGetProgramInfoLog")
|
||||
@GLreturn(value = "infoLog", maxLength = "maxLength")
|
||||
void glGetProgramInfoLog2(@GLuint int program, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer infoLog);
|
||||
|
||||
void glGetAttachedShaders(@GLuint int program, @AutoSize("shaders") @GLsizei int maxCount,
|
||||
|
|
@ -248,35 +248,35 @@ public interface GL20 {
|
|||
@Alternate("glGetActiveUniform")
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveUniform2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveUniform(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniform. This version returns only the uniform size. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveUniformSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniform. This version returns only the uniform type. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveUniformType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glGetUniformfv(@GLuint int program, int location, @OutParameter @Check FloatBuffer params);
|
||||
|
|
@ -291,7 +291,7 @@ public interface GL20 {
|
|||
@Alternate("glGetShaderSource")
|
||||
@GLreturn(value = "source", maxLength = "maxLength")
|
||||
void glGetShaderSource2(@GLuint int shader, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(source_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer source);
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
|
@ -423,35 +423,35 @@ public interface GL20 {
|
|||
@Alternate("glGetActiveAttrib")
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveAttrib2(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttrib. This version returns only the attrib name. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "maxLength")
|
||||
void glGetActiveAttrib(@GLuint int program, @GLuint int index, @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveAttribSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttrib. This version returns only the attrib type. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveAttribType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int maxLength,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
int glGetAttribLocation(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
|
||||
|
||||
|
|
@ -509,7 +509,7 @@ public interface GL20 {
|
|||
void glDrawBuffers(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
|
||||
|
||||
@Alternate("glDrawBuffers")
|
||||
void glDrawBuffers(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDrawBuffers(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// ----------------------[ ARB_point_sprite ]----------------------
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ public interface GL30 {
|
|||
void glDeleteRenderbuffers(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
|
||||
|
||||
@Alternate("glDeleteRenderbuffers")
|
||||
void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
|
||||
void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtil.getInt(renderbuffer)", keepParam = true) int renderbuffer);
|
||||
|
||||
void glGenRenderbuffers(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
|
||||
|
||||
|
|
@ -553,7 +553,7 @@ public interface GL30 {
|
|||
void glDeleteFramebuffers(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
|
||||
|
||||
@Alternate("glDeleteFramebuffers")
|
||||
void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
|
||||
void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtil.getInt(framebuffer)", keepParam = true) int framebuffer);
|
||||
|
||||
void glGenFramebuffers(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
|
||||
|
||||
|
|
@ -712,14 +712,14 @@ public interface GL30 {
|
|||
|
||||
@Alternate("glTexParameterIiv")
|
||||
@StripPostfix(value = "param", postfix = "v")
|
||||
void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glTexParameterIiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Check("4") @GLuint IntBuffer params);
|
||||
|
||||
@Alternate("glTexParameterIuiv")
|
||||
@StripPostfix(value = "param", postfix = "v")
|
||||
void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getBufferInt().put(0, param), 0", keepParam = true) int param);
|
||||
void glTexParameterIuiv(@GLenum int target, @GLenum int pname, @Constant(value = "APIUtil.getInt(param)", keepParam = true) int param);
|
||||
|
||||
@StripPostfix("params")
|
||||
void glGetTexParameterIiv(@GLenum int target, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
|
||||
|
|
@ -996,7 +996,7 @@ public interface GL30 {
|
|||
@Alternate("glGetTransformFeedbackVarying")
|
||||
@GLreturn(value = "name", maxLength = "bufSize")
|
||||
void glGetTransformFeedbackVarying2(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @GLsizei @Check("1") IntBuffer size,
|
||||
@OutParameter @GLenum @Check("1") IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
|
@ -1019,7 +1019,7 @@ public interface GL30 {
|
|||
|
||||
@Alternate("glDeleteVertexArrays")
|
||||
@Code(" StateTracker.deleteVAO(caps, array);")
|
||||
void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, array), 0", keepParam = true) int array);
|
||||
void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(array)", keepParam = true) int array);
|
||||
|
||||
void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ public interface GL31 {
|
|||
@GLreturn("params")
|
||||
@StripPostfix("params")
|
||||
void glGetActiveUniformsiv(@GLuint int program, @Constant("1") @GLsizei int uniformCount,
|
||||
@Constant(value = "params.put(1, uniformIndex), 1", keepParam = true) int uniformIndex, // Reuse params buffer
|
||||
@Constant(value = "MemoryUtil.getAddress(params.put(1, uniformIndex), 1)", keepParam = true) int uniformIndex, // Reuse params buffer
|
||||
@GLenum int pname,
|
||||
@OutParameter @GLint IntBuffer params);
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ public interface GL31 {
|
|||
@Alternate("glGetActiveUniformName")
|
||||
@GLreturn(value = "uniformName", maxLength = "bufSize")
|
||||
void glGetActiveUniformName2(@GLuint int program, @GLuint int uniformIndex, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("uniformName_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(uniformName_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer uniformName);
|
||||
|
||||
@GLuint
|
||||
|
|
@ -290,7 +290,7 @@ public interface GL31 {
|
|||
@Alternate("glGetActiveUniformBlockName")
|
||||
@GLreturn(value = "uniformBlockName", maxLength = "bufSize")
|
||||
void glGetActiveUniformBlockName2(@GLuint int program, @GLuint int uniformBlockIndex, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("uniformBlockName_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(uniformBlockName_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer uniformBlockName);
|
||||
|
||||
void glUniformBlockBinding(@GLuint int program, @GLuint int uniformBlockIndex, @GLuint int uniformBlockBinding);
|
||||
|
|
|
|||
|
|
@ -335,6 +335,6 @@ public interface GL32 {
|
|||
@GLreturn("values")
|
||||
@StripPostfix("values")
|
||||
void glGetSynciv2(@PointerWrapper("GLsync") GLSync sync, @GLenum int pname, @Constant("1") @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer values);
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ public interface GL33 {
|
|||
void glDeleteSamplers(@AutoSize("samplers") @GLsizei int count, @Const @GLuint IntBuffer samplers);
|
||||
|
||||
@Alternate("glDeleteSamplers")
|
||||
void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtil.getBufferInt().put(0, sampler), 0", keepParam = true) int sampler);
|
||||
void glDeleteSamplers(@Constant("1") @GLsizei int count, @Constant(value = "APIUtil.getInt(sampler)", keepParam = true) int sampler);
|
||||
|
||||
boolean glIsSampler(@GLuint int sampler);
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ public interface GL40 {
|
|||
@Alternate("glGetActiveSubroutineUniformName")
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
|
||||
|
|
@ -243,7 +243,7 @@ public interface GL40 {
|
|||
@Alternate("glGetActiveSubroutineName")
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
@StripPostfix("indices")
|
||||
|
|
@ -404,7 +404,7 @@ public interface GL40 {
|
|||
void glDeleteTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @Const @GLuint IntBuffer ids);
|
||||
|
||||
@Alternate("glDeleteTransformFeedbacks")
|
||||
void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, id), 0", keepParam = true) int id);
|
||||
void glDeleteTransformFeedbacks(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(id)", keepParam = true) int id);
|
||||
|
||||
void glGenTransformFeedbacks(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public interface GL41 {
|
|||
void glDeleteProgramPipelines(@AutoSize("pipelines") @GLsizei int n, @Const @GLuint IntBuffer pipelines);
|
||||
|
||||
@Alternate("glDeleteProgramPipelines")
|
||||
void glDeleteProgramPipelines(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, pipeline), 0", keepParam = true) int pipeline);
|
||||
void glDeleteProgramPipelines(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(pipeline)", keepParam = true) int pipeline);
|
||||
|
||||
void glGenProgramPipelines(@AutoSize("pipelines") @GLsizei int n, @OutParameter @GLuint IntBuffer pipelines);
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ public interface GL41 {
|
|||
@Alternate("glGetProgramPipelineInfoLog")
|
||||
@GLreturn(value = "infoLog", maxLength = "bufSize")
|
||||
void glGetProgramPipelineInfoLog2(@GLuint int pipeline, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer infoLog);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public interface NV_fence {
|
|||
void glDeleteFencesNV(@AutoSize("piFences") @GLsizei int n, @Const @GLuint IntBuffer piFences);
|
||||
|
||||
@Alternate("glDeleteFencesNV")
|
||||
void glDeleteFencesNV(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getBufferInt().put(0, fence), 0", keepParam = true) int fence);
|
||||
void glDeleteFencesNV(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getInt(fence)", keepParam = true) int fence);
|
||||
|
||||
void glSetFenceNV(@GLuint int fence, @GLenum int condition);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public interface NV_occlusion_query {
|
|||
void glDeleteOcclusionQueriesNV(@AutoSize("piIDs") @GLsizei int n, @Const @GLuint IntBuffer piIDs);
|
||||
|
||||
@Alternate("glDeleteOcclusionQueriesNV")
|
||||
void glDeleteOcclusionQueriesNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, piID), 0", keepParam = true) int piID);
|
||||
void glDeleteOcclusionQueriesNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(piID)", keepParam = true) int piID);
|
||||
|
||||
boolean glIsOcclusionQueryNV(@GLuint int id);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public interface NV_program {
|
|||
void glDeleteProgramsNV(@AutoSize("programs") @GLsizei int n, @Const @GLuint IntBuffer programs);
|
||||
|
||||
@Alternate("glDeleteProgramsNV")
|
||||
void glDeleteProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, program), 0", keepParam = true) int program);
|
||||
void glDeleteProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(program)", keepParam = true) int program);
|
||||
|
||||
void glGenProgramsNV(@AutoSize("programs") @GLsizei int n, @OutParameter @GLuint IntBuffer programs);
|
||||
|
||||
|
|
@ -101,6 +101,6 @@ public interface NV_program {
|
|||
void glRequestResidentProgramsNV(@AutoSize("programIDs") @GLsizei int n, @GLuint IntBuffer programIDs);
|
||||
|
||||
@Alternate("glRequestResidentProgramsNV")
|
||||
void glRequestResidentProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, programID), 0", keepParam = true) int programID);
|
||||
void glRequestResidentProgramsNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(programID)", keepParam = true) int programID);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,35 +143,35 @@ public interface NV_transform_feedback {
|
|||
@Alternate("glGetActiveVaryingNV")
|
||||
@GLreturn(value = "name", maxLength = "bufSize")
|
||||
void glGetActiveVaryingNV2(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @GLenum @Constant("sizeType, sizeType.position() + 1") IntBuffer type,
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveVaryingNV. This version returns only the varying name. */
|
||||
@Alternate(value = "glGetActiveVaryingNV", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "bufSize")
|
||||
void glGetActiveVaryingNV(@GLuint int program, @GLuint int index, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveVaryingNV. This version returns only the varying size. */
|
||||
@Alternate(value = "glGetActiveVaryingNV", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveVaryingSizeNV(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveVaryingNV. This version returns only the varying type. */
|
||||
@Alternate(value = "glGetActiveVaryingNV", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveVaryingTypeNV(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
void glActiveVaryingNV(@GLuint int program, @NullTerminated @Const @GLchar ByteBuffer name);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public interface NV_transform_feedback2 {
|
|||
void glDeleteTransformFeedbacksNV(@AutoSize("ids") @GLsizei int n, @Const @GLuint IntBuffer ids);
|
||||
|
||||
@Alternate("glDeleteTransformFeedbacksNV")
|
||||
void glDeleteTransformFeedbacksNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, id), 0", keepParam = true) int id);
|
||||
void glDeleteTransformFeedbacksNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(id)", keepParam = true) int id);
|
||||
|
||||
void glGenTransformFeedbacksNV(@AutoSize("ids") @GLsizei int n, @OutParameter @GLuint IntBuffer ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public interface AMD_performance_monitor {
|
|||
@Alternate("glGetPerfMonitorGroupStringAMD")
|
||||
@GLreturn(value = "groupString", maxLength = "bufSize")
|
||||
void glGetPerfMonitorGroupStringAMD2(@GLuint int group, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("groupString_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(groupString_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer groupString);
|
||||
|
||||
void glGetPerfMonitorCounterStringAMD(@GLuint int group, @GLuint int counter, @AutoSize("counterString") @GLsizei int bufSize,
|
||||
|
|
@ -85,7 +85,7 @@ public interface AMD_performance_monitor {
|
|||
@Alternate("glGetPerfMonitorCounterStringAMD")
|
||||
@GLreturn(value = "counterString", maxLength = "bufSize")
|
||||
void glGetPerfMonitorCounterStringAMD2(@GLuint int group, @GLuint int counter, @GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("counterString_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(counterString_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer counterString);
|
||||
|
||||
void glGetPerfMonitorCounterInfoAMD(@GLuint int group, @GLuint int counter, @GLenum int pname, @Check(value = "16") @GLvoid ByteBuffer data);
|
||||
|
|
@ -99,12 +99,12 @@ public interface AMD_performance_monitor {
|
|||
void glDeletePerfMonitorsAMD(@AutoSize("monitors") @GLsizei int n, @GLuint IntBuffer monitors);
|
||||
|
||||
@Alternate("glDeletePerfMonitorsAMD")
|
||||
void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, monitor), 0", keepParam = true) int monitor);
|
||||
void glDeletePerfMonitorsAMD(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(monitor)", keepParam = true) int monitor);
|
||||
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @AutoSize("counterList") int numCounters, @GLuint IntBuffer counterList);
|
||||
|
||||
@Alternate("glSelectPerfMonitorCountersAMD")
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtil.getBufferInt().put(0, counter), 0", keepParam = true) int counter);
|
||||
void glSelectPerfMonitorCountersAMD(@GLuint int monitor, boolean enable, @GLuint int group, @Constant("1") int numCounters, @Constant(value = "APIUtil.getInt(counter)", keepParam = true) int counter);
|
||||
|
||||
void glBeginPerfMonitorAMD(@GLuint int monitor);
|
||||
|
||||
|
|
@ -118,6 +118,6 @@ public interface AMD_performance_monitor {
|
|||
@GLreturn("data")
|
||||
void glGetPerfMonitorCounterDataAMD2(@GLuint int monitor, @GLenum int pname, @Constant("4") @GLsizei int dataSize,
|
||||
@OutParameter @GLuint IntBuffer data,
|
||||
@OutParameter @GLint @Constant("null, 0") IntBuffer bytesWritten);
|
||||
@OutParameter @GLint @Constant("0L") IntBuffer bytesWritten);
|
||||
|
||||
}
|
||||
|
|
@ -64,6 +64,6 @@ public interface ARB_draw_buffers {
|
|||
void glDrawBuffersARB(@AutoSize("buffers") @GLsizei int size, @Const @GLenum IntBuffer buffers);
|
||||
|
||||
@Alternate("glDrawBuffersARB")
|
||||
void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDrawBuffersARB(@Constant("1") @GLsizei int size, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
|
||||
}
|
||||
|
|
@ -521,26 +521,26 @@ public interface GLES20 {
|
|||
void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers);
|
||||
|
||||
@Alternate("glDeleteBuffers")
|
||||
void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, buffer), 0", keepParam = true) int buffer);
|
||||
void glDeleteBuffers(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(buffer)", keepParam = true) int buffer);
|
||||
|
||||
void glDeleteFramebuffers(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
|
||||
|
||||
@Alternate("glDeleteFramebuffers")
|
||||
void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
|
||||
void glDeleteFramebuffers(@Constant("1") int n, @Constant(value = "APIUtil.getInt(framebuffer)", keepParam = true) int framebuffer);
|
||||
|
||||
void glDeleteProgram(@GLuint int program);
|
||||
|
||||
void glDeleteRenderbuffers(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
|
||||
|
||||
@Alternate("glDeleteRenderbuffers")
|
||||
void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
|
||||
void glDeleteRenderbuffers(@Constant("1") int n, @Constant(value = "APIUtil.getInt(renderbuffer)", keepParam = true) int renderbuffer);
|
||||
|
||||
void glDeleteShader(@GLuint int shader);
|
||||
|
||||
void glDeleteTextures(@AutoSize("textures") @GLsizei int n, @Const @GLuint IntBuffer textures);
|
||||
|
||||
@Alternate("glDeleteTextures")
|
||||
void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, texture), 0", keepParam = true) int texture);
|
||||
void glDeleteTextures(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(texture)", keepParam = true) int texture);
|
||||
|
||||
void glDepthFunc(@GLenum int func);
|
||||
|
||||
|
|
@ -609,35 +609,35 @@ public interface GLES20 {
|
|||
@Alternate("glGetActiveAttrib")
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveAttrib2(@GLuint int program, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @Constant("sizeType, sizeType.position() + 1") @GLenum IntBuffer type,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttrib. This version returns only the attrib name. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveAttrib(@GLuint int program, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttrib. This version returns only the attrib size. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveAttribSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveAttrib. This version returns only the attrib type. */
|
||||
@Alternate(value = "glGetActiveAttrib", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveAttribType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
void glGetActiveUniform(@GLuint int program, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
|
||||
|
|
@ -649,35 +649,35 @@ public interface GLES20 {
|
|||
@Alternate("glGetActiveUniform")
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveUniform2(@GLuint int program, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @Constant("name_length, 0") @GLsizei IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
|
||||
@OutParameter @Check("2") IntBuffer sizeType,
|
||||
@OutParameter @Constant("sizeType, sizeType.position() + 1") @GLenum IntBuffer type,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniformARB. This version returns only the uniform name. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "name", maxLength = "bufsize")
|
||||
void glGetActiveUniform(@GLuint int program, @GLuint int index, @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("name_length, 0, APIUtil.getBufferInt(), 0, APIUtil.getBufferInt(), 1") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt()), MemoryUtil.getAddress(APIUtil.getBufferInt(), 1)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniform. This version returns only the uniform size. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "size")
|
||||
void glGetActiveUniformSize(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter IntBuffer size,
|
||||
@OutParameter @GLenum @Constant("size, 1") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
/** Overloads glGetActiveUniform. This version returns only the uniform type. */
|
||||
@Alternate(value = "glGetActiveUniform", javaAlt = true)
|
||||
@GLreturn(value = "type")
|
||||
void glGetActiveUniformType(@GLuint int program, @GLuint int index, @Constant("0") @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("null, 0") IntBuffer length,
|
||||
@OutParameter @Constant("type, 1") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLsizei @Constant("0L") IntBuffer length,
|
||||
@OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
|
||||
@OutParameter @GLenum IntBuffer type,
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte(0), 0") ByteBuffer name);
|
||||
@OutParameter @GLchar @Constant("APIUtil.getBufferByte0()") ByteBuffer name);
|
||||
|
||||
void glGetAttachedShaders(@GLuint int program, @AutoSize("shaders") @GLsizei int maxCount,
|
||||
@OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer count,
|
||||
|
|
@ -747,7 +747,7 @@ public interface GLES20 {
|
|||
@Alternate("glGetProgramInfoLog")
|
||||
@GLreturn(value = "infoLog", maxLength = "bufsize")
|
||||
void glGetProgramInfoLog2(@GLuint int program, @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer infoLog);
|
||||
|
||||
@StripPostfix("params")
|
||||
|
|
@ -773,7 +773,7 @@ public interface GLES20 {
|
|||
@Alternate("glGetShaderInfoLog")
|
||||
@GLreturn(value = "infoLog", maxLength = "bufsize")
|
||||
void glGetShaderInfoLog2(@GLuint int shader, @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("infoLog_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(infoLog_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer infoLog);
|
||||
|
||||
void glGetShaderPrecisionFormat(@GLenum int shadertype, @GLenum int precisiontype, @OutParameter @GLint @Check("2") IntBuffer range, @OutParameter @Check("1") @GLint IntBuffer precision);
|
||||
|
|
@ -785,7 +785,7 @@ public interface GLES20 {
|
|||
@Alternate("glGetShaderSource")
|
||||
@GLreturn(value = "source", maxLength = "bufsize")
|
||||
void glGetShaderSource2(@GLuint int shader, @GLsizei int bufsize,
|
||||
@OutParameter @GLsizei @Constant("source_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(source_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer source);
|
||||
|
||||
@Const
|
||||
|
|
@ -897,7 +897,7 @@ public interface GLES20 {
|
|||
@Alternate(value = "glShaderSource", nativeAlt = true)
|
||||
void glShaderSource3(@GLuint int shader, @Constant("strings.length") @GLsizei int count,
|
||||
@Const @PointerArray(value = "count", lengths = "length") CharSequence[] strings,
|
||||
@Constant("APIUtil.getLengths(strings), 0") @Const IntBuffer length);
|
||||
@Constant("APIUtil.getLengths(strings)") @Const IntBuffer length);
|
||||
|
||||
void glStencilFunc(@GLenum int func, @GLint int ref, @GLuint int mask);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,6 @@ public interface NV_draw_buffers {
|
|||
void glDrawBuffersNV(@AutoSize("bufs") @GLsizei int n, @Const @GLenum IntBuffer bufs);
|
||||
|
||||
@Alternate("glDrawBuffersNV")
|
||||
void glDrawBuffersNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, buf), 0", keepParam = true) int buf);
|
||||
void glDrawBuffersNV(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(buf)", keepParam = true) int buf);
|
||||
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ public interface NV_fence {
|
|||
void glDeleteFencesNV(@AutoSize("fences") @GLsizei int n, @Const @GLuint IntBuffer fences);
|
||||
|
||||
@Alternate("glDeleteFencesNV")
|
||||
void glDeleteFencesNV(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getBufferInt().put(0, fence), 0", keepParam = true) int fence);
|
||||
void glDeleteFencesNV(@Constant("1") @GLsizei int n, @Const @GLuint @Constant(value = "APIUtil.getInt(fence)", keepParam = true) int fence);
|
||||
|
||||
void glSetFenceNV(@GLuint int fence, @GLenum int condition);
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public interface OES_framebuffer_object {
|
|||
void glDeleteRenderbuffersOES(@AutoSize("renderbuffers") int n, @Const @GLuint IntBuffer renderbuffers);
|
||||
|
||||
@Alternate("glDeleteRenderbuffersOES")
|
||||
void glDeleteRenderbuffersOES(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, renderbuffer), 0", keepParam = true) int renderbuffer);
|
||||
void glDeleteRenderbuffersOES(@Constant("1") int n, @Constant(value = "APIUtil.getInt(renderbuffer)", keepParam = true) int renderbuffer);
|
||||
|
||||
void glGenRenderbuffersOES(@AutoSize("renderbuffers") int n, @OutParameter @GLuint IntBuffer renderbuffers);
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ public interface OES_framebuffer_object {
|
|||
void glDeleteFramebuffersOES(@AutoSize("framebuffers") int n, @Const @GLuint IntBuffer framebuffers);
|
||||
|
||||
@Alternate("glDeleteFramebuffersOES")
|
||||
void glDeleteFramebuffersOES(@Constant("1") int n, @Constant(value = "APIUtil.getBufferInt().put(0, framebuffer), 0", keepParam = true) int framebuffer);
|
||||
void glDeleteFramebuffersOES(@Constant("1") int n, @Constant(value = "APIUtil.getInt(framebuffer)", keepParam = true) int framebuffer);
|
||||
|
||||
void glGenFramebuffersOES(@AutoSize("framebuffers") int n, @OutParameter @GLuint IntBuffer framebuffers);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public interface OES_vertex_array_object {
|
|||
void glDeleteVertexArraysOES(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
|
||||
|
||||
@Alternate("glDeleteVertexArraysOES")
|
||||
void glDeleteVertexArraysOES(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, array), 0", keepParam = true) int array);
|
||||
void glDeleteVertexArraysOES(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getInt(array)", keepParam = true) int array);
|
||||
|
||||
void glGenVertexArraysOES(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public interface QCOM_driver_control {
|
|||
@GLreturn(value = "driverControlString", maxLength = "bufSize")
|
||||
void glGetDriverControlStringQCOM2(@GLuint int driverControl,
|
||||
@GLsizei int bufSize,
|
||||
@OutParameter @GLsizei @Constant("driverControlString_length, 0") IntBuffer length,
|
||||
@OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(driverControlString_length)") IntBuffer length,
|
||||
@OutParameter @GLchar ByteBuffer driverControlString);
|
||||
|
||||
void glEnableDriverControlQCOM(@GLuint int driverControl);
|
||||
|
|
|
|||
Loading…
Reference in a new issue