mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 15:04:41 +00:00
The Big Generator. All OpenGL and OpenAL java and native source files are now generated from templates. See doc/generator.txt for a detailed description.
This commit is contained in:
parent
a1a9f5ced2
commit
17ee2523c0
386 changed files with 30503 additions and 26177 deletions
|
|
@ -67,6 +67,11 @@ public class BufferChecks {
|
|||
}
|
||||
}
|
||||
|
||||
public static void checkNotNull(Object o) {
|
||||
if (o == null)
|
||||
throw new IllegalArgumentException("Null argument");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a buffer is direct or null.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -89,6 +89,22 @@ public final class BufferUtils {
|
|||
return createByteBuffer(size << 2).asFloatBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return n, where buffer_element_size=2^n.
|
||||
*/
|
||||
public static int getElementSizeExponent(Buffer buf) {
|
||||
if (buf instanceof ByteBuffer)
|
||||
return 0;
|
||||
else if (buf instanceof ShortBuffer || buf instanceof CharBuffer)
|
||||
return 1;
|
||||
else if (buf instanceof FloatBuffer || buf instanceof IntBuffer)
|
||||
return 2;
|
||||
else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
|
||||
return 3;
|
||||
else
|
||||
throw new IllegalStateException("Unsupported buffer type");
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a direct native-order doublebuffer with the specified number
|
||||
* of elements.
|
||||
|
|
@ -105,14 +121,7 @@ public final class BufferUtils {
|
|||
* @return the position of the buffer, in BYTES
|
||||
*/
|
||||
public static int getOffset(Buffer buffer) {
|
||||
if (buffer instanceof FloatBuffer || buffer instanceof IntBuffer)
|
||||
return buffer.position() << 2;
|
||||
else if (buffer instanceof ShortBuffer || buffer instanceof CharBuffer)
|
||||
return buffer.position() << 1;
|
||||
else if (buffer instanceof DoubleBuffer || buffer instanceof LongBuffer)
|
||||
return buffer.position() << 3;
|
||||
else
|
||||
return buffer.position();
|
||||
return buffer.position() << getElementSizeExponent(buffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
215
src/java/org/lwjgl/generator/ALTypeMap.java
Normal file
215
src/java/org/lwjgl/generator/ALTypeMap.java
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* The OpenAL specific generator behaviour
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class ALTypeMap implements TypeMap {
|
||||
private final static Map<Class, PrimitiveType.Kind> native_types_to_primitive;
|
||||
|
||||
static {
|
||||
native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
|
||||
native_types_to_primitive.put(ALboolean.class, PrimitiveType.Kind.BOOLEAN);
|
||||
native_types_to_primitive.put(ALbyte.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(ALenum.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALfloat.class, PrimitiveType.Kind.FLOAT);
|
||||
native_types_to_primitive.put(ALint.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALshort.class, PrimitiveType.Kind.SHORT);
|
||||
native_types_to_primitive.put(ALsizei.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALubyte.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(ALuint.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALvoid.class, PrimitiveType.Kind.BYTE);
|
||||
}
|
||||
|
||||
public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
|
||||
PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
|
||||
if (kind == null)
|
||||
throw new RuntimeException("Unsupported type " + native_type);
|
||||
return kind;
|
||||
}
|
||||
|
||||
public Signedness getSignednessFromType(Class type) {
|
||||
if (ALuint.class.equals(type))
|
||||
return Signedness.UNSIGNED;
|
||||
else if (ALint.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else if (ALshort.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else if (ALbyte.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else
|
||||
return Signedness.NONE;
|
||||
}
|
||||
|
||||
public String translateAnnotation(Class annotation_type) {
|
||||
if (annotation_type.equals(ALuint.class))
|
||||
return "i";
|
||||
else if (annotation_type.equals(ALint.class))
|
||||
return "i";
|
||||
else if (annotation_type.equals(ALshort.class))
|
||||
return "s";
|
||||
else if (annotation_type.equals(ALbyte.class))
|
||||
return "b";
|
||||
else if (annotation_type.equals(ALfloat.class))
|
||||
return "f";
|
||||
else if (annotation_type.equals(ALboolean.class) || annotation_type.equals(ALvoid.class))
|
||||
return "";
|
||||
else
|
||||
throw new RuntimeException(annotation_type + " is not allowed");
|
||||
}
|
||||
|
||||
public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
|
||||
Class type;
|
||||
switch (kind) {
|
||||
case INT:
|
||||
type = ALint.class;
|
||||
break;
|
||||
case FLOAT:
|
||||
type = ALfloat.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = ALshort.class;
|
||||
break;
|
||||
case BYTE:
|
||||
type = ALbyte.class;
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = ALboolean.class;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
private static Class[] getValidBufferTypes(Class type) {
|
||||
if (type.equals(IntBuffer.class))
|
||||
return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
|
||||
else if (type.equals(FloatBuffer.class))
|
||||
return new Class[]{ALfloat.class};
|
||||
else if (type.equals(ByteBuffer.class))
|
||||
return new Class[]{ALboolean.class, ALbyte.class, ALvoid.class};
|
||||
else if (type.equals(ShortBuffer.class))
|
||||
return new Class[]{ALshort.class};
|
||||
else if (type.equals(DoubleBuffer.class))
|
||||
return new Class[]{};
|
||||
else
|
||||
return new Class[]{};
|
||||
}
|
||||
|
||||
private static Class[] getValidPrimitiveTypes(Class type) {
|
||||
if (type.equals(int.class))
|
||||
return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
|
||||
else if (type.equals(double.class))
|
||||
return new Class[]{};
|
||||
else if (type.equals(float.class))
|
||||
return new Class[]{ALfloat.class};
|
||||
else if (type.equals(short.class))
|
||||
return new Class[]{ALshort.class};
|
||||
else if (type.equals(byte.class))
|
||||
return new Class[]{ALbyte.class};
|
||||
else if (type.equals(boolean.class))
|
||||
return new Class[]{ALboolean.class};
|
||||
else if (type.equals(void.class))
|
||||
return new Class[]{ALvoid.class};
|
||||
else
|
||||
return new Class[]{};
|
||||
}
|
||||
|
||||
public String getErrorCheckMethodName() {
|
||||
return "Util.checkALError()";
|
||||
}
|
||||
|
||||
public String getRegisterNativesFunctionName() {
|
||||
return "extal_InitializeClass";
|
||||
}
|
||||
|
||||
public String getTypedefPrefix() {
|
||||
return "ALAPIENTRY";
|
||||
}
|
||||
|
||||
public void printNativeIncludes(PrintWriter writer) {
|
||||
writer.println("#include \"checkALerror.h\"");
|
||||
writer.println("#include \"extal.h\"");
|
||||
}
|
||||
|
||||
public Class getStringElementType() {
|
||||
return ALubyte.class;
|
||||
}
|
||||
|
||||
public Class[] getValidAnnotationTypes(Class type) {
|
||||
Class[] valid_types;
|
||||
if (Buffer.class.isAssignableFrom(type))
|
||||
valid_types = getValidBufferTypes(type);
|
||||
else if (type.isPrimitive())
|
||||
valid_types = getValidPrimitiveTypes(type);
|
||||
else if (type.equals(String.class))
|
||||
valid_types = new Class[]{ALubyte.class};
|
||||
else
|
||||
valid_types = new Class[]{};
|
||||
return valid_types;
|
||||
}
|
||||
|
||||
public Class getVoidType() {
|
||||
return ALvoid.class;
|
||||
}
|
||||
|
||||
public Class getInverseType(Class type) {
|
||||
if (ALuint.class.equals(type))
|
||||
return ALint.class;
|
||||
else if (ALint.class.equals(type))
|
||||
return ALuint.class;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALboolean.java
Normal file
48
src/java/org/lwjgl/generator/ALboolean.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALboolean {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALbyte.java
Normal file
48
src/java/org/lwjgl/generator/ALbyte.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALbyte {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALenum.java
Normal file
48
src/java/org/lwjgl/generator/ALenum.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALenum {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALfloat.java
Normal file
48
src/java/org/lwjgl/generator/ALfloat.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALfloat {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALint.java
Normal file
48
src/java/org/lwjgl/generator/ALint.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALint {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALshort.java
Normal file
48
src/java/org/lwjgl/generator/ALshort.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALshort {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALsizei.java
Normal file
48
src/java/org/lwjgl/generator/ALsizei.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALsizei {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALubyte.java
Normal file
48
src/java/org/lwjgl/generator/ALubyte.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALubyte {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALuint.java
Normal file
48
src/java/org/lwjgl/generator/ALuint.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALuint {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/ALvoid.java
Normal file
48
src/java/org/lwjgl/generator/ALvoid.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALvoid {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/Auto.java
Normal file
48
src/java/org/lwjgl/generator/Auto.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* AutoType and AutoSize is annotated with @Auto.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
public @interface Auto {
|
||||
}
|
||||
52
src/java/org/lwjgl/generator/AutoSize.java
Normal file
52
src/java/org/lwjgl/generator/AutoSize.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @AutoSize specifies that a parameter should be pre-computed
|
||||
* according to the remaining() of a Buffer parameter.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Auto
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface AutoSize {
|
||||
String value(); // The name of the Buffer parameter
|
||||
String expression() default ""; // This value is added after the argument
|
||||
}
|
||||
51
src/java/org/lwjgl/generator/AutoType.java
Normal file
51
src/java/org/lwjgl/generator/AutoType.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* Indicates that a parameter should be pre-computed according
|
||||
* to the type of a Buffer parameter.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Auto
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface AutoType {
|
||||
String value(); // The parameter to get the type from
|
||||
}
|
||||
46
src/java/org/lwjgl/generator/BufferKind.java
Normal file
46
src/java/org/lwjgl/generator/BufferKind.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
public enum BufferKind {
|
||||
UnpackPBO,
|
||||
PackPBO,
|
||||
ElementVBO,
|
||||
ArrayVBO
|
||||
}
|
||||
50
src/java/org/lwjgl/generator/BufferObject.java
Normal file
50
src/java/org/lwjgl/generator/BufferObject.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation implies that a Buffer parameter can be an
|
||||
* integer VBO/PBO offset.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface BufferObject {
|
||||
BufferKind value();
|
||||
}
|
||||
46
src/java/org/lwjgl/generator/CachedResult.java
Normal file
46
src/java/org/lwjgl/generator/CachedResult.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface CachedResult {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/Check.java
Normal file
48
src/java/org/lwjgl/generator/Check.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface Check {
|
||||
String value() default "";
|
||||
boolean canBeNull() default false;
|
||||
}
|
||||
47
src/java/org/lwjgl/generator/Code.java
Normal file
47
src/java/org/lwjgl/generator/Code.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface Code {
|
||||
String value();
|
||||
}
|
||||
46
src/java/org/lwjgl/generator/Const.java
Normal file
46
src/java/org/lwjgl/generator/Const.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface Const {
|
||||
}
|
||||
47
src/java/org/lwjgl/generator/Constant.java
Normal file
47
src/java/org/lwjgl/generator/Constant.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface Constant {
|
||||
String value();
|
||||
}
|
||||
49
src/java/org/lwjgl/generator/Extension.java
Normal file
49
src/java/org/lwjgl/generator/Extension.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Extension {
|
||||
String className() default "";
|
||||
boolean isFinal() default true;
|
||||
String postfix();
|
||||
}
|
||||
75
src/java/org/lwjgl/generator/FieldsGenerator.java
Normal file
75
src/java/org/lwjgl/generator/FieldsGenerator.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class FieldsGenerator {
|
||||
private static void validateField(FieldDeclaration field) {
|
||||
Collection<Modifier> modifiers = field.getModifiers();
|
||||
if (modifiers.size() != 3 || !modifiers.contains(Modifier.PUBLIC) || !modifiers.contains(Modifier.STATIC) ||
|
||||
!modifiers.contains(Modifier.FINAL))
|
||||
throw new RuntimeException("Field " + field.getSimpleName() + " is not declared public static final");
|
||||
TypeMirror field_type = field.getType();
|
||||
if (!(field_type instanceof PrimitiveType))
|
||||
throw new RuntimeException("Field " + field.getSimpleName() + " is not a primitive type");
|
||||
PrimitiveType field_type_prim = (PrimitiveType)field_type;
|
||||
if (field_type_prim.getKind() != PrimitiveType.Kind.INT)
|
||||
throw new RuntimeException("Field " + field.getSimpleName() + " is not of type 'int'");
|
||||
Integer field_value = (Integer)field.getConstantValue();
|
||||
if (field_value == null)
|
||||
throw new RuntimeException("Field " + field.getSimpleName() + " has no initial value");
|
||||
}
|
||||
|
||||
private static void generateField(PrintWriter writer, FieldDeclaration field) {
|
||||
Integer field_value = (Integer)field.getConstantValue();
|
||||
validateField(field);
|
||||
String field_value_string = Integer.toHexString(field_value.intValue());
|
||||
Utils.printDocComment(writer, field);
|
||||
// Print field declaration
|
||||
writer.println("\tpublic static final " + field.getType().toString() + " " + field.getSimpleName() + " = 0x" + field_value_string + ";");
|
||||
}
|
||||
|
||||
public static void generateFields(PrintWriter writer, Collection<FieldDeclaration> fields) {
|
||||
for (FieldDeclaration field : fields)
|
||||
generateField(writer, field);
|
||||
}
|
||||
|
||||
}
|
||||
266
src/java/org/lwjgl/generator/GLTypeMap.java
Normal file
266
src/java/org/lwjgl/generator/GLTypeMap.java
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* OpenGL sepcific generator behaviour
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class GLTypeMap implements TypeMap {
|
||||
private final static Map<Class, PrimitiveType.Kind> native_types_to_primitive;
|
||||
|
||||
static {
|
||||
native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>();
|
||||
native_types_to_primitive.put(GLbitfield.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLcharARB.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(GLclampf.class, PrimitiveType.Kind.FLOAT);
|
||||
native_types_to_primitive.put(GLfloat.class, PrimitiveType.Kind.FLOAT);
|
||||
native_types_to_primitive.put(GLint.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLshort.class, PrimitiveType.Kind.SHORT);
|
||||
native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLuint.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLboolean.class, PrimitiveType.Kind.BOOLEAN);
|
||||
native_types_to_primitive.put(GLchar.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(GLdouble.class, PrimitiveType.Kind.DOUBLE);
|
||||
native_types_to_primitive.put(GLhalf.class, PrimitiveType.Kind.SHORT);
|
||||
native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLsizei.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLushort.class, PrimitiveType.Kind.SHORT);
|
||||
native_types_to_primitive.put(GLbyte.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(GLclampd.class, PrimitiveType.Kind.DOUBLE);
|
||||
native_types_to_primitive.put(GLenum.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLhandleARB.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(GLubyte.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(GLvoid.class, PrimitiveType.Kind.BYTE);
|
||||
}
|
||||
|
||||
public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) {
|
||||
PrimitiveType.Kind kind = native_types_to_primitive.get(native_type);
|
||||
if (kind == null)
|
||||
throw new RuntimeException("Unsupported type " + native_type);
|
||||
return kind;
|
||||
}
|
||||
|
||||
public String getErrorCheckMethodName() {
|
||||
return "Util.checkGLError()";
|
||||
}
|
||||
|
||||
public String getRegisterNativesFunctionName() {
|
||||
return "extgl_InitializeClass";
|
||||
}
|
||||
|
||||
public Signedness getSignednessFromType(Class type) {
|
||||
if (GLuint.class.equals(type))
|
||||
return Signedness.UNSIGNED;
|
||||
else if (GLint.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else if (GLushort.class.equals(type))
|
||||
return Signedness.UNSIGNED;
|
||||
else if (GLshort.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else if (GLubyte.class.equals(type))
|
||||
return Signedness.UNSIGNED;
|
||||
else if (GLbyte.class.equals(type))
|
||||
return Signedness.SIGNED;
|
||||
else
|
||||
return Signedness.NONE;
|
||||
}
|
||||
|
||||
public String translateAnnotation(Class annotation_type) {
|
||||
if (annotation_type.equals(GLuint.class))
|
||||
return "i";
|
||||
else if (annotation_type.equals(GLint.class))
|
||||
return "i";
|
||||
else if (annotation_type.equals(GLushort.class))
|
||||
return"s";
|
||||
else if (annotation_type.equals(GLshort.class))
|
||||
return "s";
|
||||
else if (annotation_type.equals(GLubyte.class))
|
||||
return "b";
|
||||
else if (annotation_type.equals(GLbyte.class))
|
||||
return "b";
|
||||
else if (annotation_type.equals(GLfloat.class))
|
||||
return "f";
|
||||
else if (annotation_type.equals(GLhalf.class))
|
||||
return "h";
|
||||
else if (annotation_type.equals(GLboolean.class) || annotation_type.equals(GLvoid.class))
|
||||
return "";
|
||||
else
|
||||
throw new RuntimeException(annotation_type + " is not allowed");
|
||||
}
|
||||
|
||||
public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind) {
|
||||
Class type;
|
||||
switch (kind) {
|
||||
case INT:
|
||||
type = GLint.class;
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = GLdouble.class;
|
||||
break;
|
||||
case FLOAT:
|
||||
type = GLfloat.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = GLshort.class;
|
||||
break;
|
||||
case BYTE:
|
||||
type = GLbyte.class;
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = GLboolean.class;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public Class getVoidType() {
|
||||
return GLvoid.class;
|
||||
}
|
||||
|
||||
public Class getStringElementType() {
|
||||
return GLubyte.class;
|
||||
}
|
||||
|
||||
private static Class[] getValidBufferTypes(Class type) {
|
||||
if (type.equals(IntBuffer.class))
|
||||
return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLintptrARB.class, GLintptrARB.class,
|
||||
GLsizei.class, GLsizeiptrARB.class, GLsizeiptr.class, GLuint.class};
|
||||
else if (type.equals(FloatBuffer.class))
|
||||
return new Class[]{GLclampf.class, GLfloat.class};
|
||||
else if (type.equals(ByteBuffer.class))
|
||||
return new Class[]{GLboolean.class, GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class, GLvoid.class};
|
||||
else if (type.equals(ShortBuffer.class))
|
||||
return new Class[]{GLhalf.class, GLshort.class, GLushort.class};
|
||||
else if (type.equals(DoubleBuffer.class))
|
||||
return new Class[]{GLclampd.class, GLdouble.class};
|
||||
else
|
||||
return new Class[]{};
|
||||
}
|
||||
|
||||
private static Class[] getValidPrimitiveTypes(Class type) {
|
||||
if (type.equals(int.class))
|
||||
return new Class[]{GLbitfield.class, GLenum.class, GLhandleARB.class, GLint.class, GLintptrARB.class, GLuint.class,
|
||||
GLintptr.class, GLintptr.class, GLsizei.class, GLsizeiptrARB.class, GLsizeiptr.class};
|
||||
else if (type.equals(double.class))
|
||||
return new Class[]{GLclampd.class, GLdouble.class};
|
||||
else if (type.equals(float.class))
|
||||
return new Class[]{GLclampf.class, GLfloat.class};
|
||||
else if (type.equals(short.class))
|
||||
return new Class[]{GLhalf.class, GLshort.class, GLushort.class};
|
||||
else if (type.equals(byte.class))
|
||||
return new Class[]{GLbyte.class, GLcharARB.class, GLchar.class, GLubyte.class};
|
||||
else if (type.equals(boolean.class))
|
||||
return new Class[]{GLboolean.class};
|
||||
else if (type.equals(void.class))
|
||||
return new Class[]{GLvoid.class};
|
||||
else
|
||||
return new Class[]{};
|
||||
}
|
||||
|
||||
public String getTypedefPrefix() {
|
||||
return "APIENTRY";
|
||||
}
|
||||
|
||||
public void printNativeIncludes(PrintWriter writer) {
|
||||
writer.println("#include \"extgl.h\"");
|
||||
}
|
||||
|
||||
public Class[] getValidAnnotationTypes(Class type) {
|
||||
Class[] valid_types;
|
||||
if (Buffer.class.isAssignableFrom(type))
|
||||
valid_types = getValidBufferTypes(type);
|
||||
else if (type.isPrimitive())
|
||||
valid_types = getValidPrimitiveTypes(type);
|
||||
else if (String.class.equals(type))
|
||||
valid_types = new Class[]{GLubyte.class};
|
||||
else
|
||||
valid_types = new Class[]{};
|
||||
return valid_types;
|
||||
}
|
||||
|
||||
public Class getInverseType(Class type) {
|
||||
if (GLuint.class.equals(type))
|
||||
return GLint.class;
|
||||
else if (GLint.class.equals(type))
|
||||
return GLuint.class;
|
||||
else if (GLushort.class.equals(type))
|
||||
return GLshort.class;
|
||||
else if (GLshort.class.equals(type))
|
||||
return GLushort.class;
|
||||
else if (GLubyte.class.equals(type))
|
||||
return GLbyte.class;
|
||||
else if (GLbyte.class.equals(type))
|
||||
return GLubyte.class;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getAutoTypeFromAnnotation(AnnotationMirror annotation) {
|
||||
Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
|
||||
if (annotation_class.equals(GLint.class))
|
||||
return "GL11.GL_INT";
|
||||
else if (annotation_class.equals(GLbyte.class))
|
||||
return "GL11.GL_BYTE";
|
||||
else if (annotation_class.equals(GLshort.class))
|
||||
return "GL11.GL_SHORT";
|
||||
if (annotation_class.equals(GLuint.class))
|
||||
return "GL11.GL_UNSIGNED_INT";
|
||||
else if (annotation_class.equals(GLubyte.class))
|
||||
return "GL11.GL_UNSIGNED_BYTE";
|
||||
else if (annotation_class.equals(GLushort.class))
|
||||
return "GL11.GL_UNSIGNED_SHORT";
|
||||
else if (annotation_class.equals(GLfloat.class))
|
||||
return "GL11.GL_FLOAT";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLbitfield.java
Normal file
48
src/java/org/lwjgl/generator/GLbitfield.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLbitfield {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLboolean.java
Normal file
48
src/java/org/lwjgl/generator/GLboolean.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLboolean {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLbyte.java
Normal file
48
src/java/org/lwjgl/generator/GLbyte.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLbyte {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLchar.java
Normal file
48
src/java/org/lwjgl/generator/GLchar.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLchar {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLcharARB.java
Normal file
48
src/java/org/lwjgl/generator/GLcharARB.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLcharARB {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLclampd.java
Normal file
48
src/java/org/lwjgl/generator/GLclampd.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLclampd {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLclampf.java
Normal file
48
src/java/org/lwjgl/generator/GLclampf.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLclampf {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLdouble.java
Normal file
48
src/java/org/lwjgl/generator/GLdouble.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLdouble {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLenum.java
Normal file
48
src/java/org/lwjgl/generator/GLenum.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLenum {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLfloat.java
Normal file
48
src/java/org/lwjgl/generator/GLfloat.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLfloat {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLhalf.java
Normal file
48
src/java/org/lwjgl/generator/GLhalf.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLhalf {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLhandleARB.java
Normal file
48
src/java/org/lwjgl/generator/GLhandleARB.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLhandleARB {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLint.java
Normal file
48
src/java/org/lwjgl/generator/GLint.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLint {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLintptr.java
Normal file
48
src/java/org/lwjgl/generator/GLintptr.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLintptr {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLintptrARB.java
Normal file
48
src/java/org/lwjgl/generator/GLintptrARB.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLintptrARB {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLshort.java
Normal file
48
src/java/org/lwjgl/generator/GLshort.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLshort {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLsizei.java
Normal file
48
src/java/org/lwjgl/generator/GLsizei.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLsizei {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLsizeiptr.java
Normal file
48
src/java/org/lwjgl/generator/GLsizeiptr.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLsizeiptr {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLsizeiptrARB.java
Normal file
48
src/java/org/lwjgl/generator/GLsizeiptrARB.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLsizeiptrARB {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLubyte.java
Normal file
48
src/java/org/lwjgl/generator/GLubyte.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLubyte {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLuint.java
Normal file
48
src/java/org/lwjgl/generator/GLuint.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLuint {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLushort.java
Normal file
48
src/java/org/lwjgl/generator/GLushort.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLushort {
|
||||
}
|
||||
48
src/java/org/lwjgl/generator/GLvoid.java
Normal file
48
src/java/org/lwjgl/generator/GLvoid.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface GLvoid {
|
||||
}
|
||||
46
src/java/org/lwjgl/generator/GenerateAutos.java
Normal file
46
src/java/org/lwjgl/generator/GenerateAutos.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface GenerateAutos {
|
||||
}
|
||||
131
src/java/org/lwjgl/generator/GeneratorProcessorFactory.java
Normal file
131
src/java/org/lwjgl/generator/GeneratorProcessorFactory.java
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
import static com.sun.mirror.util.DeclarationVisitors.*;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* Generator tool for creating the java classes and native code
|
||||
* from an annotated template java interface.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class GeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener {
|
||||
private static boolean first_round = true;
|
||||
|
||||
// Process any set of annotations
|
||||
private static final Collection<String> supportedAnnotations =
|
||||
unmodifiableCollection(Arrays.asList("*"));
|
||||
|
||||
// No supported options
|
||||
private static final Collection<String> supportedOptions =
|
||||
unmodifiableCollection(Arrays.asList("-Anativeoutdir"));
|
||||
|
||||
public Collection<String> supportedAnnotationTypes() {
|
||||
return supportedAnnotations;
|
||||
}
|
||||
|
||||
public Collection<String> supportedOptions() {
|
||||
return supportedOptions;
|
||||
}
|
||||
|
||||
public void roundComplete(RoundCompleteEvent event) {
|
||||
first_round = false;
|
||||
}
|
||||
|
||||
public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
|
||||
// Only process the initial types, not the generated ones
|
||||
if (first_round) {
|
||||
env.addListener(this);
|
||||
return new GeneratorProcessor(env);
|
||||
}
|
||||
return AnnotationProcessors.NO_OP;
|
||||
}
|
||||
|
||||
private static class GeneratorProcessor implements AnnotationProcessor {
|
||||
private final AnnotationProcessorEnvironment env;
|
||||
|
||||
GeneratorProcessor(AnnotationProcessorEnvironment env) {
|
||||
this.env = env;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
Map<String, String> options = env.getOptions();
|
||||
String typemap_classname = null;
|
||||
boolean generate_error_checks = false;
|
||||
for (String k : options.keySet()) {
|
||||
int delimiter = k.indexOf('=');
|
||||
if (delimiter != -1) {
|
||||
if (k.startsWith("-Atypemap")) {
|
||||
typemap_classname = k.substring(delimiter + 1);
|
||||
}
|
||||
} else if (k.equals("-Ageneratechecks")) {
|
||||
generate_error_checks = true;
|
||||
}
|
||||
}
|
||||
if (typemap_classname == null)
|
||||
throw new RuntimeException("No TypeMap class name specified with -Atypemap=<class-name>");
|
||||
try {
|
||||
TypeMap type_map = (TypeMap)(Class.forName(typemap_classname).newInstance());
|
||||
for (TypeDeclaration typedecl : env.getSpecifiedTypeDeclarations()) {
|
||||
typedecl.accept(getDeclarationScanner(new GeneratorVisitor(env, type_map, generate_error_checks), NO_OP));
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InstantiationException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
242
src/java/org/lwjgl/generator/GeneratorVisitor.java
Normal file
242
src/java/org/lwjgl/generator/GeneratorVisitor.java
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* Generator visitor for the generator tool
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class GeneratorVisitor extends SimpleDeclarationVisitor {
|
||||
private final static String STUB_INITIALIZER_NAME = "initNativeStubs";
|
||||
|
||||
private final AnnotationProcessorEnvironment env;
|
||||
private final TypeMap type_map;
|
||||
private final boolean generate_error_checks;
|
||||
|
||||
public GeneratorVisitor(AnnotationProcessorEnvironment env, TypeMap type_map, boolean generate_error_checks) {
|
||||
this.env = env;
|
||||
this.type_map = type_map;
|
||||
this.generate_error_checks = generate_error_checks;
|
||||
}
|
||||
|
||||
private void validateMethods(InterfaceDeclaration d) {
|
||||
for (MethodDeclaration method : d.getMethods())
|
||||
validateMethod(method);
|
||||
}
|
||||
|
||||
private void validateMethod(MethodDeclaration method) {
|
||||
if (method.isVarArgs())
|
||||
throw new RuntimeException("Method " + method.getSimpleName() + " is variadic");
|
||||
Collection<Modifier> modifiers = method.getModifiers();
|
||||
if (!modifiers.contains(Modifier.PUBLIC))
|
||||
throw new RuntimeException("Method " + method.getSimpleName() + " is not public");
|
||||
if (method.getThrownTypes().size() > 0)
|
||||
throw new RuntimeException("Method " + method.getSimpleName() + " throws checked exceptions");
|
||||
validateParameters(method);
|
||||
StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
|
||||
if (strip_annotation != null) {
|
||||
String postfix_param_name = strip_annotation.value();
|
||||
ParameterDeclaration postfix_param = Utils.findParameter(method, postfix_param_name);
|
||||
if (Utils.isParameterMultiTyped(postfix_param))
|
||||
throw new RuntimeException("Postfix parameter can't be the same as a multityped parameter in method " + method);
|
||||
if (Utils.getNIOBufferType(postfix_param.getType()) == null)
|
||||
throw new RuntimeException("Postfix parameter type must be a nio Buffer");
|
||||
}
|
||||
if (Utils.getResultParameter(method) != null && !method.getReturnType().equals(env.getTypeUtils().getVoidType()))
|
||||
throw new RuntimeException(method + " return type is not void but a parameter is annotated with Result");
|
||||
if (method.getAnnotation(CachedResult.class) != null && Utils.getNIOBufferType(Utils.getMethodReturnType(method)) == null)
|
||||
throw new RuntimeException(method + " return type is not a Buffer, but is annotated with CachedResult");
|
||||
validateTypes(method, method.getAnnotationMirrors(), method.getReturnType());
|
||||
}
|
||||
|
||||
private void validateType(MethodDeclaration method, Class annotation_type, Class type) {
|
||||
Class[] valid_types = type_map.getValidAnnotationTypes(type);
|
||||
for (int i = 0; i < valid_types.length; i++)
|
||||
if (valid_types[i].equals(annotation_type))
|
||||
return;
|
||||
throw new RuntimeException(type + " is annotated with invalid native type " + annotation_type +
|
||||
" in method " + method);
|
||||
}
|
||||
|
||||
private void validateTypes(MethodDeclaration method, Collection<AnnotationMirror> annotations, TypeMirror type_mirror) {
|
||||
for (AnnotationMirror annotation : annotations) {
|
||||
NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
|
||||
if (native_type_annotation != null) {
|
||||
Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
|
||||
Class type = Utils.getJavaType(type_mirror);
|
||||
if (Buffer.class.equals(type))
|
||||
continue;
|
||||
validateType(method, annotation_type, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateParameters(MethodDeclaration method) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
validateTypes(method, param.getAnnotationMirrors(), param.getType());
|
||||
if (Utils.getNIOBufferType(param.getType()) != null) {
|
||||
Check parameter_check_annotation = param.getAnnotation(Check.class);
|
||||
NullTerminated null_terminated_annotation = param.getAnnotation(NullTerminated.class);
|
||||
if (parameter_check_annotation == null && null_terminated_annotation == null) {
|
||||
boolean found_auto_size_param = false;
|
||||
for (ParameterDeclaration inner_param : method.getParameters()) {
|
||||
AutoSize auto_size_annotation = inner_param.getAnnotation(AutoSize.class);
|
||||
if (auto_size_annotation != null &&
|
||||
auto_size_annotation.value().equals(param.getSimpleName())) {
|
||||
found_auto_size_param = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found_auto_size_param && param.getAnnotation(Result.class) == null)
|
||||
throw new RuntimeException(param + " has no Check, Result nor Constant annotation and no other parameters has" +
|
||||
" an @AutoSize annotation on it in method " + method);
|
||||
}
|
||||
if (param.getAnnotation(BufferObject.class) != null && param.getAnnotation(Result.class) != null)
|
||||
throw new RuntimeException(param + " can't be annotated with both BufferObject and Result");
|
||||
if (param.getAnnotation(Constant.class) != null)
|
||||
throw new RuntimeException("Buffer parameter " + param + " cannot be Constant");
|
||||
} else {
|
||||
if (param.getAnnotation(BufferObject.class) != null)
|
||||
throw new RuntimeException(param + " type is not a buffer, but annotated as a BufferObject");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void generateMethodsNativePointers(PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
|
||||
for (MethodDeclaration method : methods)
|
||||
generateMethodNativePointers(writer, method);
|
||||
}
|
||||
|
||||
private static void generateMethodNativePointers(PrintWriter writer, MethodDeclaration method) {
|
||||
writer.println("static " + method.getSimpleName() + TypedefsGenerator.TYPEDEF_POSTFIX + " " + method.getSimpleName() + ";");
|
||||
}
|
||||
|
||||
private void generateJavaSource(InterfaceDeclaration d) throws IOException {
|
||||
validateMethods(d);
|
||||
PrintWriter java_writer = env.getFiler().createSourceFile(Utils.getQualifiedClassName(d));
|
||||
java_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
|
||||
java_writer.println();
|
||||
java_writer.println("package " + d.getPackage().getQualifiedName() + ";");
|
||||
java_writer.println();
|
||||
java_writer.println("import org.lwjgl.LWJGLException;");
|
||||
java_writer.println("import org.lwjgl.BufferChecks;");
|
||||
java_writer.println("import java.nio.*;");
|
||||
java_writer.println();
|
||||
java_writer.print("public ");
|
||||
Extension extension_annotation = d.getAnnotation(Extension.class);
|
||||
boolean is_final = extension_annotation == null || extension_annotation.isFinal();
|
||||
if (is_final)
|
||||
java_writer.write("final ");
|
||||
java_writer.print("class " + Utils.getSimpleClassName(d));
|
||||
Collection<InterfaceType> super_interfaces = d.getSuperinterfaces();
|
||||
if (super_interfaces.size() > 1)
|
||||
throw new RuntimeException(d + " extends more than one interface");
|
||||
if (super_interfaces.size() == 1) {
|
||||
InterfaceDeclaration super_interface = super_interfaces.iterator().next().getDeclaration();
|
||||
java_writer.print(" extends " + Utils.getSimpleClassName(super_interface));
|
||||
}
|
||||
java_writer.println(" {");
|
||||
FieldsGenerator.generateFields(java_writer, d.getFields());
|
||||
java_writer.println();
|
||||
if (is_final) {
|
||||
// Write private constructor to avoid instantiation
|
||||
java_writer.println("\tprivate " + Utils.getSimpleClassName(d) + "() {");
|
||||
java_writer.println("\t}");
|
||||
java_writer.println();
|
||||
}
|
||||
if (d.getMethods().size() > 0)
|
||||
java_writer.println("\tstatic native void " + STUB_INITIALIZER_NAME + "() throws LWJGLException;");
|
||||
JavaMethodsGenerator.generateMethodsJava(env, type_map, java_writer, d, generate_error_checks);
|
||||
java_writer.println("}");
|
||||
java_writer.close();
|
||||
String qualified_interface_name = Utils.getQualifiedClassName(d);
|
||||
env.getMessager().printNotice("Generated class " + qualified_interface_name);
|
||||
}
|
||||
|
||||
private void generateNativeSource(InterfaceDeclaration d) throws IOException {
|
||||
String qualified_interface_name = Utils.getQualifiedClassName(d);
|
||||
String qualified_native_name = Utils.getNativeQualifiedName(qualified_interface_name)+ ".c";
|
||||
PrintWriter native_writer = env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File(qualified_native_name), "UTF-8");
|
||||
native_writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */");
|
||||
native_writer.println();
|
||||
native_writer.println("#include <jni.h>");
|
||||
type_map.printNativeIncludes(native_writer);
|
||||
native_writer.println();
|
||||
TypedefsGenerator.generateNativeTypedefs(type_map, native_writer, d.getMethods());
|
||||
native_writer.println();
|
||||
generateMethodsNativePointers(native_writer, d.getMethods());
|
||||
native_writer.println();
|
||||
NativeMethodStubsGenerator.generateNativeMethodStubs(env, type_map, native_writer, d, generate_error_checks);
|
||||
native_writer.print("JNIEXPORT void JNICALL " + Utils.getQualifiedNativeMethodName(qualified_interface_name, STUB_INITIALIZER_NAME));
|
||||
native_writer.println("(JNIEnv *env, jclass clazz) {");
|
||||
native_writer.println("\tJavaMethodAndExtFunction functions[] = {");
|
||||
RegisterStubsGenerator.generateMethodsNativeStubBind(native_writer, d, generate_error_checks);
|
||||
native_writer.println("\t};");
|
||||
native_writer.println("\tint num_functions = NUMFUNCTIONS(functions);");
|
||||
native_writer.print("\t");
|
||||
native_writer.print(type_map.getRegisterNativesFunctionName());
|
||||
native_writer.println("(env, clazz, num_functions, functions);");
|
||||
native_writer.println("}");
|
||||
native_writer.close();
|
||||
env.getMessager().printNotice("Generated C source " + qualified_interface_name);
|
||||
}
|
||||
|
||||
public void visitInterfaceDeclaration(InterfaceDeclaration d) {
|
||||
try {
|
||||
generateJavaSource(d);
|
||||
if (d.getMethods().size() > 0) {
|
||||
generateNativeSource(d);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
src/java/org/lwjgl/generator/Indirect.java
Normal file
49
src/java/org/lwjgl/generator/Indirect.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* Implies that a parameter is indirect, and forces the native
|
||||
* stub to use the indirection operator '&' on it.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface Indirect {
|
||||
}
|
||||
135
src/java/org/lwjgl/generator/JNITypeTranslator.java
Normal file
135
src/java/org/lwjgl/generator/JNITypeTranslator.java
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates TypeMirrors to JNI
|
||||
* type strings.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class JNITypeTranslator implements TypeVisitor {
|
||||
private final StringBuilder signature = new StringBuilder();
|
||||
|
||||
public String getSignature() {
|
||||
return signature.toString();
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitArrayType(ArrayType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
signature.append("jobject");
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitEnumType(EnumType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitInterfaceType(InterfaceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitPrimitiveType(PrimitiveType t) {
|
||||
String type;
|
||||
switch (t.getKind()) {
|
||||
case INT:
|
||||
type = "jint";
|
||||
break;
|
||||
case FLOAT:
|
||||
type = "jfloat";
|
||||
break;
|
||||
case SHORT:
|
||||
type = "jshort";
|
||||
break;
|
||||
case BYTE:
|
||||
type = "jbyte";
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = "jdouble";
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = "jboolean";
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
signature.append(type);
|
||||
}
|
||||
|
||||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeVariable(TypeVariable t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitVoidType(VoidType t) {
|
||||
signature.append(t.toString());
|
||||
}
|
||||
|
||||
public void visitWildcardType(WildcardType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
}
|
||||
416
src/java/org/lwjgl/generator/JavaMethodsGenerator.java
Normal file
416
src/java/org/lwjgl/generator/JavaMethodsGenerator.java
Normal file
|
|
@ -0,0 +1,416 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This class generates the methods in the generated java source files.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class JavaMethodsGenerator {
|
||||
public static void generateMethodsJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, boolean generate_error_checks) {
|
||||
for (MethodDeclaration method : interface_decl.getMethods())
|
||||
generateMethodJava(env, type_map, writer, interface_decl, method, generate_error_checks);
|
||||
}
|
||||
|
||||
private static void generateMethodJava(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, boolean generate_error_checks) {
|
||||
writer.println();
|
||||
if (Utils.isMethodIndirect(generate_error_checks, method)) {
|
||||
if (method.getAnnotation(GenerateAutos.class) != null) {
|
||||
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.AUTOS, generate_error_checks);
|
||||
}
|
||||
Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = TypeInfo.getTypeInfoCrossProduct(type_map, method);
|
||||
for (Map<ParameterDeclaration, TypeInfo> typeinfos_instance : cross_product) {
|
||||
printMethodWithMultiType(env, type_map, writer, interface_decl, method, typeinfos_instance, Mode.NORMAL, generate_error_checks);
|
||||
}
|
||||
}
|
||||
printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks);
|
||||
if (Utils.hasMethodBufferObjectParameter(method)) {
|
||||
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.BUFFEROBJECT, generate_error_checks);
|
||||
printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks);
|
||||
}
|
||||
}
|
||||
|
||||
private static void printJavaNativeStub(PrintWriter writer, MethodDeclaration method, Mode mode, boolean generate_error_checks) {
|
||||
if (Utils.isMethodIndirect(generate_error_checks, method)) {
|
||||
writer.print("\tprivate static native ");
|
||||
} else {
|
||||
Utils.printDocComment(writer, method);
|
||||
writer.print("\tpublic static native ");
|
||||
}
|
||||
printResultType(writer, method);
|
||||
writer.print(" " + Utils.getSimpleNativeMethodName(method, generate_error_checks));
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
|
||||
writer.print("(");
|
||||
generateParametersJava(writer, method, TypeInfo.getDefaultTypeInfoMap(method), true, mode);
|
||||
writer.println(");");
|
||||
}
|
||||
|
||||
private static void generateParametersJava(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance,
|
||||
boolean native_stub, Mode mode) {
|
||||
boolean first_parameter = true;
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
AnnotationMirror auto_annotation_mirror = Utils.getParameterAutoAnnotation(param);
|
||||
boolean hide_auto_parameter = mode == Mode.NORMAL && !native_stub && auto_annotation_mirror != null;
|
||||
if (hide_auto_parameter) {
|
||||
AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
|
||||
if (auto_type_annotation != null) {
|
||||
ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_type_annotation.value());
|
||||
TypeInfo auto_param_type_info = typeinfos_instance.get(auto_parameter);
|
||||
if (auto_param_type_info.getSignedness() == Signedness.BOTH) {
|
||||
if (!first_parameter)
|
||||
writer.print(", ");
|
||||
writer.print("boolean " + TypeInfo.UNSIGNED_PARAMETER_NAME);
|
||||
}
|
||||
}
|
||||
} else if (param.getAnnotation(Result.class) == null && (native_stub || param.getAnnotation(Constant.class) == null) &&
|
||||
(getAutoTypeParameter(method, param) == null || mode != Mode.AUTOS)) {
|
||||
TypeInfo type_info = typeinfos_instance.get(param);
|
||||
first_parameter = generateParameterJava(writer, param, type_info, native_stub, first_parameter, mode);
|
||||
}
|
||||
}
|
||||
TypeMirror result_type = Utils.getMethodReturnType(method);
|
||||
if (Utils.getNIOBufferType(result_type) != null) {
|
||||
writer.print(", int " + Utils.RESULT_SIZE_NAME);
|
||||
if (method.getAnnotation(CachedResult.class) != null) {
|
||||
writer.print(", ");
|
||||
printResultType(writer, method);
|
||||
writer.print(" " + Utils.CACHED_BUFFER_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean generateParameterJava(PrintWriter writer, ParameterDeclaration param, TypeInfo type_info, boolean native_stub, boolean first_parameter, Mode mode) {
|
||||
Class buffer_type = Utils.getNIOBufferType(param.getType());
|
||||
if (!first_parameter)
|
||||
writer.print(", ");
|
||||
BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
|
||||
if (bo_annotation != null && mode == Mode.BUFFEROBJECT) {
|
||||
if (buffer_type == null)
|
||||
throw new RuntimeException("type of " + param + " is not a nio Buffer parameter but is annotated as buffer object");
|
||||
writer.print("int " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
|
||||
} else {
|
||||
writer.print(type_info.getType().getSimpleName());
|
||||
writer.print(" " + param.getSimpleName());
|
||||
if (buffer_type != null && native_stub)
|
||||
writer.print(", int " + param.getSimpleName() + NativeMethodStubsGenerator.BUFFER_POSITION_POSTFIX);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void printBufferObjectCheck(PrintWriter writer, BufferKind kind, Mode mode) {
|
||||
String bo_check_method_name = kind.toString();
|
||||
writer.print("\t\tGLBufferChecks.ensure" + bo_check_method_name);
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print("enabled");
|
||||
else
|
||||
writer.print("disabled");
|
||||
writer.println("();");
|
||||
}
|
||||
|
||||
private static void printBufferObjectChecks(PrintWriter writer, MethodDeclaration method, Mode mode) {
|
||||
EnumSet<BufferKind> check_set = EnumSet.noneOf(BufferKind.class);
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
|
||||
if (bo_annotation != null)
|
||||
check_set.add(bo_annotation.value());
|
||||
}
|
||||
for (BufferKind kind : check_set)
|
||||
printBufferObjectCheck(writer, kind, mode);
|
||||
}
|
||||
|
||||
private static void printMethodWithMultiType(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean generate_error_checks) {
|
||||
Utils.printDocComment(writer, method);
|
||||
writer.print("\tpublic static ");
|
||||
printResultType(writer, method);
|
||||
StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
|
||||
String method_name = method.getSimpleName();
|
||||
if (strip_annotation != null) {
|
||||
ParameterDeclaration postfix_parameter = Utils.findParameter(method, strip_annotation.value());
|
||||
if (mode == Mode.NORMAL)
|
||||
method_name = getPostfixStrippedName(type_map, interface_decl, method);
|
||||
}
|
||||
writer.print(" " + method_name + "(");
|
||||
generateParametersJava(writer, method, typeinfos_instance, false, mode);
|
||||
TypeMirror result_type = Utils.getMethodReturnType(method);
|
||||
writer.println(") {");
|
||||
printBufferObjectChecks(writer, method, mode);
|
||||
printParameterChecks(writer, method, mode);
|
||||
Code code_annotation = method.getAnnotation(Code.class);
|
||||
if (code_annotation != null)
|
||||
writer.println(code_annotation.value());
|
||||
writer.print("\t\t");
|
||||
boolean has_result = !result_type.equals(env.getTypeUtils().getVoidType());
|
||||
if (has_result) {
|
||||
printResultType(writer, method);
|
||||
writer.print(" " + Utils.RESULT_VAR_NAME + " = ");
|
||||
}
|
||||
writer.print(Utils.getSimpleNativeMethodName(method, generate_error_checks));
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
|
||||
writer.print("(");
|
||||
printMethodCallArguments(writer, method, typeinfos_instance, mode);
|
||||
writer.println(");");
|
||||
if (generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null)
|
||||
writer.println("\t\t" + type_map.getErrorCheckMethodName() + ";");
|
||||
if (has_result)
|
||||
writer.println("\t\treturn " + Utils.RESULT_VAR_NAME + ";");
|
||||
writer.println("\t}");
|
||||
}
|
||||
|
||||
private static String getExtensionPostfix(InterfaceDeclaration interface_decl) {
|
||||
String interface_simple_name = interface_decl.getSimpleName();
|
||||
Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
|
||||
if (extension_annotation == null) {
|
||||
int underscore_index = interface_simple_name.indexOf("_");
|
||||
if (underscore_index != -1)
|
||||
return interface_simple_name.substring(0, underscore_index);
|
||||
else
|
||||
return "";
|
||||
} else
|
||||
return extension_annotation.postfix();
|
||||
}
|
||||
|
||||
private static ParameterDeclaration getAutoTypeParameter(MethodDeclaration method, ParameterDeclaration target_parameter) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
|
||||
if (auto_annotation != null) {
|
||||
Class annotation_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
|
||||
String parameter_name;
|
||||
if (annotation_type.equals(AutoType.class))
|
||||
parameter_name = param.getAnnotation(AutoType.class).value();
|
||||
else if (annotation_type.equals(AutoSize.class))
|
||||
parameter_name = param.getAnnotation(AutoSize.class).value();
|
||||
else
|
||||
throw new RuntimeException("Unkown annotation type " + annotation_type);
|
||||
if (target_parameter.getSimpleName().equals(parameter_name))
|
||||
return param;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean hasAnyParameterAutoTypeAnnotation(MethodDeclaration method, ParameterDeclaration target_param) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
|
||||
if (auto_type_annotation != null) {
|
||||
ParameterDeclaration type_target_param = Utils.findParameter(method, auto_type_annotation.value());
|
||||
if (target_param.equals(type_target_param))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static String getPostfixStrippedName(TypeMap type_map, InterfaceDeclaration interface_decl, MethodDeclaration method) {
|
||||
StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
|
||||
ParameterDeclaration postfix_parameter = Utils.findParameter(method, strip_annotation.value());
|
||||
PostfixTranslator translator = new PostfixTranslator(type_map, postfix_parameter);
|
||||
postfix_parameter.getType().accept(translator);
|
||||
String postfix = translator.getSignature();
|
||||
String method_name = method.getSimpleName();
|
||||
String extension_postfix = getExtensionPostfix(interface_decl);
|
||||
String result;
|
||||
if (method_name.endsWith(postfix + "v" + extension_postfix))
|
||||
result = method_name.substring(0, method_name.length() - (postfix.length() + 1 + extension_postfix.length()));
|
||||
else if (method_name.endsWith(postfix + extension_postfix))
|
||||
result = method_name.substring(0, method_name.length() - (postfix.length() + extension_postfix.length()));
|
||||
else if (method_name.endsWith("v" + extension_postfix))
|
||||
result = method_name.substring(0, method_name.length() - (1 + extension_postfix.length()));
|
||||
else
|
||||
throw new RuntimeException(method + " is specified as being postfix stripped on parameter " + postfix_parameter + ", but it's postfix is not '" + postfix + "' nor 'v'");
|
||||
return result + extension_postfix;
|
||||
}
|
||||
|
||||
private static int getBufferElementSizeExponent(Class c) {
|
||||
if (IntBuffer.class.equals(c))
|
||||
return 2;
|
||||
else if (LongBuffer.class.equals(c))
|
||||
return 3;
|
||||
else if (DoubleBuffer.class.equals(c))
|
||||
return 3;
|
||||
else if (ShortBuffer.class.equals(c))
|
||||
return 1;
|
||||
else if (ByteBuffer.class.equals(c))
|
||||
return 0;
|
||||
else if (FloatBuffer.class.equals(c))
|
||||
return 2;
|
||||
else
|
||||
throw new RuntimeException(c + " is not allowed");
|
||||
}
|
||||
|
||||
private static boolean printMethodCallArgument(PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode, boolean first_parameter) {
|
||||
if (!first_parameter)
|
||||
writer.print(", ");
|
||||
AnnotationMirror auto_annotation = Utils.getParameterAutoAnnotation(param);
|
||||
Constant constant_annotation = param.getAnnotation(Constant.class);
|
||||
if (constant_annotation != null) {
|
||||
writer.print(constant_annotation.value());
|
||||
} else if (auto_annotation != null && mode == Mode.NORMAL) {
|
||||
Class param_type = NativeTypeTranslator.getClassFromType(auto_annotation.getAnnotationType());
|
||||
if (AutoType.class.equals(param_type)) {
|
||||
AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
|
||||
String auto_parameter_name = auto_type_annotation.value();
|
||||
ParameterDeclaration auto_parameter = Utils.findParameter(method, auto_parameter_name);
|
||||
String auto_type = typeinfos_instance.get(auto_parameter).getAutoType();
|
||||
if (auto_type == null)
|
||||
throw new RuntimeException("No auto type for parameter " + param.getSimpleName() + " in method " + method);
|
||||
writer.print(auto_type);
|
||||
} else if (AutoSize.class.equals(param_type)) {
|
||||
AutoSize auto_type_annotation = param.getAnnotation(AutoSize.class);
|
||||
String auto_parameter_name = auto_type_annotation.value();
|
||||
ParameterDeclaration auto_target_param = Utils.findParameter(method, auto_parameter_name);
|
||||
TypeInfo auto_target_type_info = typeinfos_instance.get(auto_target_param);
|
||||
writer.print("(" + auto_parameter_name + ".remaining()");
|
||||
// Shift the remaining if the target parameter is multityped and there's no AutoType to track type
|
||||
boolean shift_remaining = !hasAnyParameterAutoTypeAnnotation(method, auto_target_param) && Utils.isParameterMultiTyped(auto_target_param);
|
||||
if (shift_remaining) {
|
||||
int shifting = getBufferElementSizeExponent(auto_target_type_info.getType());
|
||||
if (shifting > 0)
|
||||
writer.print(" << " + shifting);
|
||||
}
|
||||
writer.print(")");
|
||||
writer.print(auto_type_annotation.expression());
|
||||
} else
|
||||
throw new RuntimeException("Unknown auto annotation " + param_type);
|
||||
} else {
|
||||
if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
|
||||
writer.print(param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
|
||||
} else {
|
||||
boolean hide_buffer = mode == Mode.AUTOS && getAutoTypeParameter(method, param) != null;
|
||||
if (hide_buffer)
|
||||
writer.print("null");
|
||||
else
|
||||
writer.print(param.getSimpleName());
|
||||
Class buffer_type = Utils.getNIOBufferType(param.getType());
|
||||
if (buffer_type != null) {
|
||||
writer.print(", ");
|
||||
if (!hide_buffer) {
|
||||
TypeInfo type_info = typeinfos_instance.get(param);
|
||||
Check check_annotation = param.getAnnotation(Check.class);
|
||||
int shifting;
|
||||
if (Utils.getNIOBufferType(param.getType()).equals(Buffer.class))
|
||||
shifting = getBufferElementSizeExponent(type_info.getType());
|
||||
else
|
||||
shifting = 0;
|
||||
writer.print(param.getSimpleName());
|
||||
if (check_annotation != null && check_annotation.canBeNull())
|
||||
writer.print(" != null ? " + param.getSimpleName());
|
||||
writer.print(".position()");
|
||||
if (shifting > 0)
|
||||
writer.print(" << " + shifting);
|
||||
if (check_annotation != null && check_annotation.canBeNull())
|
||||
writer.print(" : 0");
|
||||
} else
|
||||
writer.print("0");
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void printMethodCallArguments(PrintWriter writer, MethodDeclaration method, Map<ParameterDeclaration, TypeInfo> typeinfos_instance, Mode mode) {
|
||||
Collection<ParameterDeclaration> params = method.getParameters();
|
||||
boolean first_parameter = true;
|
||||
for (ParameterDeclaration param : method.getParameters())
|
||||
if (param.getAnnotation(Result.class) == null) {
|
||||
first_parameter = printMethodCallArgument(writer, method, param, typeinfos_instance, mode, first_parameter);
|
||||
}
|
||||
TypeMirror result_type = Utils.getMethodReturnType(method);
|
||||
if (Utils.getNIOBufferType(result_type) != null) {
|
||||
Utils.printExtraCallArguments(writer, method);
|
||||
}
|
||||
}
|
||||
|
||||
private static void printParameterChecks(PrintWriter writer, MethodDeclaration method, Mode mode) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
Class java_type = Utils.getJavaType(param.getType());
|
||||
if (Utils.isAddressableType(java_type) &&
|
||||
(mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
|
||||
(mode != Mode.AUTOS || getAutoTypeParameter(method, param) == null) &&
|
||||
param.getAnnotation(Result.class) == null) {
|
||||
String check_value = null;
|
||||
boolean can_be_null = false;
|
||||
Check check_annotation = param.getAnnotation(Check.class);
|
||||
if (check_annotation != null) {
|
||||
check_value = check_annotation.value();
|
||||
can_be_null = check_annotation.canBeNull();
|
||||
}
|
||||
boolean null_terminated = param.getAnnotation(NullTerminated.class) != null;
|
||||
if (Buffer.class.isAssignableFrom(java_type)) {
|
||||
printParameterCheck(writer, param.getSimpleName(), check_value, can_be_null, null_terminated);
|
||||
} else if (String.class.equals(java_type)) {
|
||||
if (!can_be_null)
|
||||
writer.println("\t\tBufferChecks.checkNotNull(" + param.getSimpleName() + ");");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method.getAnnotation(CachedResult.class) != null)
|
||||
printParameterCheck(writer, Utils.CACHED_BUFFER_NAME, null, true, false);
|
||||
}
|
||||
|
||||
private static void printParameterCheck(PrintWriter writer, String name, String check_value, boolean can_be_null, boolean null_terminated) {
|
||||
if (can_be_null) {
|
||||
writer.println("\t\tif (" + name + " != null)");
|
||||
writer.print("\t");
|
||||
}
|
||||
writer.print("\t\tBufferChecks.check");
|
||||
if (check_value != null && !check_value.equals("")) {
|
||||
writer.print("Buffer(" + name + ", " + check_value);
|
||||
} else {
|
||||
writer.print("Direct");
|
||||
writer.print("(" + name);
|
||||
}
|
||||
writer.println(");");
|
||||
if (null_terminated)
|
||||
writer.println("\t\tBufferChecks.checkNullTerminated(" + name + ");");
|
||||
}
|
||||
|
||||
private static void printResultType(PrintWriter writer, MethodDeclaration method) {
|
||||
writer.print(Utils.getMethodReturnType(method).toString());
|
||||
}
|
||||
}
|
||||
136
src/java/org/lwjgl/generator/JavaTypeTranslator.java
Normal file
136
src/java/org/lwjgl/generator/JavaTypeTranslator.java
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates (annotated) TypeMirrors to
|
||||
* java types (represented by a Class)
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class JavaTypeTranslator implements TypeVisitor {
|
||||
private Class type;
|
||||
|
||||
public Class getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitArrayType(ArrayType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitPrimitiveType(PrimitiveType t) {
|
||||
switch (t.getKind()) {
|
||||
case INT:
|
||||
type = int.class;
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = double.class;
|
||||
break;
|
||||
case FLOAT:
|
||||
type = float.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = short.class;
|
||||
break;
|
||||
case BYTE:
|
||||
type = byte.class;
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = boolean.class;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(t.getKind() + " is not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitEnumType(EnumType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
type = NativeTypeTranslator.getClassFromType(t);
|
||||
}
|
||||
|
||||
public void visitInterfaceType(InterfaceType t) {
|
||||
type = NativeTypeTranslator.getClassFromType(t);
|
||||
}
|
||||
|
||||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeVariable(TypeVariable t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitVoidType(VoidType t) {
|
||||
type = void.class;
|
||||
}
|
||||
|
||||
public void visitWildcardType(WildcardType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
}
|
||||
47
src/java/org/lwjgl/generator/Mode.java
Normal file
47
src/java/org/lwjgl/generator/Mode.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public enum Mode {
|
||||
BUFFEROBJECT,
|
||||
AUTOS,
|
||||
NORMAL
|
||||
}
|
||||
215
src/java/org/lwjgl/generator/NativeMethodStubsGenerator.java
Normal file
215
src/java/org/lwjgl/generator/NativeMethodStubsGenerator.java
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This class generates the functions in the native source files.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class NativeMethodStubsGenerator {
|
||||
private final static String BUFFER_ADDRESS_POSTFIX = "_address";
|
||||
public final static String BUFFER_POSITION_POSTFIX = "_position";
|
||||
|
||||
public static void generateNativeMethodStubs(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks) {
|
||||
for (MethodDeclaration method : d.getMethods()) {
|
||||
generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.NORMAL, generate_error_checks);
|
||||
if (Utils.hasMethodBufferObjectParameter(method))
|
||||
generateMethodStub(env, type_map, writer, Utils.getQualifiedClassName(d), method, Mode.BUFFEROBJECT, generate_error_checks);
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateParameters(PrintWriter writer, Collection<ParameterDeclaration> params, Mode mode) {
|
||||
for (ParameterDeclaration param : params)
|
||||
if (param.getAnnotation(Result.class) == null)
|
||||
generateParameter(writer, param, mode);
|
||||
}
|
||||
|
||||
private static void generateParameter(PrintWriter writer, ParameterDeclaration param, Mode mode) {
|
||||
writer.print(", ");
|
||||
if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
|
||||
writer.print("jint " + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateMethodStub(AnnotationProcessorEnvironment env, TypeMap type_map, PrintWriter writer, String interface_name, MethodDeclaration method, Mode mode, boolean generate_error_checks) {
|
||||
TypeMirror result_type = Utils.getMethodReturnType(method);
|
||||
JNITypeTranslator translator = new JNITypeTranslator();
|
||||
result_type.accept(translator);
|
||||
writer.print("static " + translator.getSignature() + " JNICALL ");
|
||||
writer.print(Utils.getQualifiedNativeMethodName(interface_name, method, generate_error_checks));
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
|
||||
writer.print("(JNIEnv *env, jclass clazz");
|
||||
generateParameters(writer, method.getParameters(), mode);
|
||||
if (Utils.getNIOBufferType(result_type) != null) {
|
||||
writer.print(", jint " + Utils.RESULT_SIZE_NAME);
|
||||
if (method.getAnnotation(CachedResult.class) != null)
|
||||
writer.print(", jobject " + Utils.CACHED_BUFFER_NAME);
|
||||
}
|
||||
writer.println(") {");
|
||||
generateBufferParameterAddresses(type_map, writer, method, mode);
|
||||
writer.print("\t");
|
||||
if (!result_type.equals(env.getTypeUtils().getVoidType())) {
|
||||
Declaration return_declaration;
|
||||
ParameterDeclaration result_param = Utils.getResultParameter(method);
|
||||
if (result_param != null)
|
||||
return_declaration = result_param;
|
||||
else
|
||||
return_declaration = method;
|
||||
NativeTypeTranslator native_translator = new NativeTypeTranslator(type_map, return_declaration);
|
||||
result_type.accept(native_translator);
|
||||
writer.print(native_translator.getSignature() + " " + Utils.RESULT_VAR_NAME);
|
||||
if (result_param != null) {
|
||||
writer.println(";");
|
||||
writer.print("\t");
|
||||
} else
|
||||
writer.print(" = ");
|
||||
}
|
||||
writer.print(method.getSimpleName() + "(");
|
||||
generateCallParameters(writer, method.getParameters());
|
||||
writer.print(")");
|
||||
writer.println(";");
|
||||
generateStringDeallocations(writer, method.getParameters());
|
||||
if (!result_type.equals(env.getTypeUtils().getVoidType())) {
|
||||
writer.print("\treturn ");
|
||||
Class java_result_type = Utils.getJavaType(result_type);
|
||||
if (Buffer.class.isAssignableFrom(java_result_type)) {
|
||||
if (method.getAnnotation(CachedResult.class) != null)
|
||||
writer.print("safeNewBufferCached(env, ");
|
||||
else
|
||||
writer.print("safeNewBuffer(env, ");
|
||||
} else if (String.class.equals(java_result_type))
|
||||
writer.print("NewStringNative(env, ");
|
||||
writer.print(Utils.RESULT_VAR_NAME);
|
||||
if (Buffer.class.isAssignableFrom(java_result_type)) {
|
||||
Utils.printExtraCallArguments(writer, method);
|
||||
writer.print(")");
|
||||
} else if (String.class.equals(java_result_type))
|
||||
writer.print(")");
|
||||
writer.println(";");
|
||||
}
|
||||
writer.println("}");
|
||||
writer.println();
|
||||
}
|
||||
|
||||
private static void generateCallParameters(PrintWriter writer, Collection<ParameterDeclaration> params) {
|
||||
if (params.size() > 0) {
|
||||
Iterator<ParameterDeclaration> it = params.iterator();
|
||||
generateCallParameter(writer, it.next());
|
||||
while (it.hasNext()) {
|
||||
writer.print(", ");
|
||||
generateCallParameter(writer, it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateCallParameter(PrintWriter writer, ParameterDeclaration param) {
|
||||
if (param.getAnnotation(Result.class) != null || param.getAnnotation(Indirect.class) != null)
|
||||
writer.print("&");
|
||||
if (param.getAnnotation(Result.class) != null) {
|
||||
writer.print(Utils.RESULT_VAR_NAME);
|
||||
} else {
|
||||
writer.print(param.getSimpleName());
|
||||
if (Utils.isAddressableType(param.getType())) {
|
||||
writer.print(BUFFER_ADDRESS_POSTFIX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateStringDeallocations(PrintWriter writer, Collection<ParameterDeclaration> params) {
|
||||
for (ParameterDeclaration param : params)
|
||||
if (Utils.getJavaType(param.getType()).equals(String.class) &&
|
||||
param.getAnnotation(Result.class) == null)
|
||||
writer.println("\tfree(" + param.getSimpleName() + BUFFER_ADDRESS_POSTFIX + ");");
|
||||
}
|
||||
|
||||
private static void generateBufferParameterAddresses(TypeMap type_map, PrintWriter writer, MethodDeclaration method, Mode mode) {
|
||||
for (ParameterDeclaration param : method.getParameters())
|
||||
if (Utils.isAddressableType(param.getType()) &&
|
||||
param.getAnnotation(Result.class) == null)
|
||||
generateBufferParameterAddress(type_map, writer, method, param, mode);
|
||||
}
|
||||
|
||||
private static void generateBufferParameterAddress(TypeMap type_map, PrintWriter writer, MethodDeclaration method, ParameterDeclaration param, Mode mode) {
|
||||
NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
|
||||
param.getType().accept(translator);
|
||||
writer.print("\t" + translator.getSignature() + param.getSimpleName());
|
||||
writer.print(BUFFER_ADDRESS_POSTFIX + " = ((");
|
||||
writer.print(translator.getSignature());
|
||||
Check check_annotation = param.getAnnotation(Check.class);
|
||||
writer.print(")");
|
||||
if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
|
||||
writer.print("offsetToPointer(" + param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX + "))");
|
||||
} else {
|
||||
Class java_type = Utils.getJavaType(param.getType());
|
||||
if (Buffer.class.isAssignableFrom(java_type)) {
|
||||
boolean explicitly_byte_sized = java_type.equals(Buffer.class);
|
||||
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("))");
|
||||
} else if (java_type.equals(String.class)) {
|
||||
writer.print("GetStringNativeChars(env, " + param.getSimpleName() + "))");
|
||||
} else
|
||||
throw new RuntimeException("Illegal type " + java_type);
|
||||
}
|
||||
writer.println(";");
|
||||
}
|
||||
}
|
||||
50
src/java/org/lwjgl/generator/NativeType.java
Normal file
50
src/java/org/lwjgl/generator/NativeType.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation indicates that another annotation is
|
||||
* a native type.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.type.PrimitiveType;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
public @interface NativeType {
|
||||
}
|
||||
210
src/java/org/lwjgl/generator/NativeTypeTranslator.java
Normal file
210
src/java/org/lwjgl/generator/NativeTypeTranslator.java
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates types (and optional native type
|
||||
* annotations) to the native type string.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates (annotated) TypeMirrors to
|
||||
* native types
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class NativeTypeTranslator implements TypeVisitor {
|
||||
private Collection<Class> native_types;
|
||||
private boolean is_indirect;
|
||||
private final Declaration declaration;
|
||||
private final TypeMap type_map;
|
||||
|
||||
public NativeTypeTranslator(TypeMap type_map, Declaration declaration) {
|
||||
this.declaration = declaration;
|
||||
this.type_map = type_map;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
StringBuilder signature = new StringBuilder();
|
||||
if (declaration.getAnnotation(Const.class) != null)
|
||||
signature.append("const ");
|
||||
if (native_types.size() != 1)
|
||||
throw new RuntimeException("Expected only one native type for declaration " + declaration +
|
||||
", but got " + native_types.size());
|
||||
// Use the name of the native type annotation as the C type name
|
||||
signature.append(native_types.iterator().next().getSimpleName());
|
||||
if (is_indirect)
|
||||
signature.append(" *");
|
||||
return signature.toString();
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitArrayType(ArrayType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
|
||||
if (IntBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.INT;
|
||||
else if (DoubleBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.DOUBLE;
|
||||
else if (ShortBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.SHORT;
|
||||
else if (ByteBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.BYTE;
|
||||
else if (FloatBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.FLOAT;
|
||||
else
|
||||
throw new RuntimeException(c + " is not allowed");
|
||||
}
|
||||
|
||||
public static Class<?> getClassFromType(DeclaredType t) {
|
||||
try {
|
||||
return Class.forName(t.getDeclaration().getQualifiedName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void getNativeTypeFromAnnotatedPrimitiveType(PrimitiveType.Kind kind) {
|
||||
native_types = translateAnnotations();
|
||||
if (native_types.size() == 0)
|
||||
native_types.add(type_map.getNativeTypeFromPrimitiveType(kind));
|
||||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
Class<?> c = getClassFromType(t);
|
||||
if (String.class.equals(c)) {
|
||||
native_types = new ArrayList<Class>();
|
||||
native_types.add(type_map.getStringElementType());
|
||||
} else if (Buffer.class.equals(c)) {
|
||||
native_types = new ArrayList<Class>();
|
||||
native_types.add(type_map.getVoidType());
|
||||
} else if (Buffer.class.isAssignableFrom(c)) {
|
||||
PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
|
||||
getNativeTypeFromAnnotatedPrimitiveType(kind);
|
||||
} else
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
is_indirect = true;
|
||||
}
|
||||
|
||||
public void visitPrimitiveType(PrimitiveType t) {
|
||||
getNativeTypeFromAnnotatedPrimitiveType(t.getKind());
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitEnumType(EnumType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitInterfaceType(InterfaceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
// Check if the annotation is itself annotated with a certain annotation type
|
||||
public static <T extends Annotation> T getAnnotation(AnnotationMirror annotation, Class<T> type) {
|
||||
return annotation.getAnnotationType().getDeclaration().getAnnotation(type);
|
||||
}
|
||||
|
||||
private Class translateAnnotation(AnnotationMirror annotation) {
|
||||
NativeType native_type = getAnnotation(annotation, NativeType.class);
|
||||
if (native_type != null) {
|
||||
return getClassFromType(annotation.getAnnotationType());
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
private Collection<Class> translateAnnotations() {
|
||||
Collection<Class> result = new ArrayList<Class>();
|
||||
for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors())) {
|
||||
Class translated_result = translateAnnotation(annotation);
|
||||
if (translated_result != null) {
|
||||
result.add(translated_result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeVariable(TypeVariable t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitVoidType(VoidType t) {
|
||||
native_types = translateAnnotations();
|
||||
if (native_types.size() == 0)
|
||||
native_types.add(void.class);
|
||||
}
|
||||
|
||||
public void visitWildcardType(WildcardType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
}
|
||||
49
src/java/org/lwjgl/generator/NoErrorCheck.java
Normal file
49
src/java/org/lwjgl/generator/NoErrorCheck.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation implies that a method should not include
|
||||
* error checking even if it is enabled.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface NoErrorCheck {
|
||||
}
|
||||
49
src/java/org/lwjgl/generator/NullTerminated.java
Normal file
49
src/java/org/lwjgl/generator/NullTerminated.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation implies that a Buffer argument should be
|
||||
* checked for a trailing '\0'
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface NullTerminated {
|
||||
}
|
||||
82
src/java/org/lwjgl/generator/Platform.java
Normal file
82
src/java/org/lwjgl/generator/Platform.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public enum Platform {
|
||||
WGL,
|
||||
GLX,
|
||||
ALL;
|
||||
|
||||
public void printPrologue(PrintWriter writer) {
|
||||
if (this == ALL)
|
||||
return;
|
||||
writer.print("#ifdef ");
|
||||
switch (this) {
|
||||
case WGL:
|
||||
writer.println("_WIN32");
|
||||
break;
|
||||
case GLX:
|
||||
writer.println("_X11");
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(this + " is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
public void printEpilogue(PrintWriter writer) {
|
||||
if (this == ALL)
|
||||
return;
|
||||
writer.println("#endif");
|
||||
}
|
||||
|
||||
public String getPostfix() {
|
||||
switch (this) {
|
||||
case WGL:
|
||||
return "wgl";
|
||||
case GLX:
|
||||
return "glX";
|
||||
case ALL:
|
||||
return "gl";
|
||||
default:
|
||||
throw new RuntimeException(this + " is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
51
src/java/org/lwjgl/generator/PlatformDependent.java
Normal file
51
src/java/org/lwjgl/generator/PlatformDependent.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation implies that the corresponding native
|
||||
* function symbol is named after the platform specific
|
||||
* window system (glX, wgl, ...)
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface PlatformDependent {
|
||||
Platform[] value();
|
||||
}
|
||||
187
src/java/org/lwjgl/generator/PostfixTranslator.java
Normal file
187
src/java/org/lwjgl/generator/PostfixTranslator.java
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates (annotated) TypeMirrors to
|
||||
* postfixes.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
public class PostfixTranslator implements TypeVisitor {
|
||||
private final StringBuilder signature = new StringBuilder();
|
||||
private final Declaration declaration;
|
||||
private final TypeMap type_map;
|
||||
|
||||
public PostfixTranslator(TypeMap type_map, Declaration declaration) {
|
||||
this.declaration = declaration;
|
||||
this.type_map = type_map;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature.toString();
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitArrayType(ArrayType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
private static PrimitiveType.Kind getPrimitiveKindFromBufferClass(Class c) {
|
||||
if (IntBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.INT;
|
||||
else if (DoubleBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.DOUBLE;
|
||||
else if (ShortBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.SHORT;
|
||||
else if (ByteBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.BYTE;
|
||||
else if (FloatBuffer.class.equals(c))
|
||||
return PrimitiveType.Kind.FLOAT;
|
||||
else
|
||||
throw new RuntimeException(c + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
Class<?> c = NativeTypeTranslator.getClassFromType(t);
|
||||
PrimitiveType.Kind kind = getPrimitiveKindFromBufferClass(c);
|
||||
visitPrimitiveTypeKind(kind);
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitEnumType(EnumType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitInterfaceType(InterfaceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
private boolean translateAnnotation(AnnotationMirror annotation) {
|
||||
NativeType native_type = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
|
||||
if (native_type != null) {
|
||||
Class annotation_class = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
|
||||
signature.append(type_map.translateAnnotation(annotation_class));
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean translateAnnotations() {
|
||||
boolean result = false;
|
||||
for (AnnotationMirror annotation : Utils.getSortedAnnotations(declaration.getAnnotationMirrors()))
|
||||
if (translateAnnotation(annotation)) {
|
||||
if (result)
|
||||
throw new RuntimeException("Multiple native types");
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void visitPrimitiveType(PrimitiveType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
private void visitPrimitiveTypeKind(PrimitiveType.Kind kind) {
|
||||
boolean annotated_translation = translateAnnotations();
|
||||
if (annotated_translation)
|
||||
return;
|
||||
// No annotation type was specified, fall back to default
|
||||
String type;
|
||||
switch (kind) {
|
||||
case INT:
|
||||
type = "i";
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = "d";
|
||||
break;
|
||||
case FLOAT:
|
||||
type = "f";
|
||||
break;
|
||||
case SHORT:
|
||||
type = "s";
|
||||
break;
|
||||
case BYTE:
|
||||
type = "b";
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
signature.append(type);
|
||||
}
|
||||
|
||||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeVariable(TypeVariable t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitVoidType(VoidType t) {
|
||||
}
|
||||
|
||||
public void visitWildcardType(WildcardType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
}
|
||||
120
src/java/org/lwjgl/generator/RegisterStubsGenerator.java
Normal file
120
src/java/org/lwjgl/generator/RegisterStubsGenerator.java
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This class generates the initNatives native function.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class RegisterStubsGenerator {
|
||||
public static void generateMethodsNativeStubBind(PrintWriter writer, InterfaceDeclaration d, boolean generate_error_checks) {
|
||||
Iterator<? extends MethodDeclaration> it = d.getMethods().iterator();
|
||||
while (it.hasNext()) {
|
||||
MethodDeclaration method = it.next();
|
||||
EnumSet<Platform> platforms;
|
||||
PlatformDependent platform_annotation = method.getAnnotation(PlatformDependent.class);
|
||||
if (platform_annotation != null)
|
||||
platforms = EnumSet.copyOf(Arrays.asList(platform_annotation.value()));
|
||||
else
|
||||
platforms = EnumSet.of(Platform.ALL);
|
||||
for (Platform platform : platforms) {
|
||||
platform.printPrologue(writer);
|
||||
boolean has_buffer_parameter = Utils.hasMethodBufferObjectParameter(method);
|
||||
printMethodNativeStubBind(writer, d, method, platform, Mode.NORMAL, it.hasNext() || has_buffer_parameter, generate_error_checks);
|
||||
if (has_buffer_parameter) {
|
||||
printMethodNativeStubBind(writer, d, method, platform, Mode.BUFFEROBJECT, it.hasNext(), generate_error_checks);
|
||||
}
|
||||
platform.printEpilogue(writer);
|
||||
}
|
||||
}
|
||||
writer.println();
|
||||
}
|
||||
|
||||
private static String getTypeSignature(TypeMirror type, boolean add_position_signature) {
|
||||
SignatureTranslator v = new SignatureTranslator(add_position_signature);
|
||||
type.accept(v);
|
||||
return v.getSignature();
|
||||
}
|
||||
|
||||
private static String getMethodSignature(MethodDeclaration method, Mode mode) {
|
||||
Collection<ParameterDeclaration> params = method.getParameters();
|
||||
String signature = "(";
|
||||
for (ParameterDeclaration param : params) {
|
||||
if (param.getAnnotation(Result.class) != null)
|
||||
continue;
|
||||
if (mode == Mode.BUFFEROBJECT && param.getAnnotation(BufferObject.class) != null) {
|
||||
signature += "I";
|
||||
} else {
|
||||
signature += getTypeSignature(param.getType(), true);
|
||||
}
|
||||
}
|
||||
TypeMirror result_type = Utils.getMethodReturnType(method);
|
||||
if (Utils.getNIOBufferType(result_type) != null)
|
||||
signature += "I";
|
||||
String result_type_signature = getTypeSignature(result_type, false);
|
||||
if (method.getAnnotation(CachedResult.class) != null)
|
||||
signature += result_type_signature;
|
||||
signature += ")";
|
||||
signature += result_type_signature;
|
||||
return signature;
|
||||
}
|
||||
|
||||
private static void printMethodNativeStubBind(PrintWriter writer, InterfaceDeclaration d, MethodDeclaration method, Platform platform, Mode mode, boolean has_more, boolean generate_error_checks) {
|
||||
writer.print("\t\t{\"" + Utils.getSimpleNativeMethodName(method, generate_error_checks));
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
|
||||
writer.print("\", \"" + getMethodSignature(method, mode) + "\", (void *)&");
|
||||
writer.print(Utils.getQualifiedNativeMethodName(Utils.getQualifiedClassName(d), method, generate_error_checks));
|
||||
if (mode == Mode.BUFFEROBJECT)
|
||||
writer.print(Utils.BUFFER_OBJECT_METHOD_POSTFIX);
|
||||
String opengl_handle_name = method.getSimpleName().replaceFirst("gl", platform.getPostfix());
|
||||
writer.print(", \"" + opengl_handle_name + "\", (void *)&" + method.getSimpleName() + "}");
|
||||
if (has_more)
|
||||
writer.println(",");
|
||||
}
|
||||
|
||||
}
|
||||
49
src/java/org/lwjgl/generator/Result.java
Normal file
49
src/java/org/lwjgl/generator/Result.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation indicates that the method result is in the
|
||||
* specified parameter.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
public @interface Result {
|
||||
}
|
||||
145
src/java/org/lwjgl/generator/SignatureTranslator.java
Normal file
145
src/java/org/lwjgl/generator/SignatureTranslator.java
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that translates types to JNI signatures.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
class SignatureTranslator implements TypeVisitor {
|
||||
private final boolean add_position_signature;
|
||||
private final StringBuilder signature = new StringBuilder();
|
||||
|
||||
public SignatureTranslator(boolean add_position_signature) {
|
||||
this.add_position_signature = add_position_signature;
|
||||
}
|
||||
|
||||
private static String getNativeNameFromClassName(String class_name) {
|
||||
return class_name.replaceAll("\\.", "/");
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature.toString();
|
||||
}
|
||||
|
||||
public void visitAnnotationType(AnnotationType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitArrayType(ArrayType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitClassType(ClassType t) {
|
||||
String type_name = getNativeNameFromClassName(t.getDeclaration().getQualifiedName());
|
||||
signature.append("L");
|
||||
signature.append(type_name);
|
||||
signature.append(";");
|
||||
if (add_position_signature && Buffer.class.isAssignableFrom(NativeTypeTranslator.getClassFromType(t))) {
|
||||
signature.append("I");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitDeclaredType(DeclaredType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitEnumType(EnumType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitInterfaceType(InterfaceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitPrimitiveType(PrimitiveType t) {
|
||||
String type;
|
||||
switch (t.getKind()) {
|
||||
case BOOLEAN:
|
||||
signature.append("Z");
|
||||
break;
|
||||
case INT:
|
||||
signature.append("I");
|
||||
break;
|
||||
case FLOAT:
|
||||
signature.append("F");
|
||||
break;
|
||||
case SHORT:
|
||||
signature.append("S");
|
||||
break;
|
||||
case DOUBLE:
|
||||
signature.append("D");
|
||||
break;
|
||||
case BYTE:
|
||||
signature.append("B");
|
||||
break;
|
||||
case LONG:
|
||||
signature.append("J");
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Unsupported type " + t);
|
||||
}
|
||||
}
|
||||
|
||||
public void visitReferenceType(ReferenceType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeMirror(TypeMirror t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitTypeVariable(TypeVariable t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
|
||||
public void visitVoidType(VoidType t) {
|
||||
signature.append("V");
|
||||
}
|
||||
|
||||
public void visitWildcardType(WildcardType t) {
|
||||
throw new RuntimeException(t + " is not allowed");
|
||||
}
|
||||
}
|
||||
46
src/java/org/lwjgl/generator/Signedness.java
Normal file
46
src/java/org/lwjgl/generator/Signedness.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
public enum Signedness {
|
||||
SIGNED,
|
||||
UNSIGNED,
|
||||
NONE,
|
||||
BOTH
|
||||
}
|
||||
50
src/java/org/lwjgl/generator/StripPostfix.java
Normal file
50
src/java/org/lwjgl/generator/StripPostfix.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This annotation implies that a method have its postfix stripped
|
||||
* according to a specified Buffer parameter.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface StripPostfix {
|
||||
String value(); // The parameter to deduce the postfix from
|
||||
}
|
||||
216
src/java/org/lwjgl/generator/TypeInfo.java
Normal file
216
src/java/org/lwjgl/generator/TypeInfo.java
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This class represent a parameter configuration. There are multiple
|
||||
* TypeInfos in case of multityped parameters.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public class TypeInfo {
|
||||
public final static String UNSIGNED_PARAMETER_NAME = "unsigned";
|
||||
|
||||
private final Signedness signedness;
|
||||
private final Class type;
|
||||
private final String auto_type;
|
||||
|
||||
private TypeInfo(Class type, Signedness signedness, String auto_type) {
|
||||
this.type = type;
|
||||
this.signedness = signedness;
|
||||
this.auto_type = auto_type;
|
||||
}
|
||||
|
||||
public Class getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public Signedness getSignedness() {
|
||||
return signedness;
|
||||
}
|
||||
|
||||
public String getAutoType() {
|
||||
if (auto_type == null)
|
||||
throw new RuntimeException("No auto type assigned");
|
||||
return auto_type;
|
||||
}
|
||||
|
||||
private static Class getTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
|
||||
Class type;
|
||||
switch (kind) {
|
||||
case INT:
|
||||
type = int.class;
|
||||
break;
|
||||
case FLOAT:
|
||||
type = float.class;
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = double.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = short.class;
|
||||
break;
|
||||
case BYTE:
|
||||
type = byte.class;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
private static Class getBufferTypeFromPrimitiveKind(PrimitiveType.Kind kind) {
|
||||
Class type;
|
||||
switch (kind) {
|
||||
case INT:
|
||||
type = IntBuffer.class;
|
||||
break;
|
||||
case FLOAT:
|
||||
type = FloatBuffer.class;
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = DoubleBuffer.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = ShortBuffer.class;
|
||||
break;
|
||||
case BYTE: /* fall through */
|
||||
case BOOLEAN:
|
||||
type = ByteBuffer.class;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException(kind + " is not allowed");
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
private static TypeInfo getDefaultTypeInfo(TypeMirror t) {
|
||||
Class java_type = Utils.getJavaType(t);
|
||||
return new TypeInfo(java_type, Signedness.NONE, null);
|
||||
}
|
||||
|
||||
public static Map<ParameterDeclaration, TypeInfo> getDefaultTypeInfoMap(MethodDeclaration method) {
|
||||
Map<ParameterDeclaration, TypeInfo> map = new HashMap<ParameterDeclaration, TypeInfo>();
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
TypeInfo type_info = getDefaultTypeInfo(param.getType());
|
||||
map.put(param, type_info);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Collection<TypeInfo> getTypeInfos(TypeMap type_map, Declaration param, TypeMirror decl_type) {
|
||||
Collection<AnnotationMirror> annotations = Utils.getSortedAnnotations(param.getAnnotationMirrors());
|
||||
Map<Class, TypeInfo> types = new HashMap<Class, TypeInfo>();
|
||||
boolean add_default_type = true;
|
||||
for (AnnotationMirror annotation : annotations) {
|
||||
NativeType native_type_annotation = NativeTypeTranslator.getAnnotation(annotation, NativeType.class);
|
||||
if (native_type_annotation != null) {
|
||||
Class annotation_type = NativeTypeTranslator.getClassFromType(annotation.getAnnotationType());
|
||||
Signedness signedness = type_map.getSignednessFromType(annotation_type);
|
||||
Class inverse_type = type_map.getInverseType(annotation_type);
|
||||
String auto_type = type_map.getAutoTypeFromAnnotation(annotation);
|
||||
if (inverse_type != null) {
|
||||
if (types.containsKey(inverse_type)) {
|
||||
String inverse_auto_type = types.get(inverse_type).getAutoType();
|
||||
auto_type = signedness == Signedness.UNSIGNED ? auto_type + " : " + inverse_auto_type :
|
||||
inverse_auto_type + " : " + auto_type;
|
||||
auto_type = UNSIGNED_PARAMETER_NAME + " ? " + auto_type;
|
||||
signedness = Signedness.BOTH;
|
||||
types.remove(inverse_type);
|
||||
}
|
||||
}
|
||||
Class type;
|
||||
PrimitiveType.Kind kind = type_map.getPrimitiveTypeFromNativeType(annotation_type);
|
||||
if (Utils.getNIOBufferType(decl_type) != null)
|
||||
type = getBufferTypeFromPrimitiveKind(kind);
|
||||
else
|
||||
type = getTypeFromPrimitiveKind(kind);
|
||||
types.put(annotation_type, new TypeInfo(type, signedness, auto_type));
|
||||
add_default_type = false;
|
||||
}
|
||||
}
|
||||
if (add_default_type) {
|
||||
TypeInfo default_type_info = getDefaultTypeInfo(decl_type);
|
||||
Collection<TypeInfo> result = new ArrayList<TypeInfo>();
|
||||
result.add(default_type_info);
|
||||
return result;
|
||||
} else
|
||||
return types.values();
|
||||
}
|
||||
|
||||
private static Map<ParameterDeclaration, Collection<TypeInfo>> getTypeInfoMap(TypeMap type_map, MethodDeclaration method) {
|
||||
Map<ParameterDeclaration, Collection<TypeInfo>> map = new HashMap<ParameterDeclaration, Collection<TypeInfo>>();
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
Collection<TypeInfo> types = getTypeInfos(type_map, param, param.getType());
|
||||
map.put(param, types);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Collection<Map<ParameterDeclaration, TypeInfo>> getTypeInfoCrossProduct(TypeMap type_map, MethodDeclaration method) {
|
||||
Collection<ParameterDeclaration> parameter_collection = method.getParameters();
|
||||
ParameterDeclaration[] parameters = new ParameterDeclaration[parameter_collection.size()];
|
||||
parameter_collection.toArray(parameters);
|
||||
Collection<Map<ParameterDeclaration, TypeInfo>> cross_product = new ArrayList<Map<ParameterDeclaration, TypeInfo>>();
|
||||
getCrossProductRecursive(0, parameters, getTypeInfoMap(type_map, method),
|
||||
new HashMap<ParameterDeclaration, TypeInfo>(), cross_product);
|
||||
return cross_product;
|
||||
}
|
||||
|
||||
private static void getCrossProductRecursive(int index, ParameterDeclaration[] parameters, Map<ParameterDeclaration,
|
||||
Collection<TypeInfo>> typeinfos_map, HashMap<ParameterDeclaration, TypeInfo> current_instance,
|
||||
Collection<Map<ParameterDeclaration, TypeInfo>> cross_product) {
|
||||
if (index == parameters.length) {
|
||||
cross_product.add(current_instance);
|
||||
return;
|
||||
}
|
||||
ParameterDeclaration param = parameters[index];
|
||||
Collection<TypeInfo> typeinfos = typeinfos_map.get(param);
|
||||
if (typeinfos != null) {
|
||||
for (TypeInfo typeinfo : typeinfos) {
|
||||
HashMap<ParameterDeclaration, TypeInfo> instance = (HashMap<ParameterDeclaration, TypeInfo>)current_instance.clone();
|
||||
instance.put(param, typeinfo);
|
||||
getCrossProductRecursive(index + 1, parameters, typeinfos_map, instance, cross_product);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/java/org/lwjgl/generator/TypeMap.java
Normal file
67
src/java/org/lwjgl/generator/TypeMap.java
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* The interface to the OpenAL/OpenGL specific generator behaviour
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.nio.*;
|
||||
|
||||
public interface TypeMap {
|
||||
public String getErrorCheckMethodName();
|
||||
public String getRegisterNativesFunctionName();
|
||||
public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type);
|
||||
public String getTypedefPrefix();
|
||||
public void printNativeIncludes(PrintWriter writer);
|
||||
public Class getStringElementType();
|
||||
public Class[] getValidAnnotationTypes(Class type);
|
||||
public Class getVoidType();
|
||||
public String translateAnnotation(Class annotation_type);
|
||||
public Class getNativeTypeFromPrimitiveType(PrimitiveType.Kind kind);
|
||||
public String getAutoTypeFromAnnotation(AnnotationMirror annotation);
|
||||
public Class getInverseType(Class type);
|
||||
public Signedness getSignednessFromType(Class type);
|
||||
}
|
||||
93
src/java/org/lwjgl/generator/TypedefsGenerator.java
Normal file
93
src/java/org/lwjgl/generator/TypedefsGenerator.java
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* A TypeVisitor that generates the native typedefs.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class TypedefsGenerator {
|
||||
public final static String TYPEDEF_POSTFIX = "PROC";
|
||||
|
||||
private static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, MethodDeclaration method) {
|
||||
TypeMirror return_type = method.getReturnType();
|
||||
writer.print("typedef ");
|
||||
NativeTypeTranslator translator = new NativeTypeTranslator(type_map, method);
|
||||
return_type.accept(translator);
|
||||
writer.print(translator.getSignature());
|
||||
writer.print(" (");
|
||||
writer.print(type_map.getTypedefPrefix());
|
||||
writer.print(" *" + method.getSimpleName() + TYPEDEF_POSTFIX + ") (");
|
||||
generateNativeTypedefsParameters(type_map, writer, method.getParameters());
|
||||
writer.println(");");
|
||||
}
|
||||
|
||||
private static void generateNativeTypedefsParameters(TypeMap type_map, PrintWriter writer, Collection<ParameterDeclaration> params) {
|
||||
if (params.size() > 0) {
|
||||
Iterator<ParameterDeclaration> it = params.iterator();
|
||||
generateNativeTypedefsParameter(type_map, writer, it.next());
|
||||
while (it.hasNext()) {
|
||||
writer.print(", ");
|
||||
generateNativeTypedefsParameter(type_map, writer, it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateNativeTypedefsParameter(TypeMap type_map, PrintWriter writer, ParameterDeclaration param) {
|
||||
NativeTypeTranslator translator = new NativeTypeTranslator(type_map, param);
|
||||
param.getType().accept(translator);
|
||||
writer.print(translator.getSignature());
|
||||
if (param.getAnnotation(Result.class) != null || param.getAnnotation(Indirect.class) != null)
|
||||
writer.print("*");
|
||||
writer.print(" " + param.getSimpleName());
|
||||
}
|
||||
|
||||
public static void generateNativeTypedefs(TypeMap type_map, PrintWriter writer, Collection<? extends MethodDeclaration> methods) {
|
||||
for (MethodDeclaration method : methods)
|
||||
generateNativeTypedefs(type_map, writer, method);
|
||||
}
|
||||
|
||||
}
|
||||
236
src/java/org/lwjgl/generator/Utils.java
Normal file
236
src/java/org/lwjgl/generator/Utils.java
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* Various utility methods to the generator.
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import com.sun.mirror.type.*;
|
||||
import java.nio.Buffer;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.type.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
public class Utils {
|
||||
public final static String BUFFER_OBJECT_METHOD_POSTFIX = "BO";
|
||||
public final static String BUFFER_OBJECT_PARAMETER_POSTFIX = "_buffer_offset";
|
||||
public final static String RESULT_SIZE_NAME = "result_size";
|
||||
public final static String RESULT_VAR_NAME = "__result";
|
||||
public final static String CACHED_BUFFER_NAME = "old_buffer";
|
||||
private final static String OVERLOADED_METHOD_PREFIX = "n";
|
||||
|
||||
private static class AnnotationMirrorComparator implements Comparator<AnnotationMirror> {
|
||||
public int compare(AnnotationMirror a1, AnnotationMirror a2) {
|
||||
String n1 = a1.getAnnotationType().getDeclaration().getQualifiedName();
|
||||
String n2 = a2.getAnnotationType().getDeclaration().getQualifiedName();
|
||||
int result = n1.compareTo(n2);
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean equals(AnnotationMirror a1, AnnotationMirror a2) {
|
||||
return compare(a1, a2) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static Collection<AnnotationMirror> getSortedAnnotations(Collection<AnnotationMirror> annotations) {
|
||||
List<AnnotationMirror> annotation_list = new ArrayList<AnnotationMirror>(annotations);
|
||||
Collections.sort(annotation_list, new AnnotationMirrorComparator());
|
||||
return annotation_list;
|
||||
}
|
||||
|
||||
public static boolean isAddressableType(TypeMirror type) {
|
||||
return isAddressableType(getJavaType(type));
|
||||
}
|
||||
|
||||
public static boolean isAddressableType(Class type) {
|
||||
return Buffer.class.isAssignableFrom(type) || String.class.equals(type);
|
||||
}
|
||||
|
||||
public static Class getJavaType(TypeMirror type_mirror) {
|
||||
JavaTypeTranslator translator = new JavaTypeTranslator();
|
||||
type_mirror.accept(translator);
|
||||
return translator.getType();
|
||||
}
|
||||
|
||||
private static boolean hasParameterMultipleTypes(ParameterDeclaration param) {
|
||||
int num_native_annotations = 0;
|
||||
for (AnnotationMirror annotation : param.getAnnotationMirrors())
|
||||
if (NativeTypeTranslator.getAnnotation(annotation, NativeType.class) != null)
|
||||
num_native_annotations++;
|
||||
return num_native_annotations > 1;
|
||||
}
|
||||
|
||||
public static boolean isParameterMultiTyped(ParameterDeclaration param) {
|
||||
boolean result = Buffer.class.equals(Utils.getJavaType(param.getType()));
|
||||
if (!result && hasParameterMultipleTypes(param))
|
||||
throw new RuntimeException(param + " not defined as java.nio.Buffer but has multiple types");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ParameterDeclaration findParameter(MethodDeclaration method, String name) {
|
||||
for (ParameterDeclaration param : method.getParameters())
|
||||
if (param.getSimpleName().equals(name))
|
||||
return param;
|
||||
throw new RuntimeException("Parameter " + name + " not found");
|
||||
}
|
||||
|
||||
public static void printDocComment(PrintWriter writer, Declaration decl) {
|
||||
String doc_comment = decl.getDocComment();
|
||||
if (doc_comment != null) {
|
||||
writer.println("\t/**");
|
||||
StringTokenizer doc_lines = new StringTokenizer(doc_comment, "\n");
|
||||
while (doc_lines.hasMoreTokens())
|
||||
writer.println("\t *" + doc_lines.nextToken());
|
||||
writer.println("\t */");
|
||||
}
|
||||
}
|
||||
|
||||
public static AnnotationMirror getParameterAutoAnnotation(ParameterDeclaration param) {
|
||||
for (AnnotationMirror annotation : param.getAnnotationMirrors())
|
||||
if (NativeTypeTranslator.getAnnotation(annotation, Auto.class) != null)
|
||||
return annotation;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isMethodIndirect(boolean generate_error_checks, MethodDeclaration method) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
if (isAddressableType(param.getType()) || getParameterAutoAnnotation(param) != null ||
|
||||
param.getAnnotation(Constant.class) != null)
|
||||
return true;
|
||||
}
|
||||
return hasMethodBufferObjectParameter(method) || method.getAnnotation(Code.class) != null ||
|
||||
method.getAnnotation(CachedResult.class) != null ||
|
||||
(generate_error_checks && method.getAnnotation(NoErrorCheck.class) == null);
|
||||
}
|
||||
|
||||
public static String getNativeQualifiedName(String qualified_name) {
|
||||
return qualified_name.replaceAll("\\.", "_");
|
||||
}
|
||||
|
||||
public static String getQualifiedNativeMethodName(String qualified_class_name, String method_name) {
|
||||
return "Java_" + getNativeQualifiedName(qualified_class_name) + "_" + method_name;
|
||||
}
|
||||
|
||||
public static String getQualifiedNativeMethodName(String qualified_class_name, MethodDeclaration method, boolean generate_error_checks) {
|
||||
String method_name = getSimpleNativeMethodName(method, generate_error_checks);
|
||||
return getQualifiedNativeMethodName(qualified_class_name, method_name);
|
||||
}
|
||||
|
||||
public static ParameterDeclaration getResultParameter(MethodDeclaration method) {
|
||||
ParameterDeclaration result_param = null;
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
if (param.getAnnotation(Result.class) != null) {
|
||||
if (result_param != null)
|
||||
throw new RuntimeException("Multiple parameters annotated with Result in method " + method);
|
||||
result_param = param;
|
||||
}
|
||||
}
|
||||
return result_param;
|
||||
}
|
||||
|
||||
public static TypeMirror getMethodReturnType(MethodDeclaration method) {
|
||||
TypeMirror result_type;
|
||||
ParameterDeclaration result_param = getResultParameter(method);
|
||||
if (result_param != null) {
|
||||
result_type = result_param.getType();
|
||||
} else
|
||||
result_type = method.getReturnType();
|
||||
return result_type;
|
||||
}
|
||||
|
||||
public static void printExtraCallArguments(PrintWriter writer, MethodDeclaration method) {
|
||||
writer.print(", " + RESULT_SIZE_NAME);
|
||||
if (method.getAnnotation(CachedResult.class) != null) {
|
||||
writer.print(", " + CACHED_BUFFER_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getClassName(InterfaceDeclaration interface_decl, String opengl_name) {
|
||||
Extension extension_annotation = interface_decl.getAnnotation(Extension.class);
|
||||
if (extension_annotation != null && !extension_annotation.className().equals("")) {
|
||||
return extension_annotation.className();
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < opengl_name.length(); i++) {
|
||||
int ch = opengl_name.codePointAt(i);
|
||||
if (ch == '_') {
|
||||
i++;
|
||||
result.appendCodePoint(Character.toUpperCase(opengl_name.codePointAt(i)));
|
||||
} else
|
||||
result.appendCodePoint(ch);
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static boolean hasMethodBufferObjectParameter(MethodDeclaration method) {
|
||||
for (ParameterDeclaration param : method.getParameters()) {
|
||||
if (param.getAnnotation(BufferObject.class) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getQualifiedClassName(InterfaceDeclaration interface_decl) {
|
||||
return interface_decl.getPackage().getQualifiedName() + "." + getSimpleClassName(interface_decl);
|
||||
}
|
||||
|
||||
public static String getSimpleClassName(InterfaceDeclaration interface_decl) {
|
||||
return getClassName(interface_decl, interface_decl.getSimpleName());
|
||||
}
|
||||
|
||||
public static Class<?> getNIOBufferType(TypeMirror t) {
|
||||
Class<?> param_type = getJavaType(t);
|
||||
if (Buffer.class.isAssignableFrom(param_type))
|
||||
return param_type;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getSimpleNativeMethodName(MethodDeclaration method, boolean generate_error_checks) {
|
||||
String method_name = method.getSimpleName();
|
||||
if (isMethodIndirect(generate_error_checks, method))
|
||||
method_name = OVERLOADED_METHOD_PREFIX + method_name;
|
||||
return method_name;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -49,6 +49,13 @@ public class OpenALException extends RuntimeException {
|
|||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that takes an AL error number
|
||||
*/
|
||||
public OpenALException(int error_code) {
|
||||
super("OpenAL error: " + AL10.alGetString(error_code) + " (" + error_code + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for OpenALException.
|
||||
* @param message
|
||||
|
|
|
|||
55
src/java/org/lwjgl/openal/Util.java
Normal file
55
src/java/org/lwjgl/openal/Util.java
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.openal;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
||||
/**
|
||||
* Simple utility class.
|
||||
*
|
||||
* @author cix_foo <cix_foo@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
public final class Util {
|
||||
/** No c'tor */
|
||||
private Util() {
|
||||
}
|
||||
|
||||
public static void checkALError() {
|
||||
int err = AL10.alGetError();
|
||||
if (err != AL10.AL_NO_ERROR)
|
||||
throw new OpenALException(err);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,192 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.BufferChecks;
|
||||
import org.lwjgl.LWJGLException;
|
||||
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public abstract class ARBBufferObject {
|
||||
|
||||
/*
|
||||
* Accepted by the <usage> parameter of BufferDataARB:
|
||||
*/
|
||||
public static final int GL_STREAM_DRAW_ARB = 0x88E0;
|
||||
public static final int GL_STREAM_READ_ARB = 0x88E1;
|
||||
public static final int GL_STREAM_COPY_ARB = 0x88E2;
|
||||
public static final int GL_STATIC_DRAW_ARB = 0x88E4;
|
||||
public static final int GL_STATIC_READ_ARB = 0x88E5;
|
||||
public static final int GL_STATIC_COPY_ARB = 0x88E6;
|
||||
public static final int GL_DYNAMIC_DRAW_ARB = 0x88E8;
|
||||
public static final int GL_DYNAMIC_READ_ARB = 0x88E9;
|
||||
public static final int GL_DYNAMIC_COPY_ARB = 0x88EA;
|
||||
|
||||
/*
|
||||
* Accepted by the <access> parameter of MapBufferARB:
|
||||
*/
|
||||
public static final int GL_READ_ONLY_ARB = 0x88B8;
|
||||
public static final int GL_WRITE_ONLY_ARB = 0x88B9;
|
||||
public static final int GL_READ_WRITE_ARB = 0x88BA;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetBufferParameterivARB:
|
||||
*/
|
||||
public static final int GL_BUFFER_SIZE_ARB = 0x8764;
|
||||
public class ARBBufferObject {
|
||||
public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88bd;
|
||||
public static final int GL_BUFFER_MAPPED_ARB = 0x88bc;
|
||||
public static final int GL_BUFFER_ACCESS_ARB = 0x88bb;
|
||||
public static final int GL_BUFFER_USAGE_ARB = 0x8765;
|
||||
public static final int GL_BUFFER_ACCESS_ARB = 0x88BB;
|
||||
public static final int GL_BUFFER_MAPPED_ARB = 0x88BC;
|
||||
public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD;
|
||||
public static final int GL_BUFFER_SIZE_ARB = 0x8764;
|
||||
public static final int GL_READ_WRITE_ARB = 0x88ba;
|
||||
public static final int GL_WRITE_ONLY_ARB = 0x88b9;
|
||||
public static final int GL_READ_ONLY_ARB = 0x88b8;
|
||||
public static final int GL_DYNAMIC_COPY_ARB = 0x88ea;
|
||||
public static final int GL_DYNAMIC_READ_ARB = 0x88e9;
|
||||
public static final int GL_DYNAMIC_DRAW_ARB = 0x88e8;
|
||||
public static final int GL_STATIC_COPY_ARB = 0x88e6;
|
||||
public static final int GL_STATIC_READ_ARB = 0x88e5;
|
||||
public static final int GL_STATIC_DRAW_ARB = 0x88e4;
|
||||
public static final int GL_STREAM_COPY_ARB = 0x88e2;
|
||||
public static final int GL_STREAM_READ_ARB = 0x88e1;
|
||||
public static final int GL_STREAM_DRAW_ARB = 0x88e0;
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glBindBufferARB(int target, int buffer) {
|
||||
switch ( target ) {
|
||||
case ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB:
|
||||
BufferObjectTracker.getVBOArrayStack().setState(buffer);
|
||||
break;
|
||||
case ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB:
|
||||
BufferObjectTracker.getVBOElementStack().setState(buffer);
|
||||
break;
|
||||
case ARBPixelBufferObject.GL_PIXEL_PACK_BUFFER_ARB:
|
||||
BufferObjectTracker.getPBOPackStack().setState(buffer);
|
||||
break;
|
||||
case ARBPixelBufferObject.GL_PIXEL_UNPACK_BUFFER_ARB:
|
||||
BufferObjectTracker.getPBOUnpackStack().setState(buffer);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported VBO target " + target);
|
||||
}
|
||||
nglBindBufferARB(target, buffer);
|
||||
public static java.nio.ByteBuffer glGetBufferPointerARB(int target, int pname, int result_size) {
|
||||
java.nio.ByteBuffer __result = nglGetBufferPointervARB(target, pname, result_size);
|
||||
return __result;
|
||||
}
|
||||
private static native java.nio.ByteBuffer nglGetBufferPointervARB(int target, int pname, int result_size);
|
||||
|
||||
private static native void nglBindBufferARB(int target, int buffer);
|
||||
|
||||
public static void glDeleteBuffersARB(IntBuffer buffers) {
|
||||
for ( int i = buffers.position(); i < buffers.limit(); i++ ) {
|
||||
int buffer_handle = buffers.get(i);
|
||||
if ( BufferObjectTracker.getVBOArrayStack().getState() == buffer_handle )
|
||||
BufferObjectTracker.getVBOArrayStack().setState(0);
|
||||
if ( BufferObjectTracker.getVBOElementStack().getState() == buffer_handle )
|
||||
BufferObjectTracker.getVBOElementStack().setState(0);
|
||||
if ( BufferObjectTracker.getPBOPackStack().getState() == buffer_handle )
|
||||
BufferObjectTracker.getPBOPackStack().setState(0);
|
||||
if ( BufferObjectTracker.getPBOUnpackStack().getState() == buffer_handle )
|
||||
BufferObjectTracker.getPBOUnpackStack().setState(0);
|
||||
}
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglDeleteBuffersARB(buffers.remaining(), buffers, buffers.position());
|
||||
public static void glGetBufferParameterARB(int target, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetBufferParameterivARB(target, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_position);
|
||||
|
||||
private static native void nglDeleteBuffersARB(int n, IntBuffer buffers, int buffers_offset);
|
||||
|
||||
public static void glGenBuffersARB(IntBuffer buffers) {
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglGenBuffersARB(buffers.remaining(), buffers, buffers.position());
|
||||
}
|
||||
|
||||
private static native void nglGenBuffersARB(int n, IntBuffer buffers, int buffers_offset);
|
||||
|
||||
public static native boolean glIsBufferARB(int buffer);
|
||||
|
||||
public static void glBufferDataARB(int target, int size, int usage) {
|
||||
nglBufferDataARB(target, size, null, 0, usage);
|
||||
}
|
||||
|
||||
public static void glBufferDataARB(int target, ByteBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, data.remaining(), data, data.position(), usage);
|
||||
}
|
||||
|
||||
public static void glBufferDataARB(int target, ShortBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, data.remaining() << 1, data, data.position() << 1, usage);
|
||||
}
|
||||
|
||||
public static void glBufferDataARB(int target, FloatBuffer data, int usage) {
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data.remaining() << 2, data, data.position() << 2, usage);
|
||||
}
|
||||
|
||||
public static void glBufferDataARB(int target, IntBuffer data, int usage) {
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data.remaining() << 2, data, data.position() << 2, usage);
|
||||
}
|
||||
|
||||
private static native void nglBufferDataARB(int target, int size, Buffer data, int data_offset, int usage);
|
||||
|
||||
public static void glBufferSubDataARB(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, data.remaining(), data, data.position());
|
||||
}
|
||||
|
||||
public static void glBufferSubDataARB(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, data.remaining() << 1, data, data.position() << 1);
|
||||
}
|
||||
|
||||
public static void glBufferSubDataARB(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
public static void glBufferSubDataARB(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
private static native void nglBufferSubDataARB(int target, int offset, int size, Buffer data, int data_offset);
|
||||
|
||||
public static void glGetBufferSubDataARB(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, data.remaining(), data, data.position());
|
||||
}
|
||||
|
||||
public static void glGetBufferSubDataARB(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, data.remaining() << 1, data, data.position() << 1);
|
||||
}
|
||||
|
||||
public static void glGetBufferSubDataARB(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
public static void glGetBufferSubDataARB(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
private static native void nglGetBufferSubDataARB(int target, int offset, int size, Buffer data, int data_offset);
|
||||
public static native boolean glUnmapBufferARB(int target);
|
||||
|
||||
/**
|
||||
* glMapBufferARB maps a gl vertex buffer buffer to a ByteBuffer. The oldBuffer argument can be null,
|
||||
|
|
@ -195,22 +48,93 @@ public abstract class ARBBufferObject {
|
|||
* way, an application will normally use glMapBufferARB like this:
|
||||
* <p/>
|
||||
* ByteBuffer mapped_buffer; mapped_buffer = glMapBufferARB(..., ..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferARB(..., ..., ..., mapped_buffer);
|
||||
*
|
||||
* @param size The size of the buffer area.
|
||||
* @param oldBuffer A ByteBuffer. If this argument points to the same address as the new mapping, it will be returned and no new buffer will be created. In that case, size is ignored.
|
||||
*
|
||||
* @return A ByteBuffer representing the mapped buffer memory.
|
||||
*/
|
||||
public static native ByteBuffer glMapBufferARB(int target, int access, int size, ByteBuffer oldBuffer);
|
||||
|
||||
public static native boolean glUnmapBufferARB(int target);
|
||||
|
||||
public static void glGetBufferParameterARB(int target, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetBufferParameterivARB(target, pname, params, params.position());
|
||||
public static java.nio.ByteBuffer glMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer) {
|
||||
if (old_buffer != null)
|
||||
BufferChecks.checkDirect(old_buffer);
|
||||
java.nio.ByteBuffer __result = nglMapBufferARB(target, access, result_size, old_buffer);
|
||||
return __result;
|
||||
}
|
||||
private static native java.nio.ByteBuffer nglMapBufferARB(int target, int access, int result_size, java.nio.ByteBuffer old_buffer);
|
||||
|
||||
private static native void nglGetBufferParameterivARB(int target, int pname, IntBuffer params, int params_offset);
|
||||
public static void glGetBufferSubDataARB(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, (data.remaining() << 1), data, data.position() << 1);
|
||||
}
|
||||
public static void glGetBufferSubDataARB(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2);
|
||||
}
|
||||
public static void glGetBufferSubDataARB(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2);
|
||||
}
|
||||
public static void glGetBufferSubDataARB(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubDataARB(target, offset, (data.remaining()), data, data.position());
|
||||
}
|
||||
private static native void nglGetBufferSubDataARB(int target, int offset, int size, Buffer data, int data_position);
|
||||
|
||||
public static native ByteBuffer glGetBufferPointerARB(int target, int pname, int size);
|
||||
public static void glBufferSubDataARB(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, (data.remaining() << 1), data, data.position() << 1);
|
||||
}
|
||||
public static void glBufferSubDataARB(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2);
|
||||
}
|
||||
public static void glBufferSubDataARB(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, (data.remaining() << 2), data, data.position() << 2);
|
||||
}
|
||||
public static void glBufferSubDataARB(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubDataARB(target, offset, (data.remaining()), data, data.position());
|
||||
}
|
||||
private static native void nglBufferSubDataARB(int target, int offset, int size, Buffer data, int data_position);
|
||||
|
||||
public static void glBufferDataARB(int target, int size, int usage) {
|
||||
nglBufferDataARB(target, size, null, 0, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, ShortBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, (data.remaining() << 1), data, data.position() << 1, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, IntBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, (data.remaining() << 2), data, data.position() << 2, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, FloatBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, (data.remaining() << 2), data, data.position() << 2, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, ByteBuffer data, int usage) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferDataARB(target, (data.remaining()), data, data.position(), usage);
|
||||
}
|
||||
private static native void nglBufferDataARB(int target, int size, Buffer data, int data_position, int usage);
|
||||
|
||||
public static native boolean glIsBufferARB(int buffer);
|
||||
|
||||
public static void glGenBuffersARB(IntBuffer buffers) {
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglGenBuffersARB((buffers.remaining()), buffers, buffers.position());
|
||||
}
|
||||
private static native void nglGenBuffersARB(int n, IntBuffer buffers, int buffers_position);
|
||||
|
||||
public static void glDeleteBuffersARB(IntBuffer buffers) {
|
||||
BufferChecks.checkDirect(buffers);
|
||||
BufferObjectTracker.deleteBuffers(buffers);
|
||||
nglDeleteBuffersARB((buffers.remaining()), buffers, buffers.position());
|
||||
}
|
||||
private static native void nglDeleteBuffersARB(int n, IntBuffer buffers, int buffers_position);
|
||||
|
||||
public static void glBindBufferARB(int target, int buffer) {
|
||||
BufferObjectTracker.bindBuffer(target, buffer);
|
||||
nglBindBufferARB(target, buffer);
|
||||
}
|
||||
private static native void nglBindBufferARB(int target, int buffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,83 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBColorBufferFloat {
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
|
||||
* GetFloatv, and GetDoublev:
|
||||
*/
|
||||
public static final int GLX_RGBA_FLOAT_BIT = 0x4;
|
||||
public static final int GLX_RGBA_FLOAT_TYPE = 0x20b9;
|
||||
public static final int WGL_TYPE_RGBA_FLOAT_ARB = 0x21a0;
|
||||
public static final int FIXED_ONLY_ARB = 0x891d;
|
||||
public static final int CLAMP_READ_COLOR_ARB = 0x891c;
|
||||
public static final int CLAMP_FRAGMENT_COLOR_ARB = 0x891b;
|
||||
public static final int CLAMP_VERTEX_COLOR_ARB = 0x891a;
|
||||
public static final int RGBA_FLOAT_MODE_ARB = 0x8820;
|
||||
|
||||
/*
|
||||
* Accepted by the <target> parameter of ClampColorARB and the <pname>
|
||||
* parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.
|
||||
*/
|
||||
public static final int CLAMP_VERTEX_COLOR_ARB = 0x891A;
|
||||
public static final int CLAMP_FRAGMENT_COLOR_ARB = 0x891B;
|
||||
public static final int CLAMP_READ_COLOR_ARB = 0x891C;
|
||||
|
||||
/*
|
||||
* Accepted by the <clamp> parameter of ClampColorARB.
|
||||
*/
|
||||
public static final int FIXED_ONLY_ARB = 0x891D;
|
||||
|
||||
/*
|
||||
* Accepted as a value in the <piAttribIList> and <pfAttribFList>
|
||||
* parameter arrays of wglChoosePixelFormatARB, and returned in the
|
||||
* <piValues> parameter array of wglGetPixelFormatAttribivARB, and the
|
||||
* <pfValues> parameter array of wglGetPixelFormatAttribfvARB:
|
||||
*/
|
||||
static final int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0;
|
||||
|
||||
/*
|
||||
* Accepted as values of the <render_type> arguments in the
|
||||
* glXCreateNewContext and glXCreateContext functions
|
||||
*/
|
||||
static final int GLX_RGBA_FLOAT_TYPE = 0x20B9;
|
||||
|
||||
/*
|
||||
* Accepted as a bit set in the GLX_RENDER_TYPE variable
|
||||
*/
|
||||
static final int GLX_RGBA_FLOAT_BIT = 0x00000004;
|
||||
|
||||
private ARBColorBufferFloat() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glClampColorARB(int target, int clamp);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,58 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBDepthTexture {
|
||||
|
||||
/*
|
||||
* Accepted by the <internalFormat> parameter of TexImage1D, TexImage2D,
|
||||
* CopyTexImage1D and CopyTexImage2D:
|
||||
*/
|
||||
public static final int GL_DEPTH_COMPONENT16_ARB = 0x81A5;
|
||||
public static final int GL_DEPTH_COMPONENT24_ARB = 0x81A6;
|
||||
public static final int GL_DEPTH_COMPONENT32_ARB = 0x81A7;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetTexLevelParameterfv and
|
||||
* GetTexLevelParameteriv:
|
||||
*/
|
||||
public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of TexParameterf, TexParameteri,
|
||||
* TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv:
|
||||
*/
|
||||
public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B;
|
||||
public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884b;
|
||||
public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884a;
|
||||
public static final int GL_DEPTH_COMPONENT32_ARB = 0x81a7;
|
||||
public static final int GL_DEPTH_COMPONENT24_ARB = 0x81a6;
|
||||
public static final int GL_DEPTH_COMPONENT16_ARB = 0x81a5;
|
||||
|
||||
private ARBDepthTexture() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.BufferChecks;
|
||||
import org.lwjgl.LWJGLException;
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBDrawBuffers {
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
|
||||
* and GetDoublev:
|
||||
*/
|
||||
public static final int GL_MAX_DRAW_BUFFERS_ARB = 0x8824;
|
||||
public static final int GL_DRAW_BUFFER0_ARB = 0x8825;
|
||||
public static final int GL_DRAW_BUFFER1_ARB = 0x8826;
|
||||
public static final int GL_DRAW_BUFFER2_ARB = 0x8827;
|
||||
public static final int GL_DRAW_BUFFER3_ARB = 0x8828;
|
||||
public static final int GL_DRAW_BUFFER4_ARB = 0x8829;
|
||||
public static final int GL_DRAW_BUFFER5_ARB = 0x882A;
|
||||
public static final int GL_DRAW_BUFFER6_ARB = 0x882B;
|
||||
public static final int GL_DRAW_BUFFER7_ARB = 0x882C;
|
||||
public static final int GL_DRAW_BUFFER8_ARB = 0x882D;
|
||||
public static final int GL_DRAW_BUFFER9_ARB = 0x882E;
|
||||
public static final int GL_DRAW_BUFFER10_ARB = 0x882F;
|
||||
public static final int GL_DRAW_BUFFER11_ARB = 0x8830;
|
||||
public static final int GL_DRAW_BUFFER12_ARB = 0x8831;
|
||||
public static final int GL_DRAW_BUFFER13_ARB = 0x8832;
|
||||
public static final int GL_DRAW_BUFFER14_ARB = 0x8833;
|
||||
public static final int GL_DRAW_BUFFER15_ARB = 0x8834;
|
||||
public static final int GL_DRAW_BUFFER14_ARB = 0x8833;
|
||||
public static final int GL_DRAW_BUFFER13_ARB = 0x8832;
|
||||
public static final int GL_DRAW_BUFFER12_ARB = 0x8831;
|
||||
public static final int GL_DRAW_BUFFER11_ARB = 0x8830;
|
||||
public static final int GL_DRAW_BUFFER10_ARB = 0x882f;
|
||||
public static final int GL_DRAW_BUFFER9_ARB = 0x882e;
|
||||
public static final int GL_DRAW_BUFFER8_ARB = 0x882d;
|
||||
public static final int GL_DRAW_BUFFER7_ARB = 0x882c;
|
||||
public static final int GL_DRAW_BUFFER6_ARB = 0x882b;
|
||||
public static final int GL_DRAW_BUFFER5_ARB = 0x882a;
|
||||
public static final int GL_DRAW_BUFFER4_ARB = 0x8829;
|
||||
public static final int GL_DRAW_BUFFER3_ARB = 0x8828;
|
||||
public static final int GL_DRAW_BUFFER2_ARB = 0x8827;
|
||||
public static final int GL_DRAW_BUFFER1_ARB = 0x8826;
|
||||
public static final int GL_DRAW_BUFFER0_ARB = 0x8825;
|
||||
public static final int GL_MAX_DRAW_BUFFERS_ARB = 0x8824;
|
||||
|
||||
private ARBDrawBuffers() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
// ---------------------------
|
||||
public static void glDrawBuffersARB(IntBuffer buffers) {
|
||||
BufferChecks.checkBuffer(buffers, 1);
|
||||
nglDrawBuffersARB(buffers.remaining(), buffers, buffers.position());
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglDrawBuffersARB((buffers.remaining()), buffers, buffers.position());
|
||||
}
|
||||
|
||||
private static native void nglDrawBuffersARB(int size, IntBuffer buffers, int buffersOffset);
|
||||
// ---------------------------
|
||||
|
||||
private static native void nglDrawBuffersARB(int size, IntBuffer buffers, int buffers_position);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,72 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBFragmentProgram extends ARBProgram {
|
||||
|
||||
/*
|
||||
* Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by the
|
||||
* <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev,
|
||||
* and by the <target> parameter of ProgramStringARB, BindProgramARB,
|
||||
* ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB,
|
||||
* GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB,
|
||||
* GetProgramivARB and GetProgramStringARB.
|
||||
*/
|
||||
public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetProgramivARB:
|
||||
*/
|
||||
public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805;
|
||||
public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806;
|
||||
public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807;
|
||||
public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808;
|
||||
public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809;
|
||||
public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A;
|
||||
public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B;
|
||||
public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C;
|
||||
public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
* and GetDoublev:
|
||||
*/
|
||||
public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
|
||||
public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
|
||||
public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880f;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880e;
|
||||
public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880d;
|
||||
public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880c;
|
||||
public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880b;
|
||||
public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880a;
|
||||
public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809;
|
||||
public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808;
|
||||
public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807;
|
||||
public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806;
|
||||
public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805;
|
||||
public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804;
|
||||
|
||||
private ARBFragmentProgram() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,58 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBFragmentShader {
|
||||
|
||||
/*
|
||||
* Accepted by the <shaderType> argument of CreateShaderObjectARB and
|
||||
* returned by the <params> parameter of GetObjectParameter{fi}vARB:
|
||||
*/
|
||||
public static final int GL_FRAGMENT_SHADER_ARB = 0x8B30;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
* GetFloatv, and GetDoublev:
|
||||
*/
|
||||
public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49;
|
||||
public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
|
||||
public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8b8b;
|
||||
public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872;
|
||||
|
||||
/*
|
||||
* Accepted by the <target> parameter of Hint and the <pname> parameter of
|
||||
* GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
|
||||
*/
|
||||
public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B;
|
||||
public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871;
|
||||
public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8b49;
|
||||
public static final int GL_FRAGMENT_SHADER_ARB = 0x8b30;
|
||||
|
||||
private ARBFragmentShader() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBHalfFloatPixel {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
/*
|
||||
* Accepted by the <type> parameter of DrawPixels, ReadPixels,
|
||||
* TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D,
|
||||
* TexSubImage2D, TexSubImage3D, GetHistogram, GetMinmax,
|
||||
* ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter,
|
||||
* SeparableFilter2D, GetSeparableFilter, ColorTable, ColorSubTable,
|
||||
* and GetColorTable:
|
||||
*/
|
||||
public static final int HALF_FLOAT_ARB = 0x140B;
|
||||
public final class ARBHalfFloatPixel {
|
||||
public static final int HALF_FLOAT_ARB = 0x140b;
|
||||
|
||||
private ARBHalfFloatPixel() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,109 +1,67 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBMatrixPalette {
|
||||
|
||||
public static final int GL_MATRIX_PALETTE_ARB = 0x8840;
|
||||
public static final int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841;
|
||||
public static final int GL_MAX_PALETTE_MATRICES_ARB = 0x8842;
|
||||
public static final int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844;
|
||||
public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846;
|
||||
public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844;
|
||||
public static final int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843;
|
||||
public static final int GL_MAX_PALETTE_MATRICES_ARB = 0x8842;
|
||||
public static final int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841;
|
||||
public static final int GL_MATRIX_PALETTE_ARB = 0x8840;
|
||||
|
||||
private ARBMatrixPalette() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glCurrentPaletteMatrixARB(int index);
|
||||
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position());
|
||||
public static void glMatrixIndexuARB(IntBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
nglMatrixIndexuivARB((pIndices.remaining()), pIndices, pIndices.position());
|
||||
}
|
||||
private static native void nglMatrixIndexuivARB(int size, IntBuffer pIndices, int pIndices_position);
|
||||
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position() << 1);
|
||||
public static void glMatrixIndexuARB(ShortBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
nglMatrixIndexusvARB((pIndices.remaining()), pIndices, pIndices.position());
|
||||
}
|
||||
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, pPointer, pPointer.position() << 2);
|
||||
}
|
||||
|
||||
private static native void nglMatrixIndexPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset);
|
||||
|
||||
public static void glMatrixIndexPointerARB(int size, int type, int stride, int buffer_offset) {
|
||||
GLBufferChecks.ensureArrayVBOenabled();
|
||||
nglMatrixIndexPointerARBVBO(size, type, stride, buffer_offset);
|
||||
}
|
||||
|
||||
private static native void nglMatrixIndexPointerARBVBO(int size, int type, int stride, int buffer_offset);
|
||||
private static native void nglMatrixIndexusvARB(int size, ShortBuffer pIndices, int pIndices_position);
|
||||
|
||||
public static void glMatrixIndexuARB(ByteBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
nglMatrixIndexubvARB(pIndices.remaining(), pIndices, pIndices.position());
|
||||
nglMatrixIndexubvARB((pIndices.remaining()), pIndices, pIndices.position());
|
||||
}
|
||||
private static native void nglMatrixIndexubvARB(int size, ByteBuffer pIndices, int pIndices_position);
|
||||
|
||||
private static native void nglMatrixIndexubvARB(int size, ByteBuffer pIndices, int pIndices_offset);
|
||||
|
||||
public static void glMatrixIndexuARB(IntBuffer piIndices) {
|
||||
BufferChecks.checkDirect(piIndices);
|
||||
nglMatrixIndexuivARB(piIndices.remaining(), piIndices, piIndices.position());
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) {
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, pPointer, pPointer.position() << 2);
|
||||
}
|
||||
|
||||
private static native void nglMatrixIndexuivARB(int size, IntBuffer piIndices, int piIndices_offset);
|
||||
|
||||
public static void glMatrixIndexuARB(ShortBuffer psIndices) {
|
||||
BufferChecks.checkDirect(psIndices);
|
||||
nglMatrixIndexusvARB(psIndices.remaining(), psIndices, psIndices.position());
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) {
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position());
|
||||
}
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) {
|
||||
GLBufferChecks.ensureArrayVBOdisabled();
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position() << 1);
|
||||
}
|
||||
private static native void nglMatrixIndexPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_position);
|
||||
public static void glMatrixIndexPointerARB(int size, int type, int stride, int pPointer_buffer_offset) {
|
||||
GLBufferChecks.ensureArrayVBOenabled();
|
||||
nglMatrixIndexPointerARBBO(size, type, stride, pPointer_buffer_offset);
|
||||
}
|
||||
private static native void nglMatrixIndexPointerARBBO(int size, int type, int stride, int pPointer_buffer_offset);
|
||||
|
||||
private static native void nglMatrixIndexusvARB(int size, ShortBuffer psIndices, int psIndices_offset);
|
||||
public static native void glCurrentPaletteMatrixARB(int index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBMultisample {
|
||||
|
||||
public static final int GL_MULTISAMPLE_ARB = 0x809D;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F;
|
||||
public static final int GL_SAMPLE_COVERAGE_ARB = 0x80A0;
|
||||
public static final int GL_SAMPLE_BUFFERS_ARB = 0x80A8;
|
||||
public static final int GL_SAMPLES_ARB = 0x80A9;
|
||||
public static final int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA;
|
||||
public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB;
|
||||
public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000;
|
||||
public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80ab;
|
||||
public static final int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80aa;
|
||||
public static final int GL_SAMPLES_ARB = 0x80a9;
|
||||
public static final int GL_SAMPLE_BUFFERS_ARB = 0x80a8;
|
||||
public static final int GL_SAMPLE_COVERAGE_ARB = 0x80a0;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809f;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809e;
|
||||
public static final int GL_MULTISAMPLE_ARB = 0x809d;
|
||||
|
||||
private ARBMultisample() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,106 +1,78 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBMultitexture {
|
||||
|
||||
public static final int GL_TEXTURE0_ARB = 0x84C0;
|
||||
public static final int GL_TEXTURE1_ARB = 0x84C1;
|
||||
public static final int GL_TEXTURE2_ARB = 0x84C2;
|
||||
public static final int GL_TEXTURE3_ARB = 0x84C3;
|
||||
public static final int GL_TEXTURE4_ARB = 0x84C4;
|
||||
public static final int GL_TEXTURE5_ARB = 0x84C5;
|
||||
public static final int GL_TEXTURE6_ARB = 0x84C6;
|
||||
public static final int GL_TEXTURE7_ARB = 0x84C7;
|
||||
public static final int GL_TEXTURE8_ARB = 0x84C8;
|
||||
public static final int GL_TEXTURE9_ARB = 0x84C9;
|
||||
public static final int GL_TEXTURE10_ARB = 0x84CA;
|
||||
public static final int GL_TEXTURE11_ARB = 0x84CB;
|
||||
public static final int GL_TEXTURE12_ARB = 0x84CC;
|
||||
public static final int GL_TEXTURE13_ARB = 0x84CD;
|
||||
public static final int GL_TEXTURE14_ARB = 0x84CE;
|
||||
public static final int GL_TEXTURE15_ARB = 0x84CF;
|
||||
public static final int GL_TEXTURE16_ARB = 0x84D0;
|
||||
public static final int GL_TEXTURE17_ARB = 0x84D1;
|
||||
public static final int GL_TEXTURE18_ARB = 0x84D2;
|
||||
public static final int GL_TEXTURE19_ARB = 0x84D3;
|
||||
public static final int GL_TEXTURE20_ARB = 0x84D4;
|
||||
public static final int GL_TEXTURE21_ARB = 0x84D5;
|
||||
public static final int GL_TEXTURE22_ARB = 0x84D6;
|
||||
public static final int GL_TEXTURE23_ARB = 0x84D7;
|
||||
public static final int GL_TEXTURE24_ARB = 0x84D8;
|
||||
public static final int GL_TEXTURE25_ARB = 0x84D9;
|
||||
public static final int GL_TEXTURE26_ARB = 0x84DA;
|
||||
public static final int GL_TEXTURE27_ARB = 0x84DB;
|
||||
public static final int GL_TEXTURE28_ARB = 0x84DC;
|
||||
public static final int GL_TEXTURE29_ARB = 0x84DD;
|
||||
public static final int GL_TEXTURE30_ARB = 0x84DE;
|
||||
public static final int GL_TEXTURE31_ARB = 0x84DF;
|
||||
public static final int GL_ACTIVE_TEXTURE_ARB = 0x84E0;
|
||||
public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1;
|
||||
public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2;
|
||||
public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84e2;
|
||||
public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84e1;
|
||||
public static final int GL_ACTIVE_TEXTURE_ARB = 0x84e0;
|
||||
public static final int GL_TEXTURE31_ARB = 0x84df;
|
||||
public static final int GL_TEXTURE30_ARB = 0x84de;
|
||||
public static final int GL_TEXTURE29_ARB = 0x84dd;
|
||||
public static final int GL_TEXTURE28_ARB = 0x84dc;
|
||||
public static final int GL_TEXTURE27_ARB = 0x84db;
|
||||
public static final int GL_TEXTURE26_ARB = 0x84da;
|
||||
public static final int GL_TEXTURE25_ARB = 0x84d9;
|
||||
public static final int GL_TEXTURE24_ARB = 0x84d8;
|
||||
public static final int GL_TEXTURE23_ARB = 0x84d7;
|
||||
public static final int GL_TEXTURE22_ARB = 0x84d6;
|
||||
public static final int GL_TEXTURE21_ARB = 0x84d5;
|
||||
public static final int GL_TEXTURE20_ARB = 0x84d4;
|
||||
public static final int GL_TEXTURE19_ARB = 0x84d3;
|
||||
public static final int GL_TEXTURE18_ARB = 0x84d2;
|
||||
public static final int GL_TEXTURE17_ARB = 0x84d1;
|
||||
public static final int GL_TEXTURE16_ARB = 0x84d0;
|
||||
public static final int GL_TEXTURE15_ARB = 0x84cf;
|
||||
public static final int GL_TEXTURE14_ARB = 0x84ce;
|
||||
public static final int GL_TEXTURE13_ARB = 0x84cd;
|
||||
public static final int GL_TEXTURE12_ARB = 0x84cc;
|
||||
public static final int GL_TEXTURE11_ARB = 0x84cb;
|
||||
public static final int GL_TEXTURE10_ARB = 0x84ca;
|
||||
public static final int GL_TEXTURE9_ARB = 0x84c9;
|
||||
public static final int GL_TEXTURE8_ARB = 0x84c8;
|
||||
public static final int GL_TEXTURE7_ARB = 0x84c7;
|
||||
public static final int GL_TEXTURE6_ARB = 0x84c6;
|
||||
public static final int GL_TEXTURE5_ARB = 0x84c5;
|
||||
public static final int GL_TEXTURE4_ARB = 0x84c4;
|
||||
public static final int GL_TEXTURE3_ARB = 0x84c3;
|
||||
public static final int GL_TEXTURE2_ARB = 0x84c2;
|
||||
public static final int GL_TEXTURE1_ARB = 0x84c1;
|
||||
public static final int GL_TEXTURE0_ARB = 0x84c0;
|
||||
|
||||
private ARBMultitexture() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glClientActiveTextureARB(int texture);
|
||||
|
||||
public static native void glActiveTextureARB(int texture);
|
||||
|
||||
public static native void glMultiTexCoord1fARB(int target, float s);
|
||||
|
||||
public static native void glMultiTexCoord1iARB(int target, int s);
|
||||
|
||||
public static native void glMultiTexCoord1sARB(int target, short s);
|
||||
|
||||
public static native void glMultiTexCoord2fARB(int target, float s, float t);
|
||||
|
||||
public static native void glMultiTexCoord2iARB(int target, int s, int t);
|
||||
|
||||
public static native void glMultiTexCoord2sARB(int target, short s, short t);
|
||||
|
||||
public static native void glMultiTexCoord3fARB(int target, float s, float t, float r);
|
||||
|
||||
public static native void glMultiTexCoord3iARB(int target, int s, int t, int r);
|
||||
|
||||
public static native void glMultiTexCoord3sARB(int target, short s, short t, short r);
|
||||
|
||||
public static native void glMultiTexCoord4fARB(int target, float s, float t, float r, float q);
|
||||
public static native void glMultiTexCoord4sARB(int target, short s, short t, short r, short q);
|
||||
|
||||
public static native void glMultiTexCoord4iARB(int target, int s, int t, int r, int q);
|
||||
|
||||
public static native void glMultiTexCoord4sARB(int target, short s, short t, short r, short q);
|
||||
public static native void glMultiTexCoord4fARB(int target, float s, float t, float r, float q);
|
||||
|
||||
public static native void glMultiTexCoord3sARB(int target, short s, short t, short r);
|
||||
|
||||
public static native void glMultiTexCoord3iARB(int target, int s, int t, int r);
|
||||
|
||||
public static native void glMultiTexCoord3fARB(int target, float s, float t, float r);
|
||||
|
||||
public static native void glMultiTexCoord2sARB(int target, short s, short t);
|
||||
|
||||
public static native void glMultiTexCoord2iARB(int target, int s, int t);
|
||||
|
||||
public static native void glMultiTexCoord2fARB(int target, float s, float t);
|
||||
|
||||
public static native void glMultiTexCoord1sARB(int target, short s);
|
||||
|
||||
public static native void glMultiTexCoord1iARB(int target, int s);
|
||||
|
||||
public static native void glMultiTexCoord1fARB(int target, float s);
|
||||
|
||||
public static native void glActiveTextureARB(int texture);
|
||||
|
||||
public static native void glClientActiveTextureARB(int texture);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,116 +1,56 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBOcclusionQuery {
|
||||
|
||||
/*
|
||||
* Accepted by the <target> parameter of BeginQueryARB, EndQueryARB,
|
||||
* and GetQueryivARB:
|
||||
*/
|
||||
public static final int GL_SAMPLES_PASSED_ARB = 0x8914;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetQueryivARB:
|
||||
*/
|
||||
public static final int GL_QUERY_COUNTER_BITS_ARB = 0x8864;
|
||||
public static final int GL_CURRENT_QUERY_ARB = 0x8865;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetQueryObjectivARB and
|
||||
GetQueryObjectuivARB:
|
||||
*/
|
||||
public static final int GL_QUERY_RESULT_ARB = 0x8866;
|
||||
public static final int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867;
|
||||
public static final int GL_QUERY_RESULT_ARB = 0x8866;
|
||||
public static final int GL_CURRENT_QUERY_ARB = 0x8865;
|
||||
public static final int GL_QUERY_COUNTER_BITS_ARB = 0x8864;
|
||||
public static final int GL_SAMPLES_PASSED_ARB = 0x8914;
|
||||
|
||||
private ARBOcclusionQuery() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
// ---------------------------
|
||||
public static void glGenQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglGenQueriesARB(ids.remaining(), ids, ids.position());
|
||||
public static void glGetQueryObjectuARB(int id, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetQueryObjectuivARB(id, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetQueryObjectuivARB(int id, int pname, IntBuffer params, int params_position);
|
||||
|
||||
private static native void nglGenQueriesARB(int n, IntBuffer ids, int idsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glDeleteQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglDeleteQueriesARB(ids.remaining(), ids, ids.position());
|
||||
public static void glGetQueryObjectARB(int id, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetQueryObjectivARB(id, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetQueryObjectivARB(int id, int pname, IntBuffer params, int params_position);
|
||||
|
||||
private static native void nglDeleteQueriesARB(int n, IntBuffer ids, int idsOffset);
|
||||
// ---------------------------
|
||||
|
||||
public static native boolean glIsQueryARB(int id);
|
||||
|
||||
public static native void glBeginQueryARB(int target, int id);
|
||||
public static void glGetQueryARB(int target, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetQueryivARB(target, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetQueryivARB(int target, int pname, IntBuffer params, int params_position);
|
||||
|
||||
public static native void glEndQueryARB(int target);
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetQueryARB(int target, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetQueryivARB(target, pname, params, params.position());
|
||||
public static native void glBeginQueryARB(int target, int id);
|
||||
|
||||
public static native boolean glIsQueryARB(int id);
|
||||
|
||||
public static void glDeleteQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglDeleteQueriesARB((ids.remaining()), ids, ids.position());
|
||||
}
|
||||
private static native void nglDeleteQueriesARB(int n, IntBuffer ids, int ids_position);
|
||||
|
||||
private static native void nglGetQueryivARB(int target, int pname, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetQueryObjectiARB(int id, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetQueryObjectivARB(id, pname, params, params.position());
|
||||
public static void glGenQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglGenQueriesARB((ids.remaining()), ids, ids.position());
|
||||
}
|
||||
|
||||
private static native void nglGetQueryObjectivARB(int id, int pname, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetQueryObjectuiARB(int id, int pname, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetQueryObjectuivARB(id, pname, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetQueryObjectuivARB(int id, int pname, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
private static native void nglGenQueriesARB(int n, IntBuffer ids, int ids_position);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBPixelBufferObject extends ARBBufferObject {
|
||||
|
||||
/*
|
||||
* Accepted by the <target> parameters of BindBuffer, BufferData,
|
||||
* BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
|
||||
* GetBufferParameteriv, and GetBufferPointerv:
|
||||
*/
|
||||
public static final int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB;
|
||||
public static final int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
* GetFloatv, and GetDoublev:
|
||||
*/
|
||||
public static final int PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED;
|
||||
public static final int PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF;
|
||||
public static final int PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88ef;
|
||||
public static final int PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ed;
|
||||
public static final int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88ec;
|
||||
public static final int GL_PIXEL_PACK_BUFFER_ARB = 0x88eb;
|
||||
|
||||
private ARBPixelBufferObject() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,59 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBPointParameters {
|
||||
|
||||
public static final int GL_POINT_SIZE_MIN_ARB = 0x8126;
|
||||
public static final int GL_POINT_SIZE_MAX_ARB = 0x8127;
|
||||
public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
|
||||
public static final int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129;
|
||||
public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
|
||||
public static final int GL_POINT_SIZE_MAX_ARB = 0x8127;
|
||||
public static final int GL_POINT_SIZE_MIN_ARB = 0x8126;
|
||||
|
||||
private ARBPointParameters() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glPointParameterfARB(int pname, float param);
|
||||
|
||||
public static void glPointParameterARB(int pname, FloatBuffer pfParams) {
|
||||
BufferChecks.checkBuffer(pfParams);
|
||||
BufferChecks.checkBuffer(pfParams, 4);
|
||||
nglPointParameterfvARB(pname, pfParams, pfParams.position());
|
||||
}
|
||||
private static native void nglPointParameterfvARB(int pname, FloatBuffer pfParams, int pfParams_position);
|
||||
|
||||
private static native void nglPointParameterfvARB(int pname, FloatBuffer pfParams, int pfParams_offset);
|
||||
public static native void glPointParameterfARB(int pname, float param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,53 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBPointSprite {
|
||||
|
||||
/*
|
||||
* Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
|
||||
* the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
|
||||
* GetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,
|
||||
* TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
|
||||
*/
|
||||
public static final int GL_POINT_SPRITE_ARB = 0x8861;
|
||||
|
||||
/*
|
||||
* When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,
|
||||
* GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of
|
||||
* <pname> may be:
|
||||
*/
|
||||
public static final int GL_COORD_REPLACE_ARB = 0x8862;
|
||||
public static final int GL_POINT_SPRITE_ARB = 0x8861;
|
||||
|
||||
private ARBPointSprite() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,237 +1,137 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.BufferUnderflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.BufferChecks;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public abstract class ARBProgram {
|
||||
|
||||
/*
|
||||
* Accepted by the <format> parameter of ProgramStringARB:
|
||||
*/
|
||||
public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetProgramivARB:
|
||||
*/
|
||||
public static final int GL_PROGRAM_LENGTH_ARB = 0x8627;
|
||||
public static final int GL_PROGRAM_FORMAT_ARB = 0x8876;
|
||||
public static final int GL_PROGRAM_BINDING_ARB = 0x8677;
|
||||
public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0;
|
||||
public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1;
|
||||
public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3;
|
||||
public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4;
|
||||
public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5;
|
||||
public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7;
|
||||
public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8;
|
||||
public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9;
|
||||
public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB;
|
||||
public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC;
|
||||
public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD;
|
||||
public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF;
|
||||
public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4;
|
||||
public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5;
|
||||
public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetProgramStringARB:
|
||||
*/
|
||||
public static final int GL_PROGRAM_STRING_ARB = 0x8628;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
* GetFloatv, and GetDoublev:
|
||||
*/
|
||||
public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B;
|
||||
public static final int GL_CURRENT_MATRIX_ARB = 0x8641;
|
||||
public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7;
|
||||
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640;
|
||||
public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F;
|
||||
public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E;
|
||||
|
||||
/*
|
||||
* Accepted by the <name> parameter of GetString:
|
||||
*/
|
||||
public class ARBProgram {
|
||||
public static final int GL_MATRIX31_ARB = 0x88df;
|
||||
public static final int GL_MATRIX30_ARB = 0x88de;
|
||||
public static final int GL_MATRIX29_ARB = 0x88dd;
|
||||
public static final int GL_MATRIX28_ARB = 0x88dc;
|
||||
public static final int GL_MATRIX27_ARB = 0x88db;
|
||||
public static final int GL_MATRIX26_ARB = 0x88da;
|
||||
public static final int GL_MATRIX25_ARB = 0x88d9;
|
||||
public static final int GL_MATRIX24_ARB = 0x88d8;
|
||||
public static final int GL_MATRIX23_ARB = 0x88d7;
|
||||
public static final int GL_MATRIX22_ARB = 0x88d6;
|
||||
public static final int GL_MATRIX21_ARB = 0x88d5;
|
||||
public static final int GL_MATRIX20_ARB = 0x88d4;
|
||||
public static final int GL_MATRIX19_ARB = 0x88d3;
|
||||
public static final int GL_MATRIX18_ARB = 0x88d2;
|
||||
public static final int GL_MATRIX17_ARB = 0x88d1;
|
||||
public static final int GL_MATRIX16_ARB = 0x88d0;
|
||||
public static final int GL_MATRIX15_ARB = 0x88cf;
|
||||
public static final int GL_MATRIX14_ARB = 0x88ce;
|
||||
public static final int GL_MATRIX13_ARB = 0x88cd;
|
||||
public static final int GL_MATRIX12_ARB = 0x88cc;
|
||||
public static final int GL_MATRIX11_ARB = 0x88cb;
|
||||
public static final int GL_MATRIX10_ARB = 0x88ca;
|
||||
public static final int GL_MATRIX9_ARB = 0x88c9;
|
||||
public static final int GL_MATRIX8_ARB = 0x88c8;
|
||||
public static final int GL_MATRIX7_ARB = 0x88c7;
|
||||
public static final int GL_MATRIX6_ARB = 0x88c6;
|
||||
public static final int GL_MATRIX5_ARB = 0x88c5;
|
||||
public static final int GL_MATRIX4_ARB = 0x88c4;
|
||||
public static final int GL_MATRIX3_ARB = 0x88c3;
|
||||
public static final int GL_MATRIX2_ARB = 0x88c2;
|
||||
public static final int GL_MATRIX1_ARB = 0x88c1;
|
||||
public static final int GL_MATRIX0_ARB = 0x88c0;
|
||||
public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874;
|
||||
|
||||
/*
|
||||
* Accepted by the <mode> parameter of MatrixMode:
|
||||
*/
|
||||
public static final int GL_MATRIX0_ARB = 0x88C0;
|
||||
public static final int GL_MATRIX1_ARB = 0x88C1;
|
||||
public static final int GL_MATRIX2_ARB = 0x88C2;
|
||||
public static final int GL_MATRIX3_ARB = 0x88C3;
|
||||
public static final int GL_MATRIX4_ARB = 0x88C4;
|
||||
public static final int GL_MATRIX5_ARB = 0x88C5;
|
||||
public static final int GL_MATRIX6_ARB = 0x88C6;
|
||||
public static final int GL_MATRIX7_ARB = 0x88C7;
|
||||
public static final int GL_MATRIX8_ARB = 0x88C8;
|
||||
public static final int GL_MATRIX9_ARB = 0x88C9;
|
||||
public static final int GL_MATRIX10_ARB = 0x88CA;
|
||||
public static final int GL_MATRIX11_ARB = 0x88CB;
|
||||
public static final int GL_MATRIX12_ARB = 0x88CC;
|
||||
public static final int GL_MATRIX13_ARB = 0x88CD;
|
||||
public static final int GL_MATRIX14_ARB = 0x88CE;
|
||||
public static final int GL_MATRIX15_ARB = 0x88CF;
|
||||
public static final int GL_MATRIX16_ARB = 0x88D0;
|
||||
public static final int GL_MATRIX17_ARB = 0x88D1;
|
||||
public static final int GL_MATRIX18_ARB = 0x88D2;
|
||||
public static final int GL_MATRIX19_ARB = 0x88D3;
|
||||
public static final int GL_MATRIX20_ARB = 0x88D4;
|
||||
public static final int GL_MATRIX21_ARB = 0x88D5;
|
||||
public static final int GL_MATRIX22_ARB = 0x88D6;
|
||||
public static final int GL_MATRIX23_ARB = 0x88D7;
|
||||
public static final int GL_MATRIX24_ARB = 0x88D8;
|
||||
public static final int GL_MATRIX25_ARB = 0x88D9;
|
||||
public static final int GL_MATRIX26_ARB = 0x88DA;
|
||||
public static final int GL_MATRIX27_ARB = 0x88DB;
|
||||
public static final int GL_MATRIX28_ARB = 0x88DC;
|
||||
public static final int GL_MATRIX29_ARB = 0x88DD;
|
||||
public static final int GL_MATRIX30_ARB = 0x88DE;
|
||||
public static final int GL_MATRIX31_ARB = 0x88DF;
|
||||
public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862e;
|
||||
public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862f;
|
||||
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640;
|
||||
public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88b7;
|
||||
public static final int GL_CURRENT_MATRIX_ARB = 0x8641;
|
||||
public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864b;
|
||||
public static final int GL_PROGRAM_STRING_ARB = 0x8628;
|
||||
public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88b6;
|
||||
public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88b5;
|
||||
public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88b4;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88af;
|
||||
public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88ae;
|
||||
public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88ad;
|
||||
public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88ac;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88ab;
|
||||
public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88aa;
|
||||
public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88a9;
|
||||
public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88a8;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88a7;
|
||||
public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88a6;
|
||||
public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88a5;
|
||||
public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88a4;
|
||||
public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88a3;
|
||||
public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88a2;
|
||||
public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88a1;
|
||||
public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88a0;
|
||||
public static final int GL_PROGRAM_BINDING_ARB = 0x8677;
|
||||
public static final int GL_PROGRAM_FORMAT_ARB = 0x8876;
|
||||
public static final int GL_PROGRAM_LENGTH_ARB = 0x8627;
|
||||
public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875;
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
// ---------------------------
|
||||
public static void glProgramStringARB(int target, int format, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
nglProgramStringARB(target, format, string.remaining(), string, string.position());
|
||||
}
|
||||
public static native boolean glIsProgramARB(int program);
|
||||
|
||||
private static native void nglProgramStringARB(int target, int format, int length, Buffer string, int stringOffset);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glBindProgramARB(int target, int program);
|
||||
|
||||
// ---------------------------
|
||||
public static void glDeleteProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglDeleteProgramsARB(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
private static native void nglDeleteProgramsARB(int n, IntBuffer programs, int programsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGenProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglGenProgramsARB(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
private static native void nglGenProgramsARB(int n, IntBuffer programs, int programsOffset);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w);
|
||||
|
||||
private static void checkProgramEnv(int index, Buffer buf) {
|
||||
if ( index < 0 ) {
|
||||
throw new IllegalArgumentException("<index> must be greater than or equal to 0.");
|
||||
}
|
||||
if ( buf.remaining() < 4 ) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
public static void glProgramEnvParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglProgramEnvParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglProgramEnvParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w);
|
||||
|
||||
// ---------------------------
|
||||
public static void glProgramLocalParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglProgramLocalParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglProgramLocalParameter4fvARB(int target, int index, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglGetProgramEnvParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetProgramEnvParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglGetProgramLocalParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetProgramARB(int target, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetProgramivARB(target, parameterName, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetProgramivARB(int target, int parameterName, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetProgramStringARB(int target, int parameterName, ByteBuffer paramString) {
|
||||
BufferChecks.checkDirect(paramString);
|
||||
nglGetProgramStringARB(target, parameterName, paramString, paramString.position());
|
||||
}
|
||||
private static native void nglGetProgramStringARB(int target, int parameterName, Buffer paramString, int paramString_position);
|
||||
|
||||
private static native void nglGetProgramStringARB(int target, int parameterName, Buffer paramString, int paramStringOffset);
|
||||
// ---------------------------
|
||||
public static void glGetProgramARB(int target, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetProgramivARB(target, parameterName, params, params.position());
|
||||
}
|
||||
private static native void nglGetProgramivARB(int target, int parameterName, IntBuffer params, int params_position);
|
||||
|
||||
public static native boolean glIsProgramARB(int program);
|
||||
public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetProgramLocalParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
private static native void nglGetProgramLocalParameterfvARB(int target, int index, FloatBuffer params, int params_position);
|
||||
|
||||
public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglGetProgramEnvParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
private static native void nglGetProgramEnvParameterfvARB(int target, int index, FloatBuffer params, int params_position);
|
||||
|
||||
public static void glProgramLocalParameter4ARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglProgramLocalParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
private static native void nglProgramLocalParameter4fvARB(int target, int index, FloatBuffer params, int params_position);
|
||||
|
||||
public static native void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w);
|
||||
|
||||
public static void glProgramEnvParameter4ARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params, 4);
|
||||
nglProgramEnvParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
private static native void nglProgramEnvParameter4fvARB(int target, int index, FloatBuffer params, int params_position);
|
||||
|
||||
public static native void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w);
|
||||
|
||||
public static void glGenProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglGenProgramsARB((programs.remaining()), programs, programs.position());
|
||||
}
|
||||
private static native void nglGenProgramsARB(int n, IntBuffer programs, int programs_position);
|
||||
|
||||
public static void glDeleteProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglDeleteProgramsARB((programs.remaining()), programs, programs.position());
|
||||
}
|
||||
private static native void nglDeleteProgramsARB(int n, IntBuffer programs, int programs_position);
|
||||
|
||||
public static native void glBindProgramARB(int target, int program);
|
||||
|
||||
public static void glProgramStringARB(int target, int format, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
nglProgramStringARB(target, format, (string.remaining()), string, string.position());
|
||||
}
|
||||
private static native void nglProgramStringARB(int target, int format, int length, Buffer string, int string_position);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,394 +1,238 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBShaderObjects {
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> argument of GetHandleARB:
|
||||
*/
|
||||
public static final int GL_PROGRAM_OBJECT_ARB = 0x8B40;
|
||||
|
||||
/*
|
||||
* Accepted by the <pname> parameter of GetObjectParameter{fi}vARB:
|
||||
*/
|
||||
public static final int GL_OBJECT_TYPE_ARB = 0x8B4E;
|
||||
public static final int GL_OBJECT_SUBTYPE_ARB = 0x8B4F;
|
||||
public static final int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80;
|
||||
public static final int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81;
|
||||
public static final int GL_OBJECT_LINK_STATUS_ARB = 0x8B82;
|
||||
public static final int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83;
|
||||
public static final int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84;
|
||||
public static final int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85;
|
||||
public static final int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86;
|
||||
public static final int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87;
|
||||
public static final int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88;
|
||||
|
||||
/*
|
||||
* Returned by the <params> parameter of GetObjectParameter{fi}vARB:
|
||||
*/
|
||||
public static final int GL_SHADER_OBJECT_ARB = 0x8B48;
|
||||
|
||||
/*
|
||||
* Returned by the <type> parameter of GetActiveUniformARB:
|
||||
*/
|
||||
public static final int GL_FLOAT = 0x1406;
|
||||
public static final int GL_FLOAT_VEC2_ARB = 0x8B50;
|
||||
public static final int GL_FLOAT_VEC3_ARB = 0x8B51;
|
||||
public static final int GL_FLOAT_VEC4_ARB = 0x8B52;
|
||||
public static final int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8b64;
|
||||
public static final int GL_SAMPLER_2D_RECT_ARB = 0x8b63;
|
||||
public static final int GL_SAMPLER_2D_SHADOW_ARB = 0x8b62;
|
||||
public static final int GL_SAMPLER_1D_SHADOW_ARB = 0x8b61;
|
||||
public static final int GL_SAMPLER_CUBE_ARB = 0x8b60;
|
||||
public static final int GL_SAMPLER_3D_ARB = 0x8b5f;
|
||||
public static final int GL_SAMPLER_2D_ARB = 0x8b5e;
|
||||
public static final int GL_SAMPLER_1D_ARB = 0x8b5d;
|
||||
public static final int GL_FLOAT_MAT4_ARB = 0x8b5c;
|
||||
public static final int GL_FLOAT_MAT3_ARB = 0x8b5b;
|
||||
public static final int GL_FLOAT_MAT2_ARB = 0x8b5a;
|
||||
public static final int GL_BOOL_VEC4_ARB = 0x8b59;
|
||||
public static final int GL_BOOL_VEC3_ARB = 0x8b58;
|
||||
public static final int GL_BOOL_VEC2_ARB = 0x8b57;
|
||||
public static final int GL_BOOL_ARB = 0x8b56;
|
||||
public static final int GL_INT_VEC4_ARB = 0x8b55;
|
||||
public static final int GL_INT_VEC3_ARB = 0x8b54;
|
||||
public static final int GL_INT_VEC2_ARB = 0x8b53;
|
||||
public static final int GL_INT = 0x1404;
|
||||
public static final int GL_INT_VEC2_ARB = 0x8B53;
|
||||
public static final int GL_INT_VEC3_ARB = 0x8B54;
|
||||
public static final int GL_INT_VEC4_ARB = 0x8B55;
|
||||
public static final int GL_BOOL_ARB = 0x8B56;
|
||||
public static final int GL_BOOL_VEC2_ARB = 0x8B57;
|
||||
public static final int GL_BOOL_VEC3_ARB = 0x8B58;
|
||||
public static final int GL_BOOL_VEC4_ARB = 0x8B59;
|
||||
public static final int GL_FLOAT_MAT2_ARB = 0x8B5A;
|
||||
public static final int GL_FLOAT_MAT3_ARB = 0x8B5B;
|
||||
public static final int GL_FLOAT_MAT4_ARB = 0x8B5C;
|
||||
public static final int GL_SAMPLER_1D_ARB = 0x8B5D;
|
||||
public static final int GL_SAMPLER_2D_ARB = 0x8B5E;
|
||||
public static final int GL_SAMPLER_3D_ARB = 0x8B5F;
|
||||
public static final int GL_SAMPLER_CUBE_ARB = 0x8B60;
|
||||
public static final int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61;
|
||||
public static final int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62;
|
||||
public static final int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
|
||||
public static final int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
|
||||
public static final int GL_FLOAT_VEC4_ARB = 0x8b52;
|
||||
public static final int GL_FLOAT_VEC3_ARB = 0x8b51;
|
||||
public static final int GL_FLOAT_VEC2_ARB = 0x8b50;
|
||||
public static final int GL_FLOAT = 0x1406;
|
||||
public static final int GL_SHADER_OBJECT_ARB = 0x8b48;
|
||||
public static final int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8b88;
|
||||
public static final int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8b87;
|
||||
public static final int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8b86;
|
||||
public static final int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8b85;
|
||||
public static final int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8b84;
|
||||
public static final int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8b83;
|
||||
public static final int GL_OBJECT_LINK_STATUS_ARB = 0x8b82;
|
||||
public static final int GL_OBJECT_COMPILE_STATUS_ARB = 0x8b81;
|
||||
public static final int GL_OBJECT_DELETE_STATUS_ARB = 0x8b80;
|
||||
public static final int GL_OBJECT_SUBTYPE_ARB = 0x8b4f;
|
||||
public static final int GL_OBJECT_TYPE_ARB = 0x8b4e;
|
||||
public static final int GL_PROGRAM_OBJECT_ARB = 0x8b40;
|
||||
|
||||
private ARBShaderObjects() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glDeleteObjectARB(int obj);
|
||||
|
||||
public static native int glGetHandleARB(int pname);
|
||||
|
||||
public static native void glDetachObjectARB(int containerObj, int attachedObj);
|
||||
|
||||
public static native int glCreateShaderObjectARB(int shaderType);
|
||||
|
||||
// ---------------------------
|
||||
/**
|
||||
* The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
|
||||
* <p/>
|
||||
* This method uses just a single string, that should NOT be null-terminated.
|
||||
*
|
||||
* @param shaderObj
|
||||
* @param string
|
||||
*/
|
||||
public static void glShaderSourceARB(int shaderObj, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
initShaderSource(1);
|
||||
setShaderString(0, string, string.position(), string.remaining());
|
||||
|
||||
nglShaderSourceARB(shaderObj);
|
||||
public static void glGetShaderSourceARB(int obj, IntBuffer length, ByteBuffer source) {
|
||||
if (length != null)
|
||||
BufferChecks.checkBuffer(length, 1);
|
||||
BufferChecks.checkDirect(source);
|
||||
nglGetShaderSourceARB(obj, (source.remaining()), length, length != null ? length.position() : 0, source, source.position());
|
||||
}
|
||||
private static native void nglGetShaderSourceARB(int obj, int maxLength, IntBuffer length, int length_position, ByteBuffer source, int source_position);
|
||||
|
||||
/**
|
||||
* The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
|
||||
* <p/>
|
||||
* This method uses an array of strings, that should NOT be null-terminated.
|
||||
*
|
||||
* @param shaderObj
|
||||
* @param strings
|
||||
*/
|
||||
public static void glShaderSourceARB(int shaderObj, ByteBuffer[] strings) {
|
||||
if ( strings == null || strings.length == 0 )
|
||||
throw new IllegalArgumentException("Invalid shader string array.");
|
||||
|
||||
initShaderSource(strings.length);
|
||||
for ( int i = 0; i < strings.length; i++ ) {
|
||||
BufferChecks.checkDirect(strings[i]);
|
||||
setShaderString(i, strings[i], strings[i].position(), strings[i].remaining());
|
||||
}
|
||||
|
||||
nglShaderSourceARB(shaderObj);
|
||||
}
|
||||
|
||||
private static native void initShaderSource(int count);
|
||||
|
||||
private static native void setShaderString(int index, ByteBuffer string, int stringOffset, int stringLength);
|
||||
|
||||
private static native void nglShaderSourceARB(int shaderObj);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glCompileShaderARB(int shaderObj);
|
||||
|
||||
public static native int glCreateProgramObjectARB();
|
||||
|
||||
public static native void glAttachObjectARB(int containerObj, int obj);
|
||||
|
||||
public static native void glLinkProgramARB(int programObj);
|
||||
|
||||
public static native void glUseProgramObjectARB(int programObj);
|
||||
|
||||
public static native void glValidateProgramARB(int programObj);
|
||||
|
||||
public static native void glUniform1fARB(int location, float v0);
|
||||
|
||||
public static native void glUniform2fARB(int location, float v0, float v1);
|
||||
|
||||
public static native void glUniform3fARB(int location, float v0, float v1, float v2);
|
||||
|
||||
public static native void glUniform4fARB(int location, float v0, float v1, float v2, float v3);
|
||||
|
||||
public static native void glUniform1iARB(int location, int v0);
|
||||
|
||||
public static native void glUniform2iARB(int location, int v0, int v1);
|
||||
|
||||
public static native void glUniform3iARB(int location, int v0, int v1, int v2);
|
||||
|
||||
public static native void glUniform4iARB(int location, int v0, int v1, int v2, int v3);
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform1ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1fvARB(location, values.remaining(), values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform1fvARB(int location, int count, FloatBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform2ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2fvARB(location, values.remaining() >> 1, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform2fvARB(int location, int count, FloatBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform3ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3fvARB(location, values.remaining() / 3, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform3fvARB(int location, int count, FloatBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform4ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4fvARB(location, values.remaining() >> 2, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform4fvARB(int location, int count, FloatBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform1ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1ivARB(location, values.remaining(), values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform1ivARB(int location, int count, IntBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform2ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2ivARB(location, values.remaining() >> 1, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform2ivARB(int location, int count, IntBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform3ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3ivARB(location, values.remaining() / 3, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform3ivARB(int location, int count, IntBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniform4ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4ivARB(location, values.remaining() >> 2, values, values.position());
|
||||
}
|
||||
|
||||
private static native void nglUniform4ivARB(int location, int count, IntBuffer values, int valuesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix2ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix2fvARB(location, matrices.remaining() >> 2, transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
private static native void nglUniformMatrix2fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matricesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix3ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix3fvARB(location, matrices.remaining() / (3 * 3), transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
private static native void nglUniformMatrix3fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matricesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix4ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix4fvARB(location, matrices.remaining() >> 4, transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
private static native void nglUniformMatrix4fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matricesOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetObjectParameterARB(int obj, int pname, FloatBuffer params) {
|
||||
public static void glGetUniformARB(int programObj, int location, IntBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetObjectParameterfvARB(obj, pname, params, params.position());
|
||||
nglGetUniformivARB(programObj, location, params, params.position());
|
||||
}
|
||||
private static native void nglGetUniformivARB(int programObj, int location, IntBuffer params, int params_position);
|
||||
|
||||
private static native void nglGetObjectParameterfvARB(int obj, int pname, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
public static void glGetUniformARB(int programObj, int location, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetUniformfvARB(programObj, location, params, params.position());
|
||||
}
|
||||
private static native void nglGetUniformfvARB(int programObj, int location, FloatBuffer params, int params_position);
|
||||
|
||||
public static void glGetActiveUniformARB(int programObj, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) {
|
||||
if (length != null)
|
||||
BufferChecks.checkBuffer(length, 1);
|
||||
BufferChecks.checkBuffer(size, 1);
|
||||
BufferChecks.checkBuffer(type, 1);
|
||||
BufferChecks.checkDirect(name);
|
||||
nglGetActiveUniformARB(programObj, index, (name.remaining()), length, length != null ? length.position() : 0, size, size.position(), type, type.position(), name, name.position());
|
||||
}
|
||||
private static native void nglGetActiveUniformARB(int programObj, int index, int maxLength, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position);
|
||||
|
||||
/**
|
||||
* Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a <b>null-terminated</b> string.
|
||||
* @param programObj
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static int glGetUniformLocationARB(int programObj, ByteBuffer name) {
|
||||
BufferChecks.checkDirect(name);
|
||||
BufferChecks.checkNullTerminated(name);
|
||||
int __result = nglGetUniformLocationARB(programObj, name, name.position());
|
||||
return __result;
|
||||
}
|
||||
private static native int nglGetUniformLocationARB(int programObj, ByteBuffer name, int name_position);
|
||||
|
||||
public static void glGetAttachedObjectsARB(int containerObj, IntBuffer count, IntBuffer obj) {
|
||||
if (count != null)
|
||||
BufferChecks.checkBuffer(count, 1);
|
||||
BufferChecks.checkDirect(obj);
|
||||
nglGetAttachedObjectsARB(containerObj, (obj.remaining()), count, count != null ? count.position() : 0, obj, obj.position());
|
||||
}
|
||||
private static native void nglGetAttachedObjectsARB(int containerObj, int maxCount, IntBuffer count, int count_position, IntBuffer obj, int obj_position);
|
||||
|
||||
public static void glGetInfoLogARB(int obj, IntBuffer length, ByteBuffer infoLog) {
|
||||
if (length != null)
|
||||
BufferChecks.checkBuffer(length, 1);
|
||||
BufferChecks.checkDirect(infoLog);
|
||||
nglGetInfoLogARB(obj, (infoLog.remaining()), length, length != null ? length.position() : 0, infoLog, infoLog.position());
|
||||
}
|
||||
private static native void nglGetInfoLogARB(int obj, int maxLength, IntBuffer length, int length_position, ByteBuffer infoLog, int infoLog_position);
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetObjectParameterARB(int obj, int pname, IntBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetObjectParameterivARB(obj, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetObjectParameterivARB(int obj, int pname, IntBuffer params, int params_position);
|
||||
|
||||
private static native void nglGetObjectParameterivARB(int obj, int pname, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetInfoLogARB(int obj, IntBuffer length, ByteBuffer infoLog) {
|
||||
BufferChecks.checkDirect(infoLog);
|
||||
if ( length == null ) {
|
||||
nglGetInfoLogARB(obj, infoLog.remaining(), null, -1, infoLog, infoLog.position());
|
||||
} else {
|
||||
BufferChecks.checkBuffer(length, 1);
|
||||
nglGetInfoLogARB(obj, infoLog.remaining(), length, length.position(), infoLog, infoLog.position());
|
||||
}
|
||||
public static void glGetObjectParameterARB(int obj, int pname, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetObjectParameterfvARB(obj, pname, params, params.position());
|
||||
}
|
||||
private static native void nglGetObjectParameterfvARB(int obj, int pname, FloatBuffer params, int params_position);
|
||||
|
||||
private static native void nglGetInfoLogARB(int obj, int maxLength, IntBuffer length, int lengthOffset, ByteBuffer infoLog, int infoLogOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetAttachedObjectsARB(int containerObj, IntBuffer count, IntBuffer obj) {
|
||||
if ( count == null )
|
||||
nglGetAttachedObjectsARB(containerObj, obj.remaining(), null, -1, obj, obj.position());
|
||||
else {
|
||||
if ( count.remaining() == 0 )
|
||||
throw new BufferOverflowException();
|
||||
|
||||
nglGetAttachedObjectsARB(containerObj, obj.remaining(), count, count.position(), obj, obj.position());
|
||||
}
|
||||
public static void glUniformMatrix4ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix4fvARB(location, (matrices.remaining()) >> 4, transpose, matrices, matrices.position());
|
||||
}
|
||||
private static native void nglUniformMatrix4fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position);
|
||||
|
||||
private static native void nglGetAttachedObjectsARB(int containerObj, int maxCount, IntBuffer count, int countOffset, IntBuffer obj, int objOffset);
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix3ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix3fvARB(location, (matrices.remaining()) / (3 * 3), transpose, matrices, matrices.position());
|
||||
}
|
||||
private static native void nglUniformMatrix3fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position);
|
||||
|
||||
public static void glUniformMatrix2ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix2fvARB(location, (matrices.remaining()) >> 2, transpose, matrices, matrices.position());
|
||||
}
|
||||
private static native void nglUniformMatrix2fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position);
|
||||
|
||||
public static void glUniform4ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4ivARB(location, (values.remaining()) >> 2, values, values.position());
|
||||
}
|
||||
private static native void nglUniform4ivARB(int location, int count, IntBuffer values, int values_position);
|
||||
|
||||
public static void glUniform3ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3ivARB(location, (values.remaining()) / 3, values, values.position());
|
||||
}
|
||||
private static native void nglUniform3ivARB(int location, int count, IntBuffer values, int values_position);
|
||||
|
||||
public static void glUniform2ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2ivARB(location, (values.remaining()) >> 1, values, values.position());
|
||||
}
|
||||
private static native void nglUniform2ivARB(int location, int count, IntBuffer values, int values_position);
|
||||
|
||||
public static void glUniform1ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1ivARB(location, (values.remaining()), values, values.position());
|
||||
}
|
||||
private static native void nglUniform1ivARB(int location, int count, IntBuffer values, int values_position);
|
||||
|
||||
public static void glUniform4ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4fvARB(location, (values.remaining()) >> 2, values, values.position());
|
||||
}
|
||||
private static native void nglUniform4fvARB(int location, int count, FloatBuffer values, int values_position);
|
||||
|
||||
public static void glUniform3ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3fvARB(location, (values.remaining()) / 3, values, values.position());
|
||||
}
|
||||
private static native void nglUniform3fvARB(int location, int count, FloatBuffer values, int values_position);
|
||||
|
||||
public static void glUniform2ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2fvARB(location, (values.remaining()) >> 1, values, values.position());
|
||||
}
|
||||
private static native void nglUniform2fvARB(int location, int count, FloatBuffer values, int values_position);
|
||||
|
||||
public static void glUniform1ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1fvARB(location, (values.remaining()), values, values.position());
|
||||
}
|
||||
private static native void nglUniform1fvARB(int location, int count, FloatBuffer values, int values_position);
|
||||
|
||||
public static native void glUniform4iARB(int location, int v0, int v1, int v2, int v3);
|
||||
|
||||
public static native void glUniform3iARB(int location, int v0, int v1, int v2);
|
||||
|
||||
public static native void glUniform2iARB(int location, int v0, int v1);
|
||||
|
||||
public static native void glUniform1iARB(int location, int v0);
|
||||
|
||||
public static native void glUniform4fARB(int location, float v0, float v1, float v2, float v3);
|
||||
|
||||
public static native void glUniform3fARB(int location, float v0, float v1, float v2);
|
||||
|
||||
public static native void glUniform2fARB(int location, float v0, float v1);
|
||||
|
||||
public static native void glUniform1fARB(int location, float v0);
|
||||
|
||||
public static native void glValidateProgramARB(int programObj);
|
||||
|
||||
public static native void glUseProgramObjectARB(int programObj);
|
||||
|
||||
public static native void glLinkProgramARB(int programObj);
|
||||
|
||||
public static native void glAttachObjectARB(int containerObj, int obj);
|
||||
|
||||
public static native int glCreateProgramObjectARB();
|
||||
|
||||
public static native void glCompileShaderARB(int shaderObj);
|
||||
|
||||
// ---------------------------
|
||||
/**
|
||||
* Returns the location of the uniform with the specified name. The ByteBuffer should contain the uniform name as a <b>null-terminated</b> string.
|
||||
*
|
||||
* @param programObj
|
||||
* @param name
|
||||
*
|
||||
* @return
|
||||
* The ARB_shader_objects extension allows multiple, optionally null-terminated, source strings to define a shader program.
|
||||
* <p/>
|
||||
* This method uses just a single string, that should NOT be null-terminated.
|
||||
* @param shaderObj
|
||||
* @param string
|
||||
*/
|
||||
public static int glGetUniformLocationARB(int programObj, ByteBuffer name) {
|
||||
// TODO: How do we check that the string is null-terminated?
|
||||
return nglGetUniformLocationARB(programObj, name, name.position());
|
||||
public static void glShaderSourceARB(int shader, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
nglShaderSourceARB(shader, 1, string, string.position(), (string.remaining()));
|
||||
}
|
||||
private static native void nglShaderSourceARB(int shader, int count, ByteBuffer string, int string_position, int length);
|
||||
|
||||
private static native int nglGetUniformLocationARB(int programObj, ByteBuffer name, int nameOffset);
|
||||
// ---------------------------
|
||||
public static native int glCreateShaderObjectARB(int shaderType);
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetActiveUniformARB(int programObj, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) {
|
||||
if ( size.remaining() == 0 )
|
||||
throw new BufferOverflowException();
|
||||
public static native void glDetachObjectARB(int containerObj, int attachedObj);
|
||||
|
||||
if ( type.remaining() == 0 )
|
||||
throw new BufferOverflowException();
|
||||
|
||||
if ( length == null )
|
||||
nglGetActiveUniformARB(programObj, index, name.remaining(), null, -1, size, size.position(), type, type.position(), name, name.position());
|
||||
else {
|
||||
if ( length.remaining() == 0 )
|
||||
throw new BufferOverflowException();
|
||||
|
||||
nglGetActiveUniformARB(programObj, index, name.remaining(), length, length.position(), size, size.position(), type, type.position(), name, name.position());
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nglGetActiveUniformARB(int programObj, int index, int maxLength, IntBuffer length, int lengthOffset, IntBuffer size, int sizeOffset, IntBuffer type, int typeOffset, ByteBuffer name, int nameOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetUniformARB(int programObj, int location, FloatBuffer params) {
|
||||
nglGetUniformfvARB(programObj, location, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetUniformfvARB(int programObj, int location, FloatBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetUniformARB(int programObj, int location, IntBuffer params) {
|
||||
nglGetUniformivARB(programObj, location, params, params.position());
|
||||
}
|
||||
|
||||
private static native void nglGetUniformivARB(int programObj, int location, IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetShaderSourceARB(int obj, IntBuffer length, ByteBuffer source) {
|
||||
if ( length == null )
|
||||
nglGetShaderSourceARB(obj, source.remaining(), null, -1, source, source.position());
|
||||
else {
|
||||
nglGetShaderSourceARB(obj, source.remaining(), length, length.position(), source, source.position());
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nglGetShaderSourceARB(int obj, int maxLength, IntBuffer length, int lengthOffset, ByteBuffer source, int sourceOffset);
|
||||
// ---------------------------
|
||||
public static native int glGetHandleARB(int pname);
|
||||
|
||||
public static native void glDeleteObjectARB(int obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,43 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBShadingLanguage100 {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
/*
|
||||
* Accepted by the <name> parameter of GetString:
|
||||
*/
|
||||
public static final int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C;
|
||||
public final class ARBShadingLanguage100 {
|
||||
/**
|
||||
* Accepted by the <name> parameter of GetString:
|
||||
*/
|
||||
public static final int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8b8c;
|
||||
|
||||
private ARBShadingLanguage100() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBShadow {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public static final int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C;
|
||||
public static final int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D;
|
||||
public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E;
|
||||
public final class ARBShadow {
|
||||
public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884e;
|
||||
public static final int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884d;
|
||||
public static final int GL_TEXTURE_COMPARE_MODE_ARB = 0x884c;
|
||||
|
||||
private ARBShadow() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBShadowAmbient {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF;
|
||||
public final class ARBShadowAmbient {
|
||||
public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80bf;
|
||||
|
||||
private ARBShadowAmbient() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBTextureBorderClamp {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public static final int GL_CLAMP_TO_BORDER_ARB = 0x812D;
|
||||
public final class ARBTextureBorderClamp {
|
||||
public static final int GL_CLAMP_TO_BORDER_ARB = 0x812d;
|
||||
|
||||
private ARBTextureBorderClamp() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,130 +1,137 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public final class ARBTextureCompression {
|
||||
|
||||
public static final int GL_COMPRESSED_ALPHA_ARB = 0x84E9;
|
||||
public static final int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA;
|
||||
public static final int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB;
|
||||
public static final int GL_COMPRESSED_INTENSITY_ARB = 0x84EC;
|
||||
public static final int GL_COMPRESSED_RGB_ARB = 0x84ED;
|
||||
public static final int GL_COMPRESSED_RGBA_ARB = 0x84EE;
|
||||
public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF;
|
||||
public static final int GL_TEXTURE_IMAGE_SIZE_ARB = 0x86A0;
|
||||
public static final int GL_TEXTURE_COMPRESSED_ARB = 0x86A1;
|
||||
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2;
|
||||
public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3;
|
||||
public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86a3;
|
||||
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86a2;
|
||||
public static final int GL_TEXTURE_COMPRESSED_ARB = 0x86a1;
|
||||
public static final int GL_TEXTURE_IMAGE_SIZE_ARB = 0x86a0;
|
||||
public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84ef;
|
||||
public static final int GL_COMPRESSED_RGBA_ARB = 0x84ee;
|
||||
public static final int GL_COMPRESSED_RGB_ARB = 0x84ed;
|
||||
public static final int GL_COMPRESSED_INTENSITY_ARB = 0x84ec;
|
||||
public static final int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84eb;
|
||||
public static final int GL_COMPRESSED_LUMINANCE_ARB = 0x84ea;
|
||||
public static final int GL_COMPRESSED_ALPHA_ARB = 0x84e9;
|
||||
|
||||
private ARBTextureCompression() {
|
||||
}
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position());
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 1);
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2);
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, FloatBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2);
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position());
|
||||
}
|
||||
private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_position);
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, int pImg_buffer_offset) {
|
||||
GLBufferChecks.ensurePackPBOenabled();
|
||||
nglGetCompressedTexImageARBBO(target, lod, pImg_buffer_offset);
|
||||
}
|
||||
private static native void nglGetCompressedTexImageARBBO(int target, int lod, int pImg_buffer_offset);
|
||||
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, int buffer_offset) {
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexImage1DARBBO(target, level, internalformat, width, border, imageSize, buffer_offset);
|
||||
nglCompressedTexSubImage3DARBBO(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexImage1DARBBO(int target, int level, int internalformat, int width, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
private static native void nglCompressedTexSubImage3DARBBO(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int pData_buffer_offset);
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) {
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position());
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) {
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 1);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) {
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer pData) {
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, int buffer_offset) {
|
||||
private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexImage2DARBBO(target, level, internalformat, width, height, border, imageSize, buffer_offset);
|
||||
nglCompressedTexSubImage2DARBBO(target, level, xoffset, yoffset, width, height, format, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexImage2DARBBO(int target, int level, int internalformat, int width, int height, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
private static native void nglCompressedTexSubImage2DARBBO(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, int pData_buffer_offset);
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) {
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position());
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexSubImage1DARBBO(target, level, xoffset, width, format, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage1DARBBO(int target, int level, int xoffset, int width, int format, int imageSize, int pData_buffer_offset);
|
||||
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
|
|
@ -140,127 +147,69 @@ public final class ARBTextureCompression {
|
|||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int buffer_offset) {
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexImage3DARBBO(target, level, internalformat, width, height, depth, border, imageSize, buffer_offset);
|
||||
nglCompressedTexImage3DARBBO(target, level, internalformat, width, height, depth, border, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexImage3DARBBO(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
private static native void nglCompressedTexImage3DARBBO(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int pData_buffer_offset);
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ByteBuffer pData) {
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position());
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ShortBuffer pData) {
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 1);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, IntBuffer pData) {
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, FloatBuffer pData) {
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, int buffer_offset) {
|
||||
private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexSubImage1DARBBO(target, level, xoffset, width, border, imageSize, buffer_offset);
|
||||
nglCompressedTexImage2DARBBO(target, level, internalformat, width, height, border, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage1DARBBO(int target, int level, int xoffset, int width, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
private static native void nglCompressedTexImage2DARBBO(int target, int level, int internalformat, int width, int height, int border, int imageSize, int pData_buffer_offset);
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ByteBuffer pData) {
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position());
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ShortBuffer pData) {
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 1);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, IntBuffer pData) {
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, FloatBuffer pData) {
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 2);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position());
|
||||
}
|
||||
private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, int buffer_offset) {
|
||||
private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_position);
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, int pData_buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexSubImage2DARBBO(target, level, xoffset, yoffset, width, height, border, imageSize, buffer_offset);
|
||||
nglCompressedTexImage1DARBBO(target, level, internalformat, width, border, imageSize, pData_buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage2DARBBO(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, IntBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) {
|
||||
GLBufferChecks.ensureUnpackPBOdisabled();
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset);
|
||||
|
||||
public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, int buffer_offset) {
|
||||
GLBufferChecks.ensureUnpackPBOenabled();
|
||||
nglCompressedTexSubImage3DARBBO(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, buffer_offset);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage3DARBBO(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, int buffer_offset);
|
||||
// ---------------------------
|
||||
|
||||
// ---------------------------
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position());
|
||||
}
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 1);
|
||||
}
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) {
|
||||
GLBufferChecks.ensurePackPBOdisabled();
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2);
|
||||
}
|
||||
private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_offset);
|
||||
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, int buffer_offset) {
|
||||
GLBufferChecks.ensurePackPBOenabled();
|
||||
nglGetCompressedTexImageARBBO(target, lod, buffer_offset);
|
||||
}
|
||||
private static native void nglGetCompressedTexImageARBBO(int target, int lod, int buffer_offset);
|
||||
// ---------------------------
|
||||
private static native void nglCompressedTexImage1DARBBO(int target, int level, int internalformat, int width, int border, int imageSize, int pData_buffer_offset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,51 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* MACHINE GENERATED FILE, DO NOT EDIT */
|
||||
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBTextureCubeMap {
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferChecks;
|
||||
import java.nio.*;
|
||||
|
||||
public static final int GL_NORMAL_MAP_ARB = 0x8511;
|
||||
public static final int GL_REFLECTION_MAP_ARB = 0x8512;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513;
|
||||
public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518;
|
||||
public final class ARBTextureCubeMap {
|
||||
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851c;
|
||||
public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851b;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851a;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A;
|
||||
public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B;
|
||||
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515;
|
||||
public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513;
|
||||
public static final int GL_REFLECTION_MAP_ARB = 0x8512;
|
||||
public static final int GL_NORMAL_MAP_ARB = 0x8511;
|
||||
|
||||
private ARBTextureCubeMap() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue