Added support for NV_path_rendering.
Made MappedObjectUnsafe package private.
This commit is contained in:
parent
d3d14b6f3c
commit
83c2208aa0
|
@ -31,11 +31,12 @@
|
|||
*/
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import java.nio.Buffer;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.FloatBuffer;
|
||||
|
||||
import static org.lwjgl.opengl.ARBBufferObject.*;
|
||||
import static org.lwjgl.opengl.ATIVertexArrayObject.*;
|
||||
import static org.lwjgl.opengl.EXTAbgr.*;
|
||||
|
@ -43,6 +44,7 @@ import static org.lwjgl.opengl.EXTBgra.*;
|
|||
import static org.lwjgl.opengl.EXTDirectStateAccess.*;
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
import static org.lwjgl.opengl.GL15.*;
|
||||
import static org.lwjgl.opengl.NVPathRendering.*;
|
||||
|
||||
/**
|
||||
* A class to check buffer boundaries in GL methods. Many GL
|
||||
|
@ -55,7 +57,7 @@ import static org.lwjgl.opengl.GL15.*;
|
|||
*
|
||||
* @author cix_foo <cix_foo@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
* $Id$
|
||||
* $Id$
|
||||
*/
|
||||
class GLChecks {
|
||||
|
||||
|
@ -81,25 +83,25 @@ class GLChecks {
|
|||
|
||||
/** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
|
||||
static void ensureArrayVBOdisabled(ContextCapabilities caps) {
|
||||
if( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).arrayBuffer != 0 )
|
||||
if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).arrayBuffer != 0 )
|
||||
throw new OpenGLException("Cannot use Buffers when Array Buffer Object is enabled");
|
||||
}
|
||||
|
||||
/** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
|
||||
static void ensureArrayVBOenabled(ContextCapabilities caps) {
|
||||
if( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).arrayBuffer == 0 )
|
||||
if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).arrayBuffer == 0 )
|
||||
throw new OpenGLException("Cannot use offsets when Array Buffer Object is disabled");
|
||||
}
|
||||
|
||||
/** Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
|
||||
static void ensureElementVBOdisabled(ContextCapabilities caps) {
|
||||
if( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) != 0 )
|
||||
if ( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) != 0 )
|
||||
throw new OpenGLException("Cannot use Buffers when Element Array Buffer Object is enabled");
|
||||
}
|
||||
|
||||
/** Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
|
||||
static void ensureElementVBOenabled(ContextCapabilities caps) {
|
||||
if( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) == 0 )
|
||||
if ( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) == 0 )
|
||||
throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled");
|
||||
}
|
||||
|
||||
|
@ -209,10 +211,10 @@ class GLChecks {
|
|||
case GL_FLOAT:
|
||||
bpe = 4;
|
||||
break;
|
||||
default :
|
||||
default:
|
||||
// TODO: Add more types (like the GL12 types GL_UNSIGNED_INT_8_8_8_8
|
||||
return 0;
|
||||
// throw new IllegalArgumentException("Unknown type " + type);
|
||||
// throw new IllegalArgumentException("Unknown type " + type);
|
||||
}
|
||||
int epp;
|
||||
switch ( format ) {
|
||||
|
@ -233,7 +235,7 @@ class GLChecks {
|
|||
case GL_BGRA_EXT:
|
||||
epp = 4;
|
||||
break;
|
||||
default :
|
||||
default:
|
||||
// TODO: Add more formats. Assuming 4 is too wasteful on buffer sizes where e.g. 1 is enough (like GL_DEPTH_COMPONENT)
|
||||
return 0;
|
||||
/* // Assume 4 elements per pixel
|
||||
|
@ -242,4 +244,116 @@ class GLChecks {
|
|||
|
||||
return bpe * epp;
|
||||
}
|
||||
}
|
||||
|
||||
// NV_path_rendering checks
|
||||
|
||||
static int calculateBytesPerCharCode(int type) {
|
||||
switch ( type ) {
|
||||
case GL_UNSIGNED_BYTE:
|
||||
case GL_UTF8_NV:
|
||||
return 1;
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_2_BYTES:
|
||||
case GL_UTF16_NV:
|
||||
return 2;
|
||||
case GL_3_BYTES:
|
||||
return 3;
|
||||
case GL_4_BYTES:
|
||||
return 4;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported charcode type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
static int calculateBytesPerPathName(int pathNameType) {
|
||||
switch ( pathNameType ) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
case GL_UTF8_NV:
|
||||
return 1;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_2_BYTES:
|
||||
case GL_UTF16_NV:
|
||||
return 2;
|
||||
case GL_3_BYTES:
|
||||
return 3;
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
case GL_4_BYTES:
|
||||
return 4;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported path name type: " + pathNameType);
|
||||
}
|
||||
}
|
||||
|
||||
static int calculateTransformPathValues(int transformType) {
|
||||
switch ( transformType ) {
|
||||
case GL_NONE:
|
||||
return 0;
|
||||
case GL_TRANSLATE_X_NV:
|
||||
case GL_TRANSLATE_Y_NV:
|
||||
return 1;
|
||||
case GL_TRANSLATE_2D_NV:
|
||||
return 2;
|
||||
case GL_TRANSLATE_3D_NV:
|
||||
return 3;
|
||||
case GL_AFFINE_2D_NV:
|
||||
case GL_TRANSPOSE_AFFINE_2D_NV:
|
||||
return 6;
|
||||
case GL_AFFINE_3D_NV:
|
||||
case GL_TRANSPOSE_AFFINE_3D_NV:
|
||||
return 12;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported transform type: " + transformType);
|
||||
}
|
||||
}
|
||||
|
||||
static int calculatePathColorGenCoeffsCount(int genMode, int colorFormat) {
|
||||
final int coeffsPerComponent = calculatePathGenCoeffsPerComponent(genMode);
|
||||
|
||||
switch ( colorFormat ) {
|
||||
case GL_RGB:
|
||||
return 3 * coeffsPerComponent;
|
||||
case GL_RGBA:
|
||||
return 4 * coeffsPerComponent;
|
||||
default:
|
||||
return coeffsPerComponent;
|
||||
}
|
||||
}
|
||||
|
||||
static int calculatePathTextGenCoeffsPerComponent(FloatBuffer coeffs, int genMode) {
|
||||
if ( genMode == GL_NONE )
|
||||
return 0;
|
||||
|
||||
return coeffs.remaining() / calculatePathGenCoeffsPerComponent(genMode);
|
||||
}
|
||||
|
||||
private static int calculatePathGenCoeffsPerComponent(int genMode) {
|
||||
switch ( genMode ) {
|
||||
case GL_NONE:
|
||||
return 0;
|
||||
case GL_OBJECT_LINEAR:
|
||||
case GL_PATH_OBJECT_BOUNDING_BOX_NV:
|
||||
return 3;
|
||||
case GL_EYE_LINEAR:
|
||||
return 4;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported gen mode: " + genMode);
|
||||
}
|
||||
}
|
||||
|
||||
static int calculateMetricsSize(int metricQueryMask, int stride) {
|
||||
if ( LWJGLUtil.DEBUG && (stride < 0 || (stride % 4) != 0) )
|
||||
throw new IllegalArgumentException("Invalid stride value: " + stride);
|
||||
|
||||
final int metrics = Integer.bitCount(metricQueryMask);
|
||||
|
||||
if ( LWJGLUtil.DEBUG && (stride >> 2) < metrics )
|
||||
throw new IllegalArgumentException("The queried metrics do not fit in the specified stride: " + stride);
|
||||
|
||||
return stride == 0 ? metrics : (stride >> 2);
|
||||
}
|
||||
|
||||
}
|
|
@ -32,7 +32,6 @@
|
|||
package org.lwjgl.test.mapped;
|
||||
|
||||
import org.lwjgl.MemoryUtil;
|
||||
import org.lwjgl.util.mapped.MappedObjectUnsafe;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -33,7 +33,6 @@ package org.lwjgl.test.mapped;
|
|||
|
||||
import org.lwjgl.MemoryUtil;
|
||||
import org.lwjgl.util.mapped.MappedHelper;
|
||||
import org.lwjgl.util.mapped.MappedObjectUnsafe;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import java.lang.annotation.ElementType;
|
|||
public @interface AutoSize {
|
||||
String value(); // The name of the Buffer parameter
|
||||
String expression() default ""; // This value is added after the argument
|
||||
boolean useExpression() default false; // When this is true, the expression result will be used directly.
|
||||
boolean canBeNull() default false; // When this is true and the Buffer parameter is null, 0 will be used.
|
||||
boolean isNative() default false; // When this is true, auto-sizing will be performed in native code.
|
||||
}
|
||||
|
|
|
@ -458,24 +458,26 @@ public class JavaMethodsGenerator {
|
|||
writer.print(auto_type);
|
||||
} else if (AutoSize.class.equals(param_type)) {
|
||||
final AutoSize auto_size_annotation = param.getAnnotation(AutoSize.class);
|
||||
final String auto_parameter_name = auto_size_annotation.value();
|
||||
final ParameterDeclaration auto_target_param = Utils.findParameter(method, auto_parameter_name);
|
||||
final TypeInfo auto_target_type_info = typeinfos_instance.get(auto_target_param);
|
||||
final boolean shift_remaining = !hasAnyParameterAutoTypeAnnotation(method, auto_target_param) && Utils.isParameterMultiTyped(auto_target_param);
|
||||
int shifting = 0;
|
||||
if ( shift_remaining ) {
|
||||
shifting = getBufferElementSizeExponent(auto_target_type_info.getType());
|
||||
if ( shifting > 0 )
|
||||
writer.print("(");
|
||||
}
|
||||
if ( auto_size_annotation.canBeNull() )
|
||||
writer.print("(" + auto_parameter_name + " == null ? 0 : " + auto_parameter_name + ".remaining())");
|
||||
else
|
||||
writer.print(auto_parameter_name + ".remaining()");
|
||||
// Shift the remaining if the target parameter is multityped and there's no AutoType to track type
|
||||
if (shift_remaining && shifting > 0) {
|
||||
writer.print(" << " + shifting);
|
||||
writer.print(")");
|
||||
if ( !auto_size_annotation.useExpression() ) {
|
||||
final String auto_parameter_name = auto_size_annotation.value();
|
||||
final ParameterDeclaration auto_target_param = Utils.findParameter(method, auto_parameter_name);
|
||||
final TypeInfo auto_target_type_info = typeinfos_instance.get(auto_target_param);
|
||||
final boolean shift_remaining = !hasAnyParameterAutoTypeAnnotation(method, auto_target_param) && Utils.isParameterMultiTyped(auto_target_param);
|
||||
int shifting = 0;
|
||||
if ( shift_remaining ) {
|
||||
shifting = getBufferElementSizeExponent(auto_target_type_info.getType());
|
||||
if ( shifting > 0 )
|
||||
writer.print("(");
|
||||
}
|
||||
if ( auto_size_annotation.canBeNull() )
|
||||
writer.print("(" + auto_parameter_name + " == null ? 0 : " + auto_parameter_name + ".remaining())");
|
||||
else
|
||||
writer.print(auto_parameter_name + ".remaining()");
|
||||
// Shift the remaining if the target parameter is multityped and there's no AutoType to track type
|
||||
if (shift_remaining && shifting > 0) {
|
||||
writer.print(" << " + shifting);
|
||||
writer.print(")");
|
||||
}
|
||||
}
|
||||
writer.print(auto_size_annotation.expression());
|
||||
} else
|
||||
|
|
|
@ -36,6 +36,8 @@ import org.lwjgl.MemoryUtil;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static org.lwjgl.util.mapped.MappedObjectUnsafe.*;
|
||||
|
||||
/**
|
||||
* [INTERNAL USE ONLY]
|
||||
* <p/>
|
||||
|
@ -122,7 +124,7 @@ public class MappedHelper {
|
|||
dst.checkRange(bytes);
|
||||
}
|
||||
|
||||
MappedObjectUnsafe.INSTANCE.copyMemory(src.viewAddress, dst.viewAddress, bytes);
|
||||
INSTANCE.copyMemory(src.viewAddress, dst.viewAddress, bytes);
|
||||
}
|
||||
|
||||
public static ByteBuffer newBuffer(long address, int capacity) {
|
||||
|
@ -134,257 +136,257 @@ public class MappedHelper {
|
|||
// byte
|
||||
|
||||
public static void bput(byte value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putByte(addr, value);
|
||||
INSTANCE.putByte(addr, value);
|
||||
}
|
||||
|
||||
public static void bput(MappedObject mapped, byte value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putByte(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putByte(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static byte bget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getByte(addr);
|
||||
return INSTANCE.getByte(addr);
|
||||
}
|
||||
|
||||
public static byte bget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getByte(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getByte(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void bvput(byte value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putByteVolatile(null, addr, value);
|
||||
INSTANCE.putByteVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void bvput(MappedObject mapped, byte value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putByteVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putByteVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static byte bvget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getByteVolatile(null, addr);
|
||||
return INSTANCE.getByteVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static byte bvget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getByteVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getByteVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// short
|
||||
|
||||
public static void sput(short value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putShort(addr, value);
|
||||
INSTANCE.putShort(addr, value);
|
||||
}
|
||||
|
||||
public static void sput(MappedObject mapped, short value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putShort(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putShort(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static short sget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getShort(addr);
|
||||
return INSTANCE.getShort(addr);
|
||||
}
|
||||
|
||||
public static short sget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getShort(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getShort(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void svput(short value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putShortVolatile(null, addr, value);
|
||||
INSTANCE.putShortVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void svput(MappedObject mapped, short value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putShortVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putShortVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static short svget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getShortVolatile(null, addr);
|
||||
return INSTANCE.getShortVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static short svget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getShortVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getShortVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// char
|
||||
|
||||
public static void cput(char value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putChar(addr, value);
|
||||
INSTANCE.putChar(addr, value);
|
||||
}
|
||||
|
||||
public static void cput(MappedObject mapped, char value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putChar(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putChar(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static char cget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getChar(addr);
|
||||
return INSTANCE.getChar(addr);
|
||||
}
|
||||
|
||||
public static char cget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getChar(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getChar(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void cvput(char value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putCharVolatile(null, addr, value);
|
||||
INSTANCE.putCharVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void cvput(MappedObject mapped, char value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putCharVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putCharVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static char cvget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getCharVolatile(null, addr);
|
||||
return INSTANCE.getCharVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static char cvget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getCharVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getCharVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// int
|
||||
|
||||
public static void iput(int value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putInt(addr, value);
|
||||
INSTANCE.putInt(addr, value);
|
||||
}
|
||||
|
||||
public static void iput(MappedObject mapped, int value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putInt(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putInt(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static int iget(long address) {
|
||||
return MappedObjectUnsafe.INSTANCE.getInt(address);
|
||||
return INSTANCE.getInt(address);
|
||||
}
|
||||
|
||||
public static int iget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getInt(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getInt(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void ivput(int value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putIntVolatile(null, addr, value);
|
||||
INSTANCE.putIntVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void ivput(MappedObject mapped, int value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putIntVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putIntVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static int ivget(long address) {
|
||||
return MappedObjectUnsafe.INSTANCE.getIntVolatile(null, address);
|
||||
return INSTANCE.getIntVolatile(null, address);
|
||||
}
|
||||
|
||||
public static int ivget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getIntVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getIntVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// float
|
||||
|
||||
public static void fput(float value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putFloat(addr, value);
|
||||
INSTANCE.putFloat(addr, value);
|
||||
}
|
||||
|
||||
public static void fput(MappedObject mapped, float value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putFloat(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putFloat(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static float fget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getFloat(addr);
|
||||
return INSTANCE.getFloat(addr);
|
||||
}
|
||||
|
||||
public static float fget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getFloat(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getFloat(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void fvput(float value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putFloatVolatile(null, addr, value);
|
||||
INSTANCE.putFloatVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void fvput(MappedObject mapped, float value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putFloatVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putFloatVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static float fvget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getFloatVolatile(null, addr);
|
||||
return INSTANCE.getFloatVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static float fvget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getFloatVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getFloatVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// long
|
||||
|
||||
public static void jput(long value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putLong(addr, value);
|
||||
INSTANCE.putLong(addr, value);
|
||||
}
|
||||
|
||||
public static void jput(MappedObject mapped, long value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putLong(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putLong(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static long jget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getLong(addr);
|
||||
return INSTANCE.getLong(addr);
|
||||
}
|
||||
|
||||
public static long lget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getLong(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getLong(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void jvput(long value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putLongVolatile(null, addr, value);
|
||||
INSTANCE.putLongVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void jvput(MappedObject mapped, long value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putLongVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putLongVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static long jvget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getLongVolatile(null, addr);
|
||||
return INSTANCE.getLongVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static long lvget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getLongVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getLongVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// address
|
||||
|
||||
public static void aput(long value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putAddress(addr, value);
|
||||
INSTANCE.putAddress(addr, value);
|
||||
}
|
||||
|
||||
public static void aput(MappedObject mapped, long value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putAddress(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putAddress(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static long aget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getAddress(addr);
|
||||
return INSTANCE.getAddress(addr);
|
||||
}
|
||||
|
||||
public static long aget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getAddress(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getAddress(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
// double
|
||||
|
||||
public static void dput(double value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putDouble(addr, value);
|
||||
INSTANCE.putDouble(addr, value);
|
||||
}
|
||||
|
||||
public static void dput(MappedObject mapped, double value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putDouble(mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putDouble(mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static double dget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getDouble(addr);
|
||||
return INSTANCE.getDouble(addr);
|
||||
}
|
||||
|
||||
public static double dget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getDouble(mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getDouble(mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
public static void dvput(double value, long addr) {
|
||||
MappedObjectUnsafe.INSTANCE.putDoubleVolatile(null, addr, value);
|
||||
INSTANCE.putDoubleVolatile(null, addr, value);
|
||||
}
|
||||
|
||||
public static void dvput(MappedObject mapped, double value, int fieldOffset) {
|
||||
MappedObjectUnsafe.INSTANCE.putDoubleVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
INSTANCE.putDoubleVolatile(null, mapped.viewAddress + fieldOffset, value);
|
||||
}
|
||||
|
||||
public static double dvget(long addr) {
|
||||
return MappedObjectUnsafe.INSTANCE.getDoubleVolatile(null, addr);
|
||||
return INSTANCE.getDoubleVolatile(null, addr);
|
||||
}
|
||||
|
||||
public static double dvget(MappedObject mapped, int fieldOffset) {
|
||||
return MappedObjectUnsafe.INSTANCE.getDoubleVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
return INSTANCE.getDoubleVolatile(null, mapped.viewAddress + fieldOffset);
|
||||
}
|
||||
|
||||
}
|
|
@ -549,10 +549,10 @@ public class MappedObjectTransformer {
|
|||
final Map<Integer, MappedSubtypeInfo> arrayVars = new HashMap<Integer, MappedSubtypeInfo>();
|
||||
|
||||
/*
|
||||
We need this map because we insert/remove instructions from the stream and we need a way
|
||||
to match each original instruction with the corresponding frame.
|
||||
TODO: Can we keep track of everything more efficiently without a map?
|
||||
*/
|
||||
We need this map because we insert/remove instructions from the stream and we need a way
|
||||
to match each original instruction with the corresponding frame.
|
||||
TODO: Can we keep track of everything more efficiently without a map?
|
||||
*/
|
||||
final Map<AbstractInsnNode, Frame<BasicValue>> frameMap = new HashMap<AbstractInsnNode, Frame<BasicValue>>();
|
||||
for ( int i = 0; i < frames.length; i++ )
|
||||
frameMap.put(instructions.get(i), frames[i]);
|
||||
|
|
|
@ -42,9 +42,9 @@ import sun.misc.Unsafe;
|
|||
*
|
||||
* @author Riven
|
||||
*/
|
||||
public class MappedObjectUnsafe {
|
||||
final class MappedObjectUnsafe {
|
||||
|
||||
public static final Unsafe INSTANCE = getUnsafeInstance();
|
||||
static final Unsafe INSTANCE = getUnsafeInstance();
|
||||
|
||||
private static final long BUFFER_ADDRESS_OFFSET = getObjectFieldOffset(ByteBuffer.class, "address");
|
||||
private static final long BUFFER_CAPACITY_OFFSET = getObjectFieldOffset(ByteBuffer.class, "capacity");
|
||||
|
|
|
@ -0,0 +1,515 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2011 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.util.generator.*;
|
||||
import org.lwjgl.util.generator.opengl.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
public interface NV_path_rendering {
|
||||
|
||||
/**
|
||||
* Accepted in elements of the <commands> array parameter of
|
||||
* PathCommandsNV and PathSubCommandsNV:
|
||||
*/
|
||||
int GL_CLOSE_PATH_NV = 0x00,
|
||||
GL_MOVE_TO_NV = 0x02,
|
||||
GL_RELATIVE_MOVE_TO_NV = 0x03,
|
||||
GL_LINE_TO_NV = 0x04,
|
||||
GL_RELATIVE_LINE_TO_NV = 0x05,
|
||||
GL_HORIZONTAL_LINE_TO_NV = 0x06,
|
||||
GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07,
|
||||
GL_VERTICAL_LINE_TO_NV = 0x08,
|
||||
GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x09,
|
||||
GL_QUADRATIC_CURVE_TO_NV = 0x0A,
|
||||
GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B,
|
||||
GL_CUBIC_CURVE_TO_NV = 0x0C,
|
||||
GL_RELATIVE_CUBIC_CURVE_TO_NV = 0x0D,
|
||||
GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E,
|
||||
GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F,
|
||||
GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10,
|
||||
GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11,
|
||||
GL_SMALL_CCW_ARC_TO_NV = 0x12,
|
||||
GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13,
|
||||
GL_SMALL_CW_ARC_TO_NV = 0x14,
|
||||
GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15,
|
||||
GL_LARGE_CCW_ARC_TO_NV = 0x16,
|
||||
GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17,
|
||||
GL_LARGE_CW_ARC_TO_NV = 0x18,
|
||||
GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19,
|
||||
GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8,
|
||||
GL_CIRCULAR_CW_ARC_TO_NV = 0xFA,
|
||||
GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC,
|
||||
GL_ARC_TO_NV = 0xFE,
|
||||
GL_RELATIVE_ARC_TO_NV = 0xFF;
|
||||
|
||||
/** Accepted by the <format> parameter of PathStringNV: */
|
||||
int GL_PATH_FORMAT_SVG_NV = 0x9070,
|
||||
GL_PATH_FORMAT_PS_NV = 0x9071;
|
||||
|
||||
/**
|
||||
* Accepted by the <fontTarget> parameter of PathGlyphsNV and
|
||||
* PathGlyphRangeNV:
|
||||
*/
|
||||
int GL_STANDARD_FONT_NAME_NV = 0x9072,
|
||||
GL_SYSTEM_FONT_NAME_NV = 0x9073,
|
||||
GL_FILE_NAME_NV = 0x9074;
|
||||
|
||||
/**
|
||||
* Accepted by the <handleMissingGlyph> parameter of PathGlyphsNV and
|
||||
* PathGlyphRangeNV:
|
||||
*/
|
||||
int GL_SKIP_MISSING_GLYPH_NV = 0x90A9,
|
||||
GL_USE_MISSING_GLYPH_NV = 0x90AA;
|
||||
|
||||
/**
|
||||
* Accepted by the <pname> parameter of PathParameterfNV,
|
||||
* PathParameterfvNV, GetPathParameterfvNV, PathParameteriNV,
|
||||
* PathParameterivNV, and GetPathParameterivNV:
|
||||
*/
|
||||
int GL_PATH_STROKE_WIDTH_NV = 0x9075,
|
||||
GL_PATH_INITIAL_END_CAP_NV = 0x9077,
|
||||
GL_PATH_TERMINAL_END_CAP_NV = 0x9078,
|
||||
GL_PATH_JOIN_STYLE_NV = 0x9079,
|
||||
GL_PATH_MITER_LIMIT_NV = 0x907A,
|
||||
GL_PATH_INITIAL_DASH_CAP_NV = 0x907C,
|
||||
GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D,
|
||||
GL_PATH_DASH_OFFSET_NV = 0x907E,
|
||||
GL_PATH_CLIENT_LENGTH_NV = 0x907F,
|
||||
GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4,
|
||||
|
||||
GL_PATH_FILL_MODE_NV = 0x9080,
|
||||
GL_PATH_FILL_MASK_NV = 0x9081,
|
||||
GL_PATH_FILL_COVER_MODE_NV = 0x9082,
|
||||
GL_PATH_STROKE_COVER_MODE_NV = 0x9083,
|
||||
GL_PATH_STROKE_MASK_NV = 0x9084;
|
||||
|
||||
/**
|
||||
* Accepted by the <pname> parameter of PathParameterfNV and
|
||||
* PathParameterfvNV:
|
||||
*/
|
||||
int GL_PATH_END_CAPS_NV = 0x9076,
|
||||
GL_PATH_DASH_CAPS_NV = 0x907B;
|
||||
|
||||
/**
|
||||
* Accepted by the <fillMode> parameter of StencilFillPathNV and
|
||||
* StencilFillPathInstancedNV:
|
||||
*/
|
||||
int GL_COUNT_UP_NV = 0x9088,
|
||||
GL_COUNT_DOWN_NV = 0x9089;
|
||||
|
||||
/**
|
||||
* Accepted by the <color> parameter of PathColorGenNV,
|
||||
* GetPathColorGenivNV, and GetPathColorGenfvNV:
|
||||
*/
|
||||
int GL_PRIMARY_COLOR = 0x8577, // from OpenGL 1.3
|
||||
GL_PRIMARY_COLOR_NV = 0x852C, // from NV_register_combiners
|
||||
GL_SECONDARY_COLOR_NV = 0x852D; // from NV_register_combiners
|
||||
|
||||
/**
|
||||
* Accepted by the <genMode> parameter of PathColorGenNV and
|
||||
* PathTexGenNV:
|
||||
*/
|
||||
int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A;
|
||||
|
||||
/**
|
||||
* Accepted by the <coverMode> parameter of CoverFillPathNV and
|
||||
* CoverFillPathInstancedNV:
|
||||
*/
|
||||
int GL_CONVEX_HULL_NV = 0x908B,
|
||||
GL_BOUNDING_BOX_NV = 0x908D;
|
||||
|
||||
/**
|
||||
* Accepted by the <transformType> parameter of
|
||||
* StencilFillPathInstancedNV, StencilStrokePathInstancedNV,
|
||||
* CoverFillPathInstancedNV, and CoverStrokePathInstancedNV:
|
||||
*/
|
||||
int GL_TRANSLATE_X_NV = 0x908E,
|
||||
GL_TRANSLATE_Y_NV = 0x908F,
|
||||
GL_TRANSLATE_2D_NV = 0x9090,
|
||||
GL_TRANSLATE_3D_NV = 0x9091,
|
||||
GL_AFFINE_2D_NV = 0x9092,
|
||||
GL_AFFINE_3D_NV = 0x9094,
|
||||
GL_TRANSPOSE_AFFINE_2D_NV = 0x9096,
|
||||
GL_TRANSPOSE_AFFINE_3D_NV = 0x9098;
|
||||
|
||||
/**
|
||||
* Accepted by the <type> or <pathNameType> parameter of CallLists,
|
||||
* StencilFillPathInstancedNV, StencilStrokePathInstancedNV,
|
||||
* CoverFillPathInstancedNV, CoverStrokePathInstancedNV,
|
||||
* GetPathMetricsNV, and GetPathSpacingNV:
|
||||
*/
|
||||
int GL_UTF8_NV = 0x909A,
|
||||
GL_UTF16_NV = 0x909B;
|
||||
|
||||
/** Accepted by the <coverMode> parameter of CoverFillPathInstancedNV: */
|
||||
int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C;
|
||||
|
||||
/**
|
||||
* Accepted by the <pname> parameter of GetPathParameterfvNV and
|
||||
* GetPathParameterivNV:
|
||||
*/
|
||||
int GL_PATH_COMMAND_COUNT_NV = 0x909D,
|
||||
GL_PATH_COORD_COUNT_NV = 0x909E,
|
||||
GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F,
|
||||
GL_PATH_COMPUTED_LENGTH_NV = 0x90A0,
|
||||
GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1,
|
||||
GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2;
|
||||
|
||||
/**
|
||||
* Accepted by the <value> parameter of PathParameterfNV,
|
||||
* PathParameterfvNV, PathParameteriNV, and PathParameterivNV
|
||||
* when <pname> is one of PATH_END_CAPS_NV, PATH_INTIAL_END_CAP_NV,
|
||||
* PATH_TERMINAL_END_CAP_NV, PATH_DASH_CAPS_NV, PATH_INITIAL_DASH_CAP_NV,
|
||||
* and PATH_TERMINAL_DASH_CAP_NV:
|
||||
*/
|
||||
int GL_SQUARE_NV = 0x90A3,
|
||||
GL_ROUND_NV = 0x90A4,
|
||||
GL_TRIANGULAR_NV = 0x90A5;
|
||||
|
||||
/**
|
||||
* Accepted by the <value> parameter of PathParameterfNV,
|
||||
* PathParameterfvNV, PathParameteriNV, and PathParameterivNV
|
||||
* when <pname> is PATH_JOIN_STYLE_NV:
|
||||
*/
|
||||
int GL_BEVEL_NV = 0x90A6,
|
||||
GL_MITER_REVERT_NV = 0x90A7,
|
||||
GL_MITER_TRUNCATE_NV = 0x90A8;
|
||||
|
||||
/**
|
||||
* Accepted by the <value> parameter of PathParameterfNV,
|
||||
* PathParameterfvNV, PathParameteriNV, and PathParameterivNV when
|
||||
* <pname> is PATH_DASH_OFFSET_RESET_NV
|
||||
*/
|
||||
int GL_MOVE_TO_RESETS_NV = 0x90B5,
|
||||
GL_MOVE_TO_CONTINUES_NV = 0x90B6;
|
||||
|
||||
/** Accepted by the <fontStyle> parameter of PathStringNV: */
|
||||
int GL_BOLD_BIT_NV = 0x01,
|
||||
GL_ITALIC_BIT_NV = 0x02;
|
||||
|
||||
/**
|
||||
* Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
* GetInteger64v, GetFloatv, and GetDoublev:
|
||||
*/
|
||||
int GL_PATH_ERROR_POSITION_NV = 0x90AB,
|
||||
|
||||
GL_PATH_FOG_GEN_MODE_NV = 0x90AC,
|
||||
|
||||
GL_PATH_STENCIL_FUNC_NV = 0x90B7,
|
||||
GL_PATH_STENCIL_REF_NV = 0x90B8,
|
||||
GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9,
|
||||
|
||||
GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD,
|
||||
GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE,
|
||||
|
||||
GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF;
|
||||
|
||||
/**
|
||||
* Accepted as a bit within the <metricQueryMask> parameter of
|
||||
* GetPathMetricRangeNV or GetPathMetricsNV:
|
||||
*/
|
||||
|
||||
int GL_GLYPH_WIDTH_BIT_NV = 0x01, // per-glyph metrics
|
||||
GL_GLYPH_HEIGHT_BIT_NV = 0x02,
|
||||
GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04,
|
||||
GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08,
|
||||
GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10,
|
||||
GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20,
|
||||
GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40,
|
||||
GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80,
|
||||
GL_GLYPH_HAS_KERNING_NV = 0x100,
|
||||
GL_FONT_X_MIN_BOUNDS_NV = 0x00010000, // per-font face metrics
|
||||
GL_FONT_Y_MIN_BOUNDS_NV = 0x00020000,
|
||||
GL_FONT_X_MAX_BOUNDS_NV = 0x00040000,
|
||||
GL_FONT_Y_MAX_BOUNDS_NV = 0x00080000,
|
||||
GL_FONT_UNITS_PER_EM_NV = 0x00100000,
|
||||
GL_FONT_ASCENDER_NV = 0x00200000,
|
||||
GL_FONT_DESCENDER_NV = 0x00400000,
|
||||
GL_FONT_HEIGHT_NV = 0x00800000,
|
||||
GL_FONT_MAX_ADVANCE_WIDTH_NV = 0x01000000,
|
||||
GL_FONT_MAX_ADVANCE_HEIGHT_NV = 0x02000000,
|
||||
GL_FONT_UNDERLINE_POSITION_NV = 0x04000000,
|
||||
GL_FONT_UNDERLINE_THICKNESS_NV = 0x08000000,
|
||||
GL_FONT_HAS_KERNING_NV = 0x10000000;
|
||||
|
||||
/** Accepted by the <pathListMode> parameter of GetPathSpacingNV: */
|
||||
int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD,
|
||||
GL_ADJACENT_PAIRS_NV = 0x90AE,
|
||||
GL_FIRST_TO_REST_NV = 0x90AF;
|
||||
|
||||
/**
|
||||
* Accepted by the <pname> parameter of GetPathColorGenivNV,
|
||||
* GetPathColorGenfvNV, GetPathTexGenivNV and GetPathTexGenfvNV:
|
||||
*/
|
||||
int GL_PATH_GEN_MODE_NV = 0x90B0,
|
||||
GL_PATH_GEN_COEFF_NV = 0x90B1,
|
||||
GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2,
|
||||
GL_PATH_GEN_COMPONENTS_NV = 0x90B3;
|
||||
|
||||
void glPathCommandsNV(@GLuint int path,
|
||||
@AutoSize("commands") @GLsizei int numCommands, @Const @GLubyte ByteBuffer commands,
|
||||
@AutoSize("coords") @GLsizei int numCoords, @GLenum int coordType,
|
||||
@Const @GLvoid ByteBuffer coords);
|
||||
|
||||
void glPathCoordsNV(@GLuint int path,
|
||||
@AutoSize("coords") @GLsizei int numCoords, @GLenum int coordType,
|
||||
@Const @GLvoid ByteBuffer coords);
|
||||
|
||||
void glPathSubCommandsNV(@GLuint int path,
|
||||
@GLsizei int commandStart, @GLsizei int commandsToDelete,
|
||||
@AutoSize("commands") @GLsizei int numCommands, @Const @GLubyte ByteBuffer commands,
|
||||
@AutoSize("coords") @GLsizei int numCoords, @GLenum int coordType,
|
||||
@Const @GLvoid ByteBuffer coords);
|
||||
|
||||
void glPathSubCoordsNV(@GLuint int path,
|
||||
@GLsizei int coordStart,
|
||||
@AutoSize("coords") @GLsizei int numCoords, @GLenum int coordType,
|
||||
@Const @GLvoid ByteBuffer coords);
|
||||
|
||||
void glPathStringNV(@GLuint int path, @GLenum int format,
|
||||
@AutoSize("pathString") @GLsizei int length, @Const @GLvoid ByteBuffer pathString);
|
||||
|
||||
void glPathGlyphsNV(@GLuint int firstPathName,
|
||||
@GLenum int fontTarget,
|
||||
@NullTerminated @Const @GLvoid ByteBuffer fontName,
|
||||
@GLbitfield int fontStyle,
|
||||
@AutoSize(value = "charcodes", expression = " / GLChecks.calculateBytesPerCharCode(type)") @GLsizei int numGlyphs, @GLenum int type,
|
||||
@Const @GLvoid ByteBuffer charcodes,
|
||||
@GLenum int handleMissingGlyphs,
|
||||
@GLuint int pathParameterTemplate,
|
||||
float emScale);
|
||||
|
||||
void glPathGlyphRangeNV(@GLuint int firstPathName,
|
||||
@GLenum int fontTarget,
|
||||
@NullTerminated @Const @GLvoid ByteBuffer fontName,
|
||||
@GLbitfield int fontStyle,
|
||||
@GLuint int firstGlyph,
|
||||
@GLsizei int numGlyphs,
|
||||
@GLenum int handleMissingGlyphs,
|
||||
@GLuint int pathParameterTemplate,
|
||||
float emScale);
|
||||
|
||||
void glWeightPathsNV(@GLuint int resultPath,
|
||||
@AutoSize("paths") @GLsizei int numPaths,
|
||||
@Const @GLuint IntBuffer paths, @Check("paths.remaining()") @Const FloatBuffer weights);
|
||||
|
||||
void glCopyPathNV(@GLuint int resultPath, @GLuint int srcPath);
|
||||
|
||||
void glInterpolatePathsNV(@GLuint int resultPath,
|
||||
@GLuint int pathA, @GLuint int pathB,
|
||||
float weight);
|
||||
|
||||
void glTransformPathNV(@GLuint int resultPath,
|
||||
@GLuint int srcPath,
|
||||
@GLenum int transformType,
|
||||
@Check(value = "GLChecks.calculateTransformPathValues(transformType)", canBeNull = true) @Const FloatBuffer transformValues);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glPathParameterivNV(@GLuint int path, @GLenum int pname, @Check("4") @Const IntBuffer value);
|
||||
|
||||
void glPathParameteriNV(@GLuint int path, @GLenum int pname, int value);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glPathParameterfvNV(@GLuint int path, @GLenum int pname, @Check("4") @Const IntBuffer value);
|
||||
|
||||
void glPathParameterfNV(@GLuint int path, @GLenum int pname, float value);
|
||||
|
||||
void glPathDashArrayNV(@GLuint int path,
|
||||
@AutoSize("dashArray") @GLsizei int dashCount, @Const FloatBuffer dashArray);
|
||||
|
||||
// PATH NAME MANAGEMENT
|
||||
|
||||
@GLuint
|
||||
int glGenPathsNV(@GLsizei int range);
|
||||
|
||||
void glDeletePathsNV(@GLuint int path, @GLsizei int range);
|
||||
|
||||
boolean glIsPathNV(@GLuint int path);
|
||||
|
||||
// PATH STENCILING
|
||||
|
||||
void glPathStencilFuncNV(@GLenum int func, int ref, @GLuint int mask);
|
||||
|
||||
void glPathStencilDepthOffsetNV(float factor, int units);
|
||||
|
||||
void glStencilFillPathNV(@GLuint int path,
|
||||
@GLenum int fillMode, @GLuint int mask);
|
||||
|
||||
void glStencilStrokePathNV(@GLuint int path,
|
||||
int reference, @GLuint int mask);
|
||||
|
||||
void glStencilFillPathInstancedNV(@AutoSize(value="paths", expression = " / GLChecks.calculateBytesPerPathName(pathNameType)") @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
@GLenum int fillMode, @GLuint int mask,
|
||||
@GLenum int transformType,
|
||||
@Check(value = "GLChecks.calculateTransformPathValues(transformType)", canBeNull = true) @Const FloatBuffer transformValues);
|
||||
|
||||
void glStencilStrokePathInstancedNV(@AutoSize(value = "paths", expression = " / GLChecks.calculateBytesPerPathName(pathNameType)") @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
int reference, @GLuint int mask,
|
||||
@GLenum int transformType,
|
||||
@Check(value = "GLChecks.calculateTransformPathValues(transformType)", canBeNull = true) @Const FloatBuffer transformValues);
|
||||
|
||||
// PATH COVERING
|
||||
|
||||
void glPathCoverDepthFuncNV(@GLenum int zfunc);
|
||||
|
||||
void glPathColorGenNV(@GLenum int color,
|
||||
@GLenum int genMode,
|
||||
@GLenum int colorFormat, @Check(value = "GLChecks.calculatePathColorGenCoeffsCount(genMode, colorFormat)", canBeNull = true) @Const FloatBuffer coeffs);
|
||||
|
||||
void glPathTexGenNV(@GLenum int texCoordSet,
|
||||
@GLenum int genMode,
|
||||
@AutoSize(value="coeffs", expression="GLChecks.calculatePathTextGenCoeffsPerComponent(coeffs, genMode)", useExpression = true, canBeNull = true) int components, @Check(canBeNull = true) @Const FloatBuffer coeffs);
|
||||
|
||||
void glPathFogGenNV(@GLenum int genMode);
|
||||
|
||||
void glCoverFillPathNV(@GLuint int path, @GLenum int coverMode);
|
||||
|
||||
void glCoverStrokePathNV(@GLuint int name, @GLenum int coverMode);
|
||||
|
||||
void glCoverFillPathInstancedNV(@AutoSize(value = "paths", expression = " / GLChecks.calculateBytesPerPathName(pathNameType)") @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
@GLenum int coverMode,
|
||||
@GLenum int transformType,
|
||||
@Check(value = "GLChecks.calculateTransformPathValues(transformType)", canBeNull = true) @Const FloatBuffer transformValues);
|
||||
|
||||
void glCoverStrokePathInstancedNV(@AutoSize(value = "paths", expression = " / GLChecks.calculateBytesPerPathName(pathNameType)") @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
@GLenum int coverMode,
|
||||
@GLenum int transformType,
|
||||
@Check(value = "GLChecks.calculateTransformPathValues(transformType)", canBeNull = true) @Const FloatBuffer transformValues);
|
||||
|
||||
// PATH QUERIES
|
||||
|
||||
@StripPostfix("value")
|
||||
void glGetPathParameterivNV(@GLuint int name, @GLenum int param, @Check("4") @OutParameter IntBuffer value);
|
||||
|
||||
@Alternate("glGetPathParameterivNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathParameterivNV2(@GLuint int name, @GLenum int param, @OutParameter IntBuffer value);
|
||||
|
||||
void glGetPathParameterfvNV(@GLuint int name, @GLenum int param, @Check("4") @OutParameter FloatBuffer value);
|
||||
|
||||
@Alternate("glGetPathParameterfvNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathParameterfvNV2(@GLuint int name, @GLenum int param, @OutParameter FloatBuffer value);
|
||||
|
||||
void glGetPathCommandsNV(@GLuint int name, @Check @OutParameter @GLubyte ByteBuffer commands);
|
||||
|
||||
void glGetPathCoordsNV(@GLuint int name, @Check @OutParameter FloatBuffer coords);
|
||||
|
||||
void glGetPathDashArrayNV(@GLuint int name, @Check @OutParameter FloatBuffer dashArray);
|
||||
|
||||
void glGetPathMetricsNV(@GLbitfield int metricQueryMask,
|
||||
@AutoSize(value = "paths", expression = " / GLChecks.calculateBytesPerPathName(pathNameType)") @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
@GLsizei int stride,
|
||||
@Check("GLChecks.calculateMetricsSize(metricQueryMask, stride)") @OutParameter FloatBuffer metrics);
|
||||
|
||||
void glGetPathMetricRangeNV(@GLbitfield int metricQueryMask,
|
||||
@GLuint int fistPathName,
|
||||
@GLsizei int numPaths,
|
||||
@GLsizei int stride,
|
||||
@Check("GLChecks.calculateMetricsSize(metricQueryMask, stride)") @OutParameter FloatBuffer metrics);
|
||||
|
||||
@Code("\t\tint numPaths = paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType);")
|
||||
void glGetPathSpacingNV(@GLenum int pathListMode,
|
||||
@AutoSize(value = "paths", expression = "numPaths", useExpression = true) @GLsizei int numPaths,
|
||||
@GLenum int pathNameType, @Const @GLvoid ByteBuffer paths,
|
||||
@Constant("0") @GLuint int pathBase,
|
||||
float advanceScale,
|
||||
float kerningScale,
|
||||
@GLenum int transformType,
|
||||
@Check("numPaths - 1") @OutParameter FloatBuffer returnedSpacing);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glGetPathColorGenivNV(@GLenum int color, @GLenum int pname, @Check("16") @OutParameter IntBuffer value);
|
||||
|
||||
@Alternate("glGetPathColorGenivNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathColorGenivNV2(@GLenum int color, @GLenum int pname, @OutParameter IntBuffer value);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glGetPathColorGenfvNV(@GLenum int color, @GLenum int pname, @Check("16") @OutParameter FloatBuffer value);
|
||||
|
||||
@Alternate("glGetPathColorGenfvNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathColorGenfvNV2(@GLenum int color, @GLenum int pname, @OutParameter FloatBuffer value);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glGetPathTexGenivNV(@GLenum int texCoordSet, @GLenum int pname, @Check("16") @OutParameter IntBuffer value);
|
||||
|
||||
@Alternate("glGetPathTexGenivNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathTexGenivNV2(@GLenum int texCoordSet, @GLenum int pname, @OutParameter IntBuffer value);
|
||||
|
||||
@StripPostfix("value")
|
||||
void glGetPathTexGenfvNV(@GLenum int texCoordSet, @GLenum int pname, @Check("16") @OutParameter FloatBuffer value);
|
||||
|
||||
@Alternate("glGetPathTexGenfvNV")
|
||||
@GLreturn("value")
|
||||
@StripPostfix(value = "value", postfix = "v")
|
||||
void glGetPathTexGenfvNV2(@GLenum int texCoordSet, @GLenum int pname, @OutParameter FloatBuffer value);
|
||||
|
||||
boolean glIsPointInFillPathNV(@GLuint int path,
|
||||
@GLuint int mask, float x, float y);
|
||||
|
||||
boolean glIsPointInStrokePathNV(@GLuint int path,
|
||||
float x, float y);
|
||||
|
||||
float glGetPathLengthNV(@GLuint int path,
|
||||
@GLsizei int startSegment, @GLsizei int numSegments);
|
||||
|
||||
boolean glPointAlongPathNV(@GLuint int path,
|
||||
@GLsizei int startSegment, @GLsizei int numSegments,
|
||||
float distance,
|
||||
@Check(value = "1", canBeNull = true) @OutParameter FloatBuffer x,
|
||||
@Check(value = "1", canBeNull = true) @OutParameter FloatBuffer y,
|
||||
@Check(value = "1", canBeNull = true) @OutParameter FloatBuffer tangentX,
|
||||
@Check(value = "1", canBeNull = true) @OutParameter FloatBuffer tangentY);
|
||||
|
||||
}
|
Loading…
Reference in New Issue