Make Pbuffers that share the display context be single-buffered (linux part)
This commit is contained in:
parent
1aee4598a9
commit
665f971aec
|
@ -93,50 +93,64 @@ public final class ARBBufferObject {
|
|||
if (VBOTracker.getVBOArrayStack().getState() == buffer_handle)
|
||||
VBOTracker.getVBOArrayStack().setState(0);
|
||||
}
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglDeleteBuffersARB(buffers.remaining(), buffers, buffers.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, ByteBuffer data, int usage) {
|
||||
nglBufferDataARB(target, size, data, data != null ? data.position() : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data != null ? data.remaining() : size, data, data != null ? data.position() : 0, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, int size, ShortBuffer data, int usage) {
|
||||
nglBufferDataARB(target, size, data, data != null ? data.position()<<1 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data != null ? data.remaining()<<1 : size, data, data != null ? data.position()<<1 : 0, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, int size, FloatBuffer data, int usage) {
|
||||
nglBufferDataARB(target, size, data, data != null ? data.position()<<2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data != null ? data.remaining()<<2 : size, data, data != null ? data.position()<<2 : 0, usage);
|
||||
}
|
||||
public static void glBufferDataARB(int target, int size, IntBuffer data, int usage) {
|
||||
nglBufferDataARB(target, size, data, data != null ? data.position()<<2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferDataARB(target, data != null ? data.remaining()<<2 : size, data, data != null ? data.position()<<2 : 0, 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);
|
||||
|
|
|
@ -239,46 +239,32 @@ public final class ARBImaging {
|
|||
}
|
||||
private static native void nglGetMinmaxParameteriv(int target, int pname, IntBuffer params, int params_offset);
|
||||
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ByteBuffer image) {
|
||||
if (image.remaining() < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, 1, 1));
|
||||
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
|
||||
}
|
||||
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ShortBuffer image) {
|
||||
if (image.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>1);
|
||||
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
|
||||
}
|
||||
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, IntBuffer image) {
|
||||
if (image.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2);
|
||||
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
|
||||
}
|
||||
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, FloatBuffer image) {
|
||||
if (image.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2);
|
||||
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
|
||||
}
|
||||
private static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, Buffer image, int image_offset);
|
||||
public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, ByteBuffer image) {
|
||||
if (image.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, height, 1));
|
||||
nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position());
|
||||
}
|
||||
public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, ShortBuffer image) {
|
||||
if (image.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>1);
|
||||
nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position() <<1);
|
||||
}
|
||||
public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, IntBuffer image) {
|
||||
if (image.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(image, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglConvolutionFilter2D(target, internalformat, width, height, format, type, image, image.position() << 2);
|
||||
}
|
||||
private static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image, int image_offset);
|
||||
|
@ -297,18 +283,22 @@ public final class ARBImaging {
|
|||
public static native void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width);
|
||||
public static native void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height);
|
||||
public static void glGetConvolutionFilter(int target, int format, int type, ByteBuffer image) {
|
||||
BufferChecks.checkDirect(image);
|
||||
// TODO: check buffer size valid
|
||||
nglGetConvolutionFilter(target, format, type, image, image.position());
|
||||
}
|
||||
public static void glGetConvolutionFilter(int target, int format, int type, ShortBuffer image) {
|
||||
BufferChecks.checkDirect(image);
|
||||
// TODO: check buffer size valid
|
||||
nglGetConvolutionFilter(target, format, type, image, image.position() << 1);
|
||||
}
|
||||
public static void glGetConvolutionFilter(int target, int format, int type, IntBuffer image) {
|
||||
BufferChecks.checkDirect(image);
|
||||
// TODO: check buffer size valid
|
||||
nglGetConvolutionFilter(target, format, type, image, image.position() << 2);
|
||||
}
|
||||
public static void glGetConvolutionFilter(int target, int format, int type, FloatBuffer image) {
|
||||
BufferChecks.checkDirect(image);
|
||||
// TODO: check buffer size valid
|
||||
nglGetConvolutionFilter(target, format, type, image, image.position() << 2);
|
||||
}
|
||||
|
@ -324,11 +314,16 @@ public final class ARBImaging {
|
|||
}
|
||||
private static native void nglGetConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset);
|
||||
public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, Buffer column) {
|
||||
BufferChecks.checkDirectBuffer(row);
|
||||
BufferChecks.checkDirectBuffer(column);
|
||||
// TODO: check buffer size valid
|
||||
nglSeparableFilter2D(target, internalformat, width, height, format, type, row, BufferUtils.getOffset(row), column, BufferUtils.getOffset(column));
|
||||
}
|
||||
private static native void nglSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset);
|
||||
public static void glGetSeparableFilter(int target, int format, int type, Buffer row, Buffer column, Buffer span) {
|
||||
BufferChecks.checkDirectBuffer(row);
|
||||
BufferChecks.checkDirectBuffer(column);
|
||||
BufferChecks.checkDirectBuffer(span);
|
||||
// TODO: check buffer size valid
|
||||
nglGetSeparableFilter(target, format, type, row, BufferUtils.getOffset(row), column, BufferUtils.getOffset(column), span, BufferUtils.getOffset(span));
|
||||
}
|
||||
|
|
|
@ -54,14 +54,17 @@ public final class ARBMatrixPalette {
|
|||
|
||||
public static native void glCurrentPaletteMatrixARB(int index);
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position());
|
||||
}
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position()<<1);
|
||||
}
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
|
@ -73,16 +76,19 @@ public final class ARBMatrixPalette {
|
|||
private static native void nglMatrixIndexPointerARBVBO(int size, int type, int stride, int buffer_offset);
|
||||
|
||||
public static void glMatrixIndexuARB(ByteBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
nglMatrixIndexubvARB(pIndices.remaining(), pIndices, 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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
private static native void nglMatrixIndexusvARB(int size, ShortBuffer psIndices, int psIndices_offset);
|
||||
|
|
|
@ -60,6 +60,7 @@ public final class ARBOcclusionQuery {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGenQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglGenQueriesARB(ids.remaining(), ids, ids.position());
|
||||
}
|
||||
|
||||
|
@ -68,6 +69,7 @@ public final class ARBOcclusionQuery {
|
|||
|
||||
// ---------------------------
|
||||
public static void glDeleteQueriesARB(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglDeleteQueriesARB(ids.remaining(), ids, ids.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glProgramStringARB(int target, int format, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
nglProgramStringARB(target, format, string.remaining(), string, string.position());
|
||||
}
|
||||
|
||||
|
@ -145,6 +146,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glDeleteProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglDeleteProgramsARB(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
|
@ -153,6 +155,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGenProgramsARB(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglGenProgramsARB(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
|
@ -178,6 +181,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glProgramEnvParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglProgramEnvParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
|
@ -195,6 +199,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glProgramLocalParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglProgramLocalParameter4fvARB(target, index, params, params.position());
|
||||
}
|
||||
|
@ -204,6 +209,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglGetProgramEnvParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
|
@ -213,6 +219,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
checkProgramEnv(index, params);
|
||||
nglGetProgramLocalParameterfvARB(target, index, params, params.position());
|
||||
}
|
||||
|
@ -231,11 +238,7 @@ public class ARBProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetProgramStringARB(int target, int parameterName, ByteBuffer paramString) {
|
||||
// TODO: We have no idea just how big programs can be really so let's guess at 16kb and hope that's
|
||||
// good enough. So we ought to find out how big a program can be.
|
||||
if (paramString.remaining() < 16384) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkDirect(paramString);
|
||||
nglGetProgramStringARB(target, parameterName, paramString, paramString.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ public final class ARBShaderObjects {
|
|||
* @param string
|
||||
*/
|
||||
public static void glShaderSourceARB(int shaderObj, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
initShaderSource(1);
|
||||
setShaderString(0, string, string.position(), string.remaining());
|
||||
|
||||
|
@ -128,8 +129,10 @@ public final class ARBShaderObjects {
|
|||
*/
|
||||
public static void glShaderSourceARB(int shaderObj, ByteBuffer[] strings) {
|
||||
initShaderSource(strings.length);
|
||||
for ( int i = 0; i < strings.length; i++ )
|
||||
for ( int i = 0; i < strings.length; i++ ) {
|
||||
BufferChecks.checkDirect(strings[i]);
|
||||
setShaderString(i, strings[i], strings[i].position(), strings[i].remaining());
|
||||
}
|
||||
|
||||
nglShaderSourceARB(shaderObj);
|
||||
}
|
||||
|
@ -171,6 +174,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform1ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1fvARB(location, values.remaining(), values, values.position());
|
||||
}
|
||||
|
||||
|
@ -179,6 +183,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform2ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2fvARB(location, values.remaining() >> 1, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -187,6 +192,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform3ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3fvARB(location, values.remaining() / 3, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -195,6 +201,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform4ARB(int location, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4fvARB(location, values.remaining() >> 2, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -203,6 +210,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform1ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform1ivARB(location, values.remaining(), values, values.position());
|
||||
}
|
||||
|
||||
|
@ -211,6 +219,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform2ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform2ivARB(location, values.remaining() >> 1, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -219,6 +228,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform3ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform3ivARB(location, values.remaining() / 3, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -227,6 +237,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniform4ARB(int location, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglUniform4ivARB(location, values.remaining() >> 2, values, values.position());
|
||||
}
|
||||
|
||||
|
@ -235,6 +246,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix2ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix2fvARB(location, matrices.remaining() >> 2, transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
|
@ -244,6 +256,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix3ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix3fvARB(location, matrices.remaining() / (3 * 3), transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
|
@ -253,6 +266,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glUniformMatrix4ARB(int location, boolean transpose, FloatBuffer matrices) {
|
||||
BufferChecks.checkDirect(matrices);
|
||||
nglUniformMatrix4fvARB(location, matrices.remaining() >> 4, transpose, matrices, matrices.position());
|
||||
}
|
||||
|
||||
|
@ -262,6 +276,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetObjectParameterARB(int obj, int pname, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetObjectParameterfvARB(obj, pname, params, params.position());
|
||||
}
|
||||
|
||||
|
@ -270,6 +285,7 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetObjectParameterARB(int obj, int pname, IntBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetObjectParameterivARB(obj, pname, params, params.position());
|
||||
}
|
||||
|
||||
|
@ -278,12 +294,11 @@ public final class ARBShaderObjects {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetInfoLogARB(int obj, IntBuffer length, ByteBuffer infoLog) {
|
||||
if ( length == null )
|
||||
BufferChecks.checkDirect(infoLog);
|
||||
if ( length == null ) {
|
||||
nglGetInfoLogARB(obj, infoLog.remaining(), null, -1, infoLog, infoLog.position());
|
||||
else {
|
||||
if ( length.remaining() == 0 )
|
||||
throw new BufferOverflowException();
|
||||
|
||||
} else {
|
||||
BufferChecks.checkBuffer(length, 1);
|
||||
nglGetInfoLogARB(obj, infoLog.remaining(), length, length.position(), infoLog, infoLog.position());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,95 +56,122 @@ public final class 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) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<1);
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, 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, ByteBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<1);
|
||||
}
|
||||
public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, 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) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
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 glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<1);
|
||||
}
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) {
|
||||
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 glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ByteBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ShortBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<1);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, IntBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, FloatBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
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 glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ByteBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ShortBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, 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, IntBuffer pData) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, 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) {
|
||||
BufferChecks.checkDirect(pData);
|
||||
nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()<<2);
|
||||
}
|
||||
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 glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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 glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) {
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position());
|
||||
}
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) {
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<1);
|
||||
}
|
||||
public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) {
|
||||
BufferChecks.checkDirect(pImg);
|
||||
nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()<<2);
|
||||
}
|
||||
private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_offset);
|
||||
|
|
|
@ -86,53 +86,64 @@ public final class ARBVertexBlend {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glWeightARB(ByteBuffer pWeights) {
|
||||
BufferChecks.checkDirect(pWeights);
|
||||
nglWeightbvARB(pWeights.remaining(), pWeights, pWeights.position());
|
||||
}
|
||||
private static native void nglWeightbvARB(int size, ByteBuffer pWeights, int pWeights_offset);
|
||||
|
||||
public static void glWeightARB(FloatBuffer pfWeights) {
|
||||
BufferChecks.checkDirect(pfWeights);
|
||||
nglWeightfvARB(pfWeights.remaining(), pfWeights, pfWeights.position());
|
||||
}
|
||||
private static native void nglWeightfvARB(int size, FloatBuffer pfWeights, int pfWeights_offset);
|
||||
|
||||
public static void glWeightARB(IntBuffer piWeights) {
|
||||
BufferChecks.checkDirect(piWeights);
|
||||
nglWeightivARB(piWeights.remaining(), piWeights, piWeights.position());
|
||||
}
|
||||
private static native void nglWeightivARB(int size, IntBuffer piWeights, int piWeights_offset);
|
||||
|
||||
public static void glWeightARB(ShortBuffer psWeights) {
|
||||
BufferChecks.checkDirect(psWeights);
|
||||
nglWeightsvARB(psWeights.remaining(), psWeights, psWeights.position());
|
||||
}
|
||||
private static native void nglWeightsvARB(int size, ShortBuffer psWeights, int psWeights_offset);
|
||||
|
||||
public static void glWeightuARB(ByteBuffer pWeights) {
|
||||
BufferChecks.checkDirect(pWeights);
|
||||
nglWeightubvARB(pWeights.remaining(), pWeights, pWeights.position());
|
||||
}
|
||||
private static native void nglWeightubvARB(int size, ByteBuffer pWeights, int pWeights_offset);
|
||||
|
||||
public static void glWeightuARB(IntBuffer piWeights) {
|
||||
BufferChecks.checkDirect(piWeights);
|
||||
nglWeightuivARB(piWeights.remaining(), piWeights, piWeights.position());
|
||||
}
|
||||
private static native void nglWeightuivARB(int size, IntBuffer piWeights, int piWeights_offset);
|
||||
|
||||
public static void glWeightuARB(ShortBuffer psWeights) {
|
||||
BufferChecks.checkDirect(psWeights);
|
||||
nglWeightusvARB(psWeights.remaining(), psWeights, psWeights.position());
|
||||
}
|
||||
private static native void nglWeightusvARB(int size, ShortBuffer psWeights, int psWeights_offset);
|
||||
|
||||
public static void glWeightPointerARB(int size, boolean unsigned, int stride, ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, pPointer, pPointer.position());
|
||||
}
|
||||
public static void glWeightPointerARB(int size, boolean unsigned, int stride, ShortBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, pPointer, pPointer.position()<<1);
|
||||
}
|
||||
public static void glWeightPointerARB(int size, int stride, FloatBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglWeightPointerARB(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
public static void glWeightPointerARB(int size, boolean unsigned, int stride, IntBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ public final class ARBVertexShader {
|
|||
|
||||
// ---------------------------
|
||||
public static void glBindAttribLocationARB(int programObj, int index, ByteBuffer name) {
|
||||
BufferChecks.checkDirect(name);
|
||||
if ( name.get(name.limit() - 1) != 0 ) {
|
||||
throw new IllegalArgumentException("<name> must be a null-terminated string.");
|
||||
}
|
||||
|
@ -112,12 +113,15 @@ public final class ARBVertexShader {
|
|||
// ---------------------------
|
||||
public static void glGetActiveAttribARB(int programObj, int index,
|
||||
IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) {
|
||||
BufferChecks.checkBuffer(name);
|
||||
BufferChecks.checkDirect(name);
|
||||
BufferChecks.checkDirect(size);
|
||||
BufferChecks.checkDirect(type);
|
||||
|
||||
if ( length == null )
|
||||
if ( length == null ) {
|
||||
nglGetActiveAttribARB(programObj, index, name.remaining(), null, -1,
|
||||
size, size.position(), type, type.position(), name, name.position());
|
||||
else {
|
||||
} else {
|
||||
BufferChecks.checkDirect(length);
|
||||
nglGetActiveAttribARB(programObj, index, name.remaining(), length, length.position(),
|
||||
size, size.position(), type, type.position(), name, name.position());
|
||||
}
|
||||
|
@ -132,6 +136,7 @@ public final class ARBVertexShader {
|
|||
|
||||
// ---------------------------
|
||||
public static int glGetAttribLocationARB(int programObj, ByteBuffer name) {
|
||||
BufferChecks.checkDirect(name);
|
||||
if ( name.get(name.limit() - 1) != 0 ) {
|
||||
throw new IllegalArgumentException("<name> must be a null-terminated string.");
|
||||
}
|
||||
|
|
|
@ -36,15 +36,15 @@ import org.lwjgl.LWJGLException;
|
|||
public final class ARBWindowPos {
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glWindowPos2fARB(float x, float y);
|
||||
public static native void glWindowPos2fARB(float x, float y);
|
||||
|
||||
public static native void glWindowPos2iARB(int x, int y);
|
||||
public static native void glWindowPos2iARB(int x, int y);
|
||||
|
||||
public static native void glWindowPos2sARB(short x, short y);
|
||||
public static native void glWindowPos2sARB(short x, short y);
|
||||
|
||||
public static native void glWindowPos3fARB(float x, float y, float z);
|
||||
public static native void glWindowPos3fARB(float x, float y, float z);
|
||||
|
||||
public static native void glWindowPos3iARB(int x, int y, int z);
|
||||
public static native void glWindowPos3iARB(int x, int y, int z);
|
||||
|
||||
public static native void glWindowPos3sARB(short x, short y, short z);
|
||||
public static native void glWindowPos3sARB(short x, short y, short z);
|
||||
}
|
||||
|
|
|
@ -64,9 +64,7 @@ public final class ATIDrawBuffers {
|
|||
|
||||
// ---------------------------
|
||||
public static void glDrawBuffersATI(IntBuffer buffers) {
|
||||
if (buffers.remaining() == 0) {
|
||||
throw new IllegalArgumentException("<buffers> must have at least 1 integer available.");
|
||||
}
|
||||
BufferChecks.checkBuffer(buffers, 1);
|
||||
nglDrawBuffersATI(buffers.remaining(), buffers, buffers.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -46,14 +46,17 @@ public final class ATIElementArray {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glElementPointerATI(ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglElementPointerATI(GL11.GL_UNSIGNED_BYTE, pPointer, pPointer.position());
|
||||
}
|
||||
public static void glElementPointerATI(ShortBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglElementPointerATI(GL11.GL_UNSIGNED_SHORT, pPointer, pPointer.position()<<1);
|
||||
}
|
||||
public static void glElementPointerATI(IntBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglElementPointerATI(GL11.GL_UNSIGNED_INT, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
|
|
|
@ -52,40 +52,50 @@ public final class ATIVertexArrayObject {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static int glNewObjectBufferATI(int size, ByteBuffer pPointer, int usage) {
|
||||
return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position() : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(pPointer);
|
||||
return nglNewObjectBufferATI(pPointer != null ? pPointer.remaining() : size, pPointer, pPointer != null ? pPointer.position() : 0, usage);
|
||||
}
|
||||
public static int glNewObjectBufferATI(int size, ShortBuffer pPointer, int usage) {
|
||||
return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<1 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(pPointer);
|
||||
return nglNewObjectBufferATI(pPointer != null ? pPointer.remaining()<<1 : size, pPointer, pPointer != null ? pPointer.position()<<1 : 0, usage);
|
||||
}
|
||||
public static int glNewObjectBufferATI(int size, FloatBuffer pPointer, int usage) {
|
||||
return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(pPointer);
|
||||
return nglNewObjectBufferATI(pPointer != null ? pPointer.remaining()<<2 : size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage);
|
||||
}
|
||||
public static int glNewObjectBufferATI(int size, IntBuffer pPointer, int usage) {
|
||||
return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(pPointer);
|
||||
return nglNewObjectBufferATI(pPointer != null ? pPointer.remaining()<<2 : size, pPointer, pPointer != null ? pPointer.position()<<2 : 0, usage);
|
||||
}
|
||||
private static native int nglNewObjectBufferATI(int size, Buffer pPointer, int pPointer_offset, int usage);
|
||||
public static native boolean glIsObjectBufferATI(int buffer);
|
||||
|
||||
public static void glUpdateObjectBufferATI(int buffer, int offset, ByteBuffer pPointer, int preserve) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining(), pPointer, pPointer.position(), preserve);
|
||||
}
|
||||
public static void glUpdateObjectBufferATI(int buffer, int offset, ShortBuffer pPointer, int preserve) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<1, pPointer, pPointer.position()<<1, preserve);
|
||||
}
|
||||
public static void glUpdateObjectBufferATI(int buffer, int offset, FloatBuffer pPointer, int preserve) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<2, pPointer, pPointer.position()<<2, preserve);
|
||||
}
|
||||
public static void glUpdateObjectBufferATI(int buffer, int offset, IntBuffer pPointer, int preserve) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglUpdateObjectBufferATI(buffer, offset, pPointer.remaining()<<2, pPointer, pPointer.position()<<2, preserve);
|
||||
}
|
||||
private static native void nglUpdateObjectBufferATI(int buffer, int offset, int size, Buffer pPointer, int pPointer_offset, int preserve);
|
||||
|
||||
public static void glGetObjectBufferATI(int buffer, int pname, FloatBuffer pfParams) {
|
||||
BufferChecks.checkDirect(pfParams);
|
||||
nglGetObjectBufferfvATI(buffer, pname, pfParams, pfParams.position());
|
||||
}
|
||||
private static native void nglGetObjectBufferfvATI(int buffer, int pname, FloatBuffer pfParams, int pfParams_offset);
|
||||
|
||||
public static void glGetObjectBufferATI(int buffer, int pname, IntBuffer piParams) {
|
||||
BufferChecks.checkDirect(piParams);
|
||||
nglGetObjectBufferivATI(buffer, pname, piParams, piParams.position());
|
||||
}
|
||||
private static native void nglGetObjectBufferivATI(int buffer, int pname, IntBuffer piParams, int piParams_offset);
|
||||
|
|
|
@ -30,7 +30,13 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.opengl;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.DoubleBuffer;
|
||||
|
||||
/**
|
||||
* $Id$ A class to
|
||||
|
@ -58,6 +64,87 @@ class BufferChecks {
|
|||
*/
|
||||
private static final int DEFAULT_BUFFER_SIZE = 4;
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a buffer is direct or null.
|
||||
*/
|
||||
static void checkDirectOrNull(ByteBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirectOrNull(FloatBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirectOrNull(ShortBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirectOrNull(IntBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirectOrNull(DoubleBuffer buf) {
|
||||
if (buf != null) {
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a buffer is direct (and, implicitly, non-null).
|
||||
*/
|
||||
static void checkDirectBuffer(Buffer buf) {
|
||||
if (buf instanceof ByteBuffer)
|
||||
checkDirect((ByteBuffer)buf);
|
||||
else if (buf instanceof ShortBuffer)
|
||||
checkDirect((ShortBuffer)buf);
|
||||
else if (buf instanceof IntBuffer)
|
||||
checkDirect((IntBuffer)buf);
|
||||
else if (buf instanceof FloatBuffer)
|
||||
checkDirect((FloatBuffer)buf);
|
||||
else if (buf instanceof DoubleBuffer)
|
||||
checkDirect((DoubleBuffer)buf);
|
||||
else
|
||||
throw new IllegalStateException("Unsupported buffer type");
|
||||
}
|
||||
|
||||
static void checkDirect(ByteBuffer buf) {
|
||||
if (!buf.isDirect()) {
|
||||
throw new IllegalArgumentException("ByteBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirect(FloatBuffer buf) {
|
||||
if (!buf.isDirect()) {
|
||||
throw new IllegalArgumentException("FloatBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirect(ShortBuffer buf) {
|
||||
if (!buf.isDirect()) {
|
||||
throw new IllegalArgumentException("ShortBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirect(IntBuffer buf) {
|
||||
if (!buf.isDirect()) {
|
||||
throw new IllegalArgumentException("IntBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
static void checkDirect(DoubleBuffer buf) {
|
||||
if (!buf.isDirect()) {
|
||||
throw new IllegalArgumentException("IntBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to ensure a buffer is big enough to receive data from a
|
||||
* glGet* operation.
|
||||
|
@ -68,13 +155,39 @@ class BufferChecks {
|
|||
* The minimum buffer size
|
||||
* @throws BufferOverflowException
|
||||
*/
|
||||
static void checkBuffer(Buffer buf, int size) {
|
||||
private static void checkBufferSize(Buffer buf, int size) {
|
||||
if (buf.remaining() < size) {
|
||||
throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size);
|
||||
}
|
||||
}
|
||||
|
||||
static void checkBuffer(ByteBuffer buf, int size) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
|
||||
static void checkBuffer(IntBuffer buf, int size) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
|
||||
static void checkBuffer(ShortBuffer buf, int size) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
|
||||
static void checkBuffer(FloatBuffer buf, int size) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
|
||||
static void checkBuffer(DoubleBuffer buf, int size) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to ensure a buffer is big enough to receive data from a
|
||||
* Helper methods to ensure a buffer is big enough to receive data from a
|
||||
* glGet* operation. To avoid unnecessarily complex buffer size checking
|
||||
* we've just set the bar artificially high and insist that any receiving
|
||||
* buffer has at least 4 remaining().
|
||||
|
@ -83,7 +196,23 @@ class BufferChecks {
|
|||
* The buffer to check
|
||||
* @throws BufferOverflowException
|
||||
*/
|
||||
static void checkBuffer(Buffer buf) {
|
||||
static void checkBuffer(ByteBuffer buf) {
|
||||
checkBuffer(buf, DEFAULT_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void checkBuffer(ShortBuffer buf) {
|
||||
checkBuffer(buf, DEFAULT_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void checkBuffer(FloatBuffer buf) {
|
||||
checkBuffer(buf, DEFAULT_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void checkBuffer(IntBuffer buf) {
|
||||
checkBuffer(buf, DEFAULT_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void checkBuffer(DoubleBuffer buf) {
|
||||
checkBuffer(buf, DEFAULT_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,14 +45,17 @@ public final class EXTDrawRangeElements {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glDrawRangeElementsEXT(int mode, int start, int end, ByteBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL11.GL_UNSIGNED_BYTE, pIndices, pIndices.position());
|
||||
}
|
||||
public static void glDrawRangeElementsEXT(int mode, int start, int end, ShortBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL11.GL_UNSIGNED_SHORT, pIndices, pIndices.position()<<1);
|
||||
}
|
||||
public static void glDrawRangeElementsEXT(int mode, int start, int end, IntBuffer pIndices) {
|
||||
BufferChecks.checkDirect(pIndices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL11.GL_UNSIGNED_INT, pIndices, pIndices.position()<<2);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public final class EXTFogCoord {
|
|||
|
||||
public static native void glFogCoordfEXT(float coord);
|
||||
public static void glFogCoordPointerEXT(int stride, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglFogCoordPointerEXT(GL11.GL_FLOAT, stride, data, data.position() << 2);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ public final class EXTMultiDrawArrays {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glMultiDrawArraysEXT(int mode, IntBuffer piFirst, IntBuffer piCount) {
|
||||
BufferChecks.checkDirect(piFirst);
|
||||
BufferChecks.checkDirect(piCount);
|
||||
if (piFirst.remaining() != piCount.remaining()) {
|
||||
throw new IllegalArgumentException("piFirst.remaining() != piCount.remaining()");
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public final class EXTPointParameters {
|
|||
public static native void glPointParameterfEXT(int pname, float param);
|
||||
|
||||
public static void glPointParameterEXT(int pname, FloatBuffer pfParams) {
|
||||
BufferChecks.checkDirect(pfParams);
|
||||
BufferChecks.checkBuffer(pfParams);
|
||||
nglPointParameterfvEXT(pname, pfParams, pfParams.position());
|
||||
}
|
||||
|
|
|
@ -55,10 +55,12 @@ public final class EXTSecondaryColor {
|
|||
public static native void glSecondaryColor3ubEXT(byte red, byte green, byte blue);
|
||||
|
||||
public static void glSecondaryColorPointerEXT(int size, boolean unsigned, int stride, ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglSecondaryColorPointerEXT(size, unsigned ? GL11.GL_UNSIGNED_BYTE: GL11.GL_BYTE, stride, pPointer, pPointer.position());
|
||||
}
|
||||
public static void glSecondaryColorPointerEXT(int size, int stride, FloatBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglSecondaryColorPointerEXT(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
|
|
|
@ -210,6 +210,7 @@ public final class EXTVertexShader {
|
|||
nglSetInvariantEXT(id, GL11.GL_FLOAT, pAddr, pAddr.position()<<2);
|
||||
}
|
||||
public static void glSetInvariantEXT(int id, boolean unsigned, IntBuffer pAddr) {
|
||||
BufferChecks.checkBuffer(pAddr);
|
||||
nglSetInvariantEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, pAddr, pAddr.position()<<2);
|
||||
}
|
||||
private static native void nglSetInvariantEXT(int id, int type, Buffer pAddr, int pAddr_offset);
|
||||
|
@ -274,18 +275,22 @@ public final class EXTVertexShader {
|
|||
}
|
||||
private static native void nglVariantuivEXT(int id, IntBuffer piAddr, int piAddr_offset);
|
||||
public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ByteBuffer pAddr) {
|
||||
BufferChecks.checkDirect(pAddr);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, pAddr, pAddr.position());
|
||||
}
|
||||
public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ShortBuffer pAddr) {
|
||||
BufferChecks.checkDirect(pAddr);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, pAddr, pAddr.position()<<1);
|
||||
}
|
||||
public static void glVariantPointerEXT(int id, int stride, FloatBuffer pAddr) {
|
||||
BufferChecks.checkDirect(pAddr);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVariantPointerEXT(id, GL11.GL_FLOAT, stride, pAddr, pAddr.position()<<2);
|
||||
}
|
||||
public static void glVariantPointerEXT(int id, boolean unsigned, int stride, IntBuffer pAddr) {
|
||||
BufferChecks.checkDirect(pAddr);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pAddr, pAddr.position()<<2);
|
||||
}
|
||||
|
@ -311,46 +316,55 @@ public final class EXTVertexShader {
|
|||
public static native boolean glIsVariantEnabledEXT(int id, int cap);
|
||||
|
||||
public static void glGetVariantBooleanEXT(int id, int value, ByteBuffer pbData) {
|
||||
BufferChecks.checkDirect(pbData);
|
||||
nglGetVariantBooleanvEXT(id, value, pbData, pbData.position());
|
||||
}
|
||||
private static native void nglGetVariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset);
|
||||
public static void glGetVariantIntegerEXT(int id, int value, IntBuffer piData) {
|
||||
BufferChecks.checkDirect(piData);
|
||||
nglGetVariantIntegervEXT(id, value, piData, piData.position());
|
||||
}
|
||||
private static native void nglGetVariantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset);
|
||||
|
||||
public static void glGetVariantFloatEXT(int id, int value, FloatBuffer pfData) {
|
||||
BufferChecks.checkDirect(pfData);
|
||||
nglGetVariantFloatvEXT(id, value, pfData, pfData.position());
|
||||
}
|
||||
private static native void nglGetVariantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset);
|
||||
|
||||
public static native ByteBuffer glGetVariantPointerEXT(int id, int value, int size);
|
||||
public static void glGetInvariantBooleanEXT(int id, int value, ByteBuffer pbData) {
|
||||
BufferChecks.checkDirect(pbData);
|
||||
nglGetInvariantBooleanvEXT(id, value, pbData, pbData.position());
|
||||
}
|
||||
private static native void nglGetInvariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset);
|
||||
|
||||
public static void glGetInvariantIntegerEXT(int id, int value, IntBuffer piData) {
|
||||
BufferChecks.checkDirect(piData);
|
||||
nglGetInvariantIntegervEXT(id, value, piData, piData.position());
|
||||
}
|
||||
private static native void nglGetInvariantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset);
|
||||
|
||||
public static void glGetInvariantFloatEXT(int id, int value, FloatBuffer pfData) {
|
||||
BufferChecks.checkDirect(pfData);
|
||||
nglGetInvariantFloatvEXT(id, value, pfData, pfData.position());
|
||||
}
|
||||
private static native void nglGetInvariantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset);
|
||||
|
||||
public static void glGetLocalConstantBooleanEXT(int id, int value, ByteBuffer pbData) {
|
||||
BufferChecks.checkDirect(pbData);
|
||||
nglGetLocalConstantBooleanvEXT(id, value, pbData, pbData.position());
|
||||
}
|
||||
private static native void nglGetLocalConstantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_offset);
|
||||
|
||||
public static void glGetLocalConstantIntegerEXT(int id, int value, IntBuffer piData) {
|
||||
BufferChecks.checkDirect(piData);
|
||||
nglGetLocalConstantIntegervEXT(id, value, piData, piData.position());
|
||||
}
|
||||
private static native void nglGetLocalConstantIntegervEXT(int id, int value, IntBuffer piData, int piData_offset);
|
||||
|
||||
public static void glGetLocalConstantFloatEXT(int id, int value, FloatBuffer pfData) {
|
||||
BufferChecks.checkDirect(pfData);
|
||||
nglGetLocalConstantFloatvEXT(id, value, pfData, pfData.position());
|
||||
}
|
||||
private static native void nglGetLocalConstantFloatvEXT(int id, int value, FloatBuffer pfData, int pfData_offset);
|
||||
|
|
|
@ -56,6 +56,7 @@ public final class EXTVertexWeighting {
|
|||
public static native void glVertexWeightfEXT(float weight);
|
||||
|
||||
public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVertexWeightPointerEXT(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2);
|
||||
}
|
||||
|
|
|
@ -730,21 +730,22 @@ public final class GL11 {
|
|||
public static native void glClearAccum(float red, float green, float blue, float alpha);
|
||||
public static native void glClear(int mask);
|
||||
public static void glCallLists(ByteBuffer lists) {
|
||||
BufferChecks.checkDirect(lists);
|
||||
nglCallLists(lists.remaining(), GL_UNSIGNED_BYTE, lists, lists.position());
|
||||
}
|
||||
public static void glCallLists(ShortBuffer lists) {
|
||||
BufferChecks.checkDirect(lists);
|
||||
nglCallLists(lists.remaining(), GL_UNSIGNED_SHORT, lists, lists.position() << 1);
|
||||
}
|
||||
public static void glCallLists(int n, IntBuffer lists) {
|
||||
BufferChecks.checkDirect(lists);
|
||||
nglCallLists(lists.remaining(), GL_UNSIGNED_INT, lists, lists.position() << 2);
|
||||
}
|
||||
private static native void nglCallLists(int n, int type, Buffer lists, int lists_offset);
|
||||
public static native void glCallList(int list);
|
||||
public static native void glBlendFunc(int sfactor, int dfactor);
|
||||
public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) {
|
||||
if (bitmap.remaining() < ((width+7)/8) * height) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(bitmap, ((width+7)/8) * height);
|
||||
nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position());
|
||||
}
|
||||
private static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset);
|
||||
|
@ -755,6 +756,7 @@ public final class GL11 {
|
|||
public static native void glClearDepth(double depth);
|
||||
public static native void glDeleteLists(int list, int range);
|
||||
public static void glDeleteTextures(IntBuffer textures) {
|
||||
BufferChecks.checkDirect(textures);
|
||||
nglDeleteTextures(textures.remaining(), textures, textures.position());
|
||||
}
|
||||
private static native void nglDeleteTextures(int n, IntBuffer textures, int textures_offset);
|
||||
|
@ -766,10 +768,12 @@ public final class GL11 {
|
|||
public static native void glCopyPixels(int x, int y, int width, int height, int type);
|
||||
|
||||
public static void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pointer, pointer.position());
|
||||
}
|
||||
public static void glColorPointer(int size, int stride, FloatBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
|
@ -788,9 +792,7 @@ public final class GL11 {
|
|||
public static native void glColor4f(float red, float green, float blue, float alpha);
|
||||
public static native void glColor4ub(byte red, byte green, byte blue, byte alpha);
|
||||
public static void glClipPlane(int plane, DoubleBuffer equation) {
|
||||
if (equation.remaining() < 4) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(equation, 4);
|
||||
nglClipPlane(plane, equation, equation.position() << 3);
|
||||
}
|
||||
private static native void nglClipPlane(int plane, DoubleBuffer equation, int equation_offset);
|
||||
|
@ -807,6 +809,7 @@ public final class GL11 {
|
|||
public static native void glEnable(int cap);
|
||||
public static native void glDisable(int cap);
|
||||
public static void glEdgeFlagPointer(int stride, ByteBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglEdgeFlagPointer(stride, pointer, pointer.position());
|
||||
}
|
||||
|
@ -818,33 +821,30 @@ public final class GL11 {
|
|||
private static native void nglEdgeFlagPointerVBO(int stride, int buffer_offset);
|
||||
public static native void glEdgeFlag(boolean flag);
|
||||
public static void glDrawPixels(int width, int height, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1));
|
||||
nglDrawPixels(width, height, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glDrawPixels(int width, int height, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>1);
|
||||
nglDrawPixels(width, height, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glDrawPixels(int width, int height, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglDrawPixels(width, height, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglDrawPixels(int width, int height, int format, int type, Buffer pixels, int pixels_offset);
|
||||
public static void glDrawElements(int mode, ByteBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position());
|
||||
}
|
||||
public static void glDrawElements(int mode, ShortBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1);
|
||||
}
|
||||
public static void glDrawElements(int mode, IntBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2);
|
||||
}
|
||||
|
@ -860,6 +860,7 @@ public final class GL11 {
|
|||
public static native void glDepthMask(boolean flag);
|
||||
public static native void glDepthFunc(int func);
|
||||
public static void glFeedbackBuffer(int type, FloatBuffer buffer) {
|
||||
BufferChecks.checkDirect(buffer);
|
||||
nglFeedbackBuffer(buffer.remaining(), type, buffer, buffer.position());
|
||||
}
|
||||
private static native void nglFeedbackBuffer(int size, int type, FloatBuffer buffer, int buffer_offset);
|
||||
|
@ -936,6 +937,7 @@ public final class GL11 {
|
|||
}
|
||||
private static native void nglGetIntegerv(int pname, IntBuffer params, int params_offset);
|
||||
public static void glGenTextures(IntBuffer textures) {
|
||||
BufferChecks.checkDirect(textures);
|
||||
nglGenTextures(textures.remaining(), textures, textures.position());
|
||||
}
|
||||
private static native void nglGenTextures(int n, IntBuffer textures, int textures_offset);
|
||||
|
@ -966,18 +968,22 @@ public final class GL11 {
|
|||
public static native ByteBuffer glGetPointerv(int pname, int size);
|
||||
public static native boolean glIsEnabled(int cap);
|
||||
public static void glInterleavedArrays(int format, int stride, ByteBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglInterleavedArrays(format, stride, pointer, pointer.position());
|
||||
}
|
||||
public static void glInterleavedArrays(int format, int stride, ShortBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglInterleavedArrays(format, stride, pointer, pointer.position() << 1);
|
||||
}
|
||||
public static void glInterleavedArrays(int format, int stride, IntBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
public static void glInterleavedArrays(int format, int stride, FloatBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
|
@ -1013,27 +1019,21 @@ public final class GL11 {
|
|||
int width = 1;
|
||||
int height = 1;
|
||||
int depth = 1;
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth));
|
||||
nglGetTexImage(target, level, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glGetTexImage(int target, int level, int format, int type, ShortBuffer pixels) {
|
||||
int width = 1;
|
||||
int height = 1;
|
||||
int depth = 1;
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>1);
|
||||
nglGetTexImage(target, level, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels) {
|
||||
int width = 1;
|
||||
int height = 1;
|
||||
int depth = 1;
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>2);
|
||||
nglGetTexImage(target, level, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglGetTexImage(int target, int level, int format, int type, Buffer pixels, int pixels_offset);
|
||||
|
@ -1083,11 +1083,13 @@ public final class GL11 {
|
|||
public static native void glMapGrid1f(int un, float u1, float u2);
|
||||
public static native void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2);
|
||||
public static void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points) {
|
||||
BufferChecks.checkDirect(points);
|
||||
// TODO: check buffer size valid
|
||||
nglMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points, points.position());
|
||||
}
|
||||
private static native void nglMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points, int points_offset);
|
||||
public static void glMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points) {
|
||||
BufferChecks.checkDirect(points);
|
||||
// TODO: check buffer size valid
|
||||
nglMap1f(target, u1, u2, stride, order, points, points.position());
|
||||
}
|
||||
|
@ -1143,28 +1145,34 @@ public final class GL11 {
|
|||
public static native void glPixelStoref(int pname, float param);
|
||||
public static native void glPixelStorei(int pname, int param);
|
||||
public static void glPixelMap(int map, FloatBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglPixelMapfv(map, values.remaining(), values, values.position());
|
||||
}
|
||||
private static native void nglPixelMapfv(int map, int mapsize, FloatBuffer values, int values_offset);
|
||||
public static void glPixelMap(int map, IntBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglPixelMapuiv(map, values.remaining(), values, values.position());
|
||||
}
|
||||
private static native void nglPixelMapuiv(int map, int mapsize, IntBuffer values, int values_offset);
|
||||
public static void glPixelMap(int map, ShortBuffer values) {
|
||||
BufferChecks.checkDirect(values);
|
||||
nglPixelMapusv(map, values.remaining(), values, values.position());
|
||||
}
|
||||
private static native void nglPixelMapusv(int map, int mapsize, ShortBuffer values, int values_offset);
|
||||
public static native void glPassThrough(float token);
|
||||
public static native void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar);
|
||||
public static void glNormalPointer(int stride, ByteBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglNormalPointer(GL_BYTE, stride, pointer, pointer.position());
|
||||
}
|
||||
public static void glNormalPointer(int stride, IntBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglNormalPointer(GL_INT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
public static void glNormalPointer(int stride, FloatBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglNormalPointer(GL_FLOAT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
|
@ -1186,6 +1194,7 @@ public final class GL11 {
|
|||
private static native void nglMultMatrixf(FloatBuffer m, int m_offset);
|
||||
public static native void glShadeModel(int mode);
|
||||
public static void glSelectBuffer(IntBuffer buffer) {
|
||||
BufferChecks.checkDirect(buffer);
|
||||
nglSelectBuffer(buffer.remaining(), buffer, buffer.position());
|
||||
}
|
||||
private static native void nglSelectBuffer(int size, IntBuffer buffer, int buffer_offset);
|
||||
|
@ -1196,21 +1205,15 @@ public final class GL11 {
|
|||
public static native void glRectf(float x1, float y1, float x2, float y2);
|
||||
public static native void glRecti(int x1, int y1, int x2, int y2);
|
||||
public static void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1));
|
||||
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glReadPixels(int x, int y, int width, int height, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>1);
|
||||
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels, int pixels_offset);
|
||||
|
@ -1247,10 +1250,12 @@ public final class GL11 {
|
|||
public static native void glPopAttrib();
|
||||
public static native void glStencilFunc(int func, int ref, int mask);
|
||||
public static void glVertexPointer(int size, int stride, FloatBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVertexPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
public static void glVertexPointer(int size, int stride, IntBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglVertexPointer(size, GL_INT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
|
@ -1268,40 +1273,28 @@ public final class GL11 {
|
|||
public static native void glVertex4i(int x, int y, int z, int w);
|
||||
public static native void glTranslatef(float x, float y, float z);
|
||||
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1));
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>1);
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels, int pixels_offset);
|
||||
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1));
|
||||
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>1);
|
||||
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2);
|
||||
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, Buffer pixels, int pixels_offset);
|
||||
|
@ -1318,52 +1311,36 @@ public final class GL11 {
|
|||
}
|
||||
private static native void nglTexParameteriv(int target, int pname, IntBuffer param, int param_position);
|
||||
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1));
|
||||
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>1);
|
||||
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, FloatBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, 1)>>2);
|
||||
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels, int pixels_offset);
|
||||
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1));
|
||||
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>1);
|
||||
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2);
|
||||
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, FloatBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, 1, 1)) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, 1, 1)>>2);
|
||||
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, Buffer pixels, int pixels_offset);
|
||||
|
@ -1392,6 +1369,7 @@ public final class GL11 {
|
|||
}
|
||||
private static native void nglTexEnviv(int target, int pname, IntBuffer params, int params_offset);
|
||||
public static void glTexCoordPointer(int size, int stride, FloatBuffer pointer) {
|
||||
BufferChecks.checkDirect(pointer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglTexCoordPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
|
||||
}
|
||||
|
|
|
@ -94,14 +94,17 @@ public final class GL12 {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_BYTE, indices, indices.position());
|
||||
}
|
||||
public static void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_SHORT, indices, indices.position() << 1);
|
||||
}
|
||||
public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) {
|
||||
BufferChecks.checkDirect(indices);
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_INT, indices, indices.position() << 2);
|
||||
}
|
||||
|
@ -112,52 +115,36 @@ public final class GL12 {
|
|||
}
|
||||
private static native void nglDrawRangeElementsVBO(int mode, int start, int end, int count, int type, int buffer_offset);
|
||||
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth));
|
||||
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>1);
|
||||
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>2);
|
||||
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, FloatBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>2);
|
||||
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels, int pixels_offset);
|
||||
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer pixels) {
|
||||
if (pixels.remaining() < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth));
|
||||
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position());
|
||||
}
|
||||
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ShortBuffer pixels) {
|
||||
if (pixels.remaining() * 2 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>1);
|
||||
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 1);
|
||||
}
|
||||
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, IntBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>2);
|
||||
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, FloatBuffer pixels) {
|
||||
if (pixels.remaining() * 4 < BufferChecks.calculateImageStorage(format, type, width, height, depth)) {
|
||||
throw new BufferUnderflowException();
|
||||
}
|
||||
BufferChecks.checkBuffer(pixels, BufferChecks.calculateImageStorage(format, type, width, height, depth)>>2);
|
||||
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2);
|
||||
}
|
||||
private static native void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels, int pixels_offset);
|
||||
|
|
|
@ -155,92 +155,119 @@ public final class GL13 {
|
|||
public static native void glActiveTexture(int texture);
|
||||
public static native void glClientActiveTexture(int texture);
|
||||
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, Buffer data, int data_offset);
|
||||
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data, int data_offset);
|
||||
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer data, int data_offset);
|
||||
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, Buffer data, int data_offset);
|
||||
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_offset);
|
||||
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position());
|
||||
}
|
||||
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1);
|
||||
}
|
||||
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2);
|
||||
}
|
||||
private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_offset);
|
||||
public static void glGetCompressedTexImage(int target, int lod, ByteBuffer img) {
|
||||
BufferChecks.checkDirect(img);
|
||||
// TODO: check buffer size valid
|
||||
nglGetCompressedTexImage(target, lod, img, img.position());
|
||||
}
|
||||
public static void glGetCompressedTexImage(int target, int lod, ShortBuffer img) {
|
||||
BufferChecks.checkDirect(img);
|
||||
// TODO: check buffer size valid
|
||||
nglGetCompressedTexImage(target, lod, img, img.position() << 1);
|
||||
}
|
||||
public static void glGetCompressedTexImage(int target, int lod, IntBuffer img) {
|
||||
BufferChecks.checkDirect(img);
|
||||
// TODO: check buffer size valid
|
||||
nglGetCompressedTexImage(target, lod, img, img.position() << 2);
|
||||
}
|
||||
|
@ -262,4 +289,3 @@ public final class GL13 {
|
|||
public static native void glSampleCoverage(float value, boolean invert);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -89,10 +89,11 @@ public final class GL14 {
|
|||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static native void glBlendEquation(int mode);
|
||||
public static native void glBlendColor(float red, float green, float blue, float alpha);
|
||||
public static native void glBlendEquation(int mode);
|
||||
public static native void glBlendColor(float red, float green, float blue, float alpha);
|
||||
public static native void glFogCoordf(float coord);
|
||||
public static void glFogCoordPointer(int stride, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglFogCoordPointer(GL11.GL_FLOAT, stride, data, data.position() << 2);
|
||||
}
|
||||
|
@ -103,6 +104,8 @@ public final class GL14 {
|
|||
}
|
||||
private static native void nglFogCoordPointerVBO(int type, int stride, int buffer_offset);
|
||||
public static void glMultiDrawArrays(int mode, IntBuffer piFirst, IntBuffer piCount) {
|
||||
BufferChecks.checkDirect(piFirst);
|
||||
BufferChecks.checkDirect(piCount);
|
||||
if (piFirst.remaining() != piCount.remaining()) {
|
||||
throw new IllegalArgumentException("piFirst.remaining() != piCount.remaining()");
|
||||
}
|
||||
|
@ -120,10 +123,12 @@ public final class GL14 {
|
|||
public static native void glSecondaryColor3f (float red, float green, float blue);
|
||||
public static native void glSecondaryColor3ub (byte red, byte green, byte blue);
|
||||
public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglSecondaryColorPointer(size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, data, data.position());
|
||||
}
|
||||
public static void glSecondaryColorPointer(int size, int stride, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglSecondaryColorPointer(size, GL11.GL_FLOAT, stride, data, data.position() << 2);
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ public final class GL15 {
|
|||
private static native void nglBindBuffer(int target, int buffer);
|
||||
|
||||
public static void glDeleteBuffers(IntBuffer buffers) {
|
||||
BufferChecks.checkDirect(buffers);
|
||||
for ( int i = buffers.position(); i < buffers.limit(); i++ ) {
|
||||
int buffer_handle = buffers.get(i);
|
||||
if ( VBOTracker.getVBOElementStack().getState() == buffer_handle )
|
||||
|
@ -105,6 +106,7 @@ public final class GL15 {
|
|||
private static native void nglDeleteBuffers(int n, IntBuffer buffers, int buffers_offset);
|
||||
|
||||
public static void glGenBuffers(IntBuffer buffers) {
|
||||
BufferChecks.checkDirect(buffers);
|
||||
nglGenBuffers(buffers.remaining(), buffers, buffers.position());
|
||||
}
|
||||
|
||||
|
@ -113,19 +115,23 @@ public final class GL15 {
|
|||
public static native boolean glIsBuffer(int buffer);
|
||||
|
||||
public static void glBufferData(int target, int size, ByteBuffer data, int usage) {
|
||||
nglBufferData(target, size, data, data != null ? data.position() : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferData(target, data != null ? data.remaining() : size, data, data != null ? data.position() : 0, usage);
|
||||
}
|
||||
|
||||
public static void glBufferData(int target, int size, ShortBuffer data, int usage) {
|
||||
nglBufferData(target, size, data, data != null ? data.position() << 1 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferData(target, data != null ? data.remaining()<<1 : size, data, data != null ? data.position() << 1 : 0, usage);
|
||||
}
|
||||
|
||||
public static void glBufferData(int target, int size, FloatBuffer data, int usage) {
|
||||
nglBufferData(target, size, data, data != null ? data.position() << 2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferData(target, data != null ? data.remaining()<<2 : size, data, data != null ? data.position() << 2 : 0, usage);
|
||||
}
|
||||
|
||||
public static void glBufferData(int target, int size, IntBuffer data, int usage) {
|
||||
nglBufferData(target, size, data, data != null ? data.position() << 2 : 0, usage);
|
||||
BufferChecks.checkDirectOrNull(data);
|
||||
nglBufferData(target, data != null ? data.remaining()<<2 : size, data, data != null ? data.position() << 2 : 0, usage);
|
||||
}
|
||||
|
||||
private static native void nglBufferData(int target,
|
||||
|
@ -135,18 +141,22 @@ public final class GL15 {
|
|||
int usage);
|
||||
|
||||
public static void glBufferSubData(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubData(target, offset, data.remaining(), data, data.position());
|
||||
}
|
||||
|
||||
public static void glBufferSubData(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubData(target, offset, data.remaining() << 1, data, data.position() << 1);
|
||||
}
|
||||
|
||||
public static void glBufferSubData(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubData(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
public static void glBufferSubData(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglBufferSubData(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
|
@ -157,18 +167,22 @@ public final class GL15 {
|
|||
int data_offset);
|
||||
|
||||
public static void glGetBufferSubData(int target, int offset, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubData(target, offset, data.remaining(), data, data.position());
|
||||
}
|
||||
|
||||
public static void glGetBufferSubData(int target, int offset, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubData(target, offset, data.remaining() << 1, data, data.position() << 1);
|
||||
}
|
||||
|
||||
public static void glGetBufferSubData(int target, int offset, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubData(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
public static void glGetBufferSubData(int target, int offset, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglGetBufferSubData(target, offset, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
|
@ -238,6 +252,7 @@ public final class GL15 {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGenQueries(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglGenQueries(ids.remaining(), ids, ids.position());
|
||||
}
|
||||
|
||||
|
@ -246,6 +261,7 @@ public final class GL15 {
|
|||
|
||||
// ---------------------------
|
||||
public static void glDeleteQueries(IntBuffer ids) {
|
||||
BufferChecks.checkDirect(ids);
|
||||
nglDeleteQueries(ids.remaining(), ids, ids.position());
|
||||
}
|
||||
|
||||
|
@ -260,6 +276,7 @@ public final class GL15 {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetQuery(int target, int pname, IntBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetQueryiv(target, pname, params, params.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -67,10 +67,12 @@ public final class NVEvaluators {
|
|||
|
||||
public static void glGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, FloatBuffer pPoints) {
|
||||
// TODO:Check buffer size
|
||||
BufferChecks.checkDirect(pPoints);
|
||||
nglGetMapControlPointsNV(target, index, type, ustride, vstride, packed, pPoints, pPoints.position()<<2);
|
||||
}
|
||||
private static native void nglGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, Buffer pPoints, int pPoints_offset);
|
||||
public static void glMapControlPointsNV(int target, int index, int type, int ustride, int vstride, int uorder, int vorder, boolean packed, FloatBuffer pPoints) {
|
||||
BufferChecks.checkDirect(pPoints);
|
||||
// TODO:Check buffer size
|
||||
nglMapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, pPoints, pPoints.position()<<2);
|
||||
}
|
||||
|
|
|
@ -43,10 +43,12 @@ public final class NVFence {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glGenFencesNV(IntBuffer piFences) {
|
||||
BufferChecks.checkDirect(piFences);
|
||||
nglGenFencesNV(piFences.remaining(), piFences, piFences.position());
|
||||
}
|
||||
private static native void nglGenFencesNV(int n, IntBuffer piFences, int piFences_offset);
|
||||
public static void glDeleteFencesNV(IntBuffer piFences) {
|
||||
BufferChecks.checkDirect(piFences);
|
||||
nglDeleteFencesNV(piFences.remaining(), piFences, piFences.position());
|
||||
}
|
||||
private static native void nglDeleteFencesNV(int n, IntBuffer piFences, int piFences_offset);
|
||||
|
|
|
@ -62,6 +62,7 @@ public final class NVFragmentProgram extends NVProgram {
|
|||
// ---------------------------
|
||||
|
||||
public static void glProgramNamedParameter4fNV(int id, ByteBuffer name, float x, float y, float z, float w) {
|
||||
BufferChecks.checkDirect(name);
|
||||
nglProgramNamedParameter4fNV(id, name.remaining(), name, name.position(), x, y, z, w);
|
||||
}
|
||||
|
||||
|
@ -80,6 +81,7 @@ public final class NVFragmentProgram extends NVProgram {
|
|||
// ---------------------------
|
||||
|
||||
public static void glGetProgramNamedParameterNV(int id, ByteBuffer name, FloatBuffer params) {
|
||||
BufferChecks.checkDirect(name);
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetProgramNamedParameterfvNV(id, name.remaining(), name, name.position(), params, params.position());
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ public final class NVHalfFloat {
|
|||
|
||||
// ---------------------------
|
||||
public static void glVertexAttribs1hNV(int index, ShortBuffer attribs) {
|
||||
BufferChecks.checkDirect(attribs);
|
||||
nglVertexAttribs1hvNV(index, attribs.remaining(), attribs, attribs.position());
|
||||
}
|
||||
|
||||
|
@ -99,6 +100,7 @@ public final class NVHalfFloat {
|
|||
|
||||
// ---------------------------
|
||||
public static void glVertexAttribs2hNV(int index, ShortBuffer attribs) {
|
||||
BufferChecks.checkDirect(attribs);
|
||||
nglVertexAttribs2hvNV(index, attribs.remaining() >> 1, attribs, attribs.position());
|
||||
}
|
||||
|
||||
|
@ -108,6 +110,7 @@ public final class NVHalfFloat {
|
|||
|
||||
// ---------------------------
|
||||
public static void glVertexAttribs3hNV(int index, ShortBuffer attribs) {
|
||||
BufferChecks.checkDirect(attribs);
|
||||
nglVertexAttribs3hvNV(index, attribs.remaining() / 3, attribs, attribs.position());
|
||||
}
|
||||
|
||||
|
@ -117,6 +120,7 @@ public final class NVHalfFloat {
|
|||
|
||||
// ---------------------------
|
||||
public static void glVertexAttribs4hNV(int index, ShortBuffer attribs) {
|
||||
BufferChecks.checkDirect(attribs);
|
||||
nglVertexAttribs4hvNV(index, attribs.remaining() >> 2, attribs, attribs.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,12 @@ public final class NVOcclusionQuery {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glGenOcclusionQueriesNV(IntBuffer piIDs) {
|
||||
BufferChecks.checkDirect(piIDs);
|
||||
nglGenOcclusionQueriesNV(piIDs.remaining(), piIDs, piIDs.position());
|
||||
}
|
||||
private static native void nglGenOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_offset);
|
||||
public static void glDeleteOcclusionQueriesNV(IntBuffer piIDs) {
|
||||
BufferChecks.checkDirect(piIDs);
|
||||
nglDeleteOcclusionQueriesNV(piIDs.remaining(), piIDs, piIDs.position());
|
||||
}
|
||||
private static native void nglDeleteOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_offset);
|
||||
|
|
|
@ -66,18 +66,22 @@ public final class NVPixelDataRange {
|
|||
|
||||
// ---------------------------
|
||||
public static void glPixelDataRangeNV(int target, ByteBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglPixelDataRangeNV(target, data.remaining(), data, data.position());
|
||||
}
|
||||
|
||||
public static void glPixelDataRangeNV(int target, ShortBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglPixelDataRangeNV(target, data.remaining() << 1, data, data.position() << 1);
|
||||
}
|
||||
|
||||
public static void glPixelDataRangeNV(int target, IntBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglPixelDataRangeNV(target, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
public static void glPixelDataRangeNV(int target, FloatBuffer data) {
|
||||
BufferChecks.checkDirect(data);
|
||||
nglPixelDataRangeNV(target, data.remaining() << 2, data, data.position() << 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glLoadProgramNV(int target, int programID, ByteBuffer string) {
|
||||
BufferChecks.checkDirect(string);
|
||||
nglLoadProgramNV(target, programID, string.remaining(), string, string.position());
|
||||
}
|
||||
|
||||
|
@ -76,6 +77,7 @@ public class NVProgram {
|
|||
// ---------------------------
|
||||
|
||||
public static void glDeleteProgramsNV(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglDeleteProgramsNV(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
|
@ -85,6 +87,7 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGenProgramsNV(IntBuffer programs) {
|
||||
BufferChecks.checkDirect(programs);
|
||||
nglGenProgramsNV(programs.remaining(), programs, programs.position());
|
||||
}
|
||||
|
||||
|
@ -94,6 +97,7 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetProgramNV(int programID, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkDirect(params);
|
||||
nglGetProgramivNV(programID, parameterName, params, params.position());
|
||||
}
|
||||
|
||||
|
@ -102,6 +106,7 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glGetProgramStringNV(int programID, int parameterName, ByteBuffer paramString) {
|
||||
BufferChecks.checkDirect(paramString);
|
||||
nglGetProgramStringNV(programID, parameterName, paramString, paramString.position());
|
||||
}
|
||||
|
||||
|
@ -112,6 +117,8 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static boolean glAreProgramsResidentNV(IntBuffer programIDs, ByteBuffer programResidences) {
|
||||
BufferChecks.checkDirect(programIDs);
|
||||
BufferChecks.checkDirect(programResidences);
|
||||
if ( programIDs.remaining() != programResidences.remaining() )
|
||||
throw new IllegalArgumentException("programIDs.remaining() != programResidences.remaining()");
|
||||
return nglAreProgramsResidentNV(programIDs.remaining(),
|
||||
|
@ -130,6 +137,7 @@ public class NVProgram {
|
|||
|
||||
// ---------------------------
|
||||
public static void glRequestResidentProgramsNV(IntBuffer programIDs) {
|
||||
BufferChecks.checkDirect(programIDs);
|
||||
nglRequestResidentProgramsNV(programIDs.remaining(), programIDs, programIDs.position());
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ public final class NVVertexArrayRange {
|
|||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
||||
public static void glVertexArrayRangeNV(ByteBuffer pPointer) {
|
||||
BufferChecks.checkDirect(pPointer);
|
||||
nglVertexArrayRangeNV(pPointer.remaining(), pPointer, pPointer.position());
|
||||
}
|
||||
private static native void nglVertexArrayRangeNV(int size, Buffer pPointer, int pPointer_offset);
|
||||
|
|
|
@ -49,7 +49,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
|
||||
LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_NV = 0x8620;
|
||||
|
||||
/*
|
||||
|
@ -57,103 +56,74 @@ public final class NVVertexProgram extends NVProgram {
|
|||
and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
|
||||
|
||||
/*
|
||||
Accepted by the <target> parameter of ExecuteProgramNV and
|
||||
LoadProgramNV:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
|
||||
*/
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
|
||||
|
||||
public static final int GL_CURRENT_ATTRIB_NV = 0x8626;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetProgramParameterfvNV
|
||||
and GetProgramParameterdvNV:
|
||||
*/
|
||||
|
||||
public static final int GL_PROGRAM_PARAMETER_NV = 0x8644;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttribPointervNV:
|
||||
*/
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetTrackMatrixivNV:
|
||||
*/
|
||||
|
||||
public static final int GL_TRACK_MATRIX_NV = 0x8648;
|
||||
|
||||
public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
|
||||
|
||||
public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F;
|
||||
|
||||
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
|
||||
|
||||
public static final int GL_CURRENT_MATRIX_NV = 0x8641;
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
|
||||
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629;
|
||||
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV and by the
|
||||
<mode> parameter of MatrixMode:
|
||||
*/
|
||||
|
||||
public static final int GL_MATRIX0_NV = 0x8630;
|
||||
|
||||
public static final int GL_MATRIX1_NV = 0x8631;
|
||||
|
||||
public static final int GL_MATRIX2_NV = 0x8632;
|
||||
|
||||
public static final int GL_MATRIX3_NV = 0x8633;
|
||||
|
||||
public static final int GL_MATRIX4_NV = 0x8634;
|
||||
|
||||
public static final int GL_MATRIX5_NV = 0x8635;
|
||||
|
||||
public static final int GL_MATRIX6_NV = 0x8636;
|
||||
|
||||
public static final int GL_MATRIX7_NV = 0x8637;
|
||||
|
||||
/*
|
||||
Accepted by the <transform> parameter of TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_IDENTITY_NV = 0x862A;
|
||||
|
||||
public static final int GL_INVERSE_NV = 0x862B;
|
||||
|
||||
public static final int GL_TRANSPOSE_NV = 0x862C;
|
||||
|
||||
public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D;
|
||||
|
||||
/*
|
||||
|
@ -162,37 +132,21 @@ public final class NVVertexProgram extends NVProgram {
|
|||
the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
|
||||
GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
|
||||
|
||||
/*
|
||||
|
@ -201,37 +155,21 @@ public final class NVVertexProgram extends NVProgram {
|
|||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
|
||||
|
||||
/*
|
||||
|
@ -240,37 +178,21 @@ public final class NVVertexProgram extends NVProgram {
|
|||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
|
||||
|
||||
static native void initNativeStubs() throws LWJGLException;
|
||||
|
@ -280,7 +202,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
public static void glExecuteProgramNV(int target, int id, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglExecuteProgramNV(target, id, params, params.position());
|
||||
|
||||
}
|
||||
|
||||
private static native void nglExecuteProgramNV(int target, int id, FloatBuffer params, int paramsOffset);
|
||||
|
@ -292,7 +213,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
public static void glGetProgramParameterNV(int target, int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetProgramParameterfvNV(target, index, parameterName, params, params.position());
|
||||
|
||||
}
|
||||
|
||||
private static native void nglGetProgramParameterfvNV(
|
||||
|
@ -326,7 +246,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
public static void glGetVertexAttribNV(int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribfvNV(index, parameterName, params, params.position());
|
||||
|
||||
}
|
||||
|
||||
private static native void nglGetVertexAttribfvNV(int index, int parameterName, FloatBuffer params, int paramsOffset);
|
||||
|
@ -338,7 +257,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
public static void glGetVertexAttribNV(int index, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribivNV(index, parameterName, params, params.position());
|
||||
|
||||
}
|
||||
|
||||
private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int paramsOffset);
|
||||
|
@ -352,12 +270,11 @@ public final class NVVertexProgram extends NVProgram {
|
|||
// ---------------------------
|
||||
|
||||
public static void glProgramParameters4NV(int target, int index, int count, FloatBuffer params) {
|
||||
|
||||
BufferChecks.checkDirect(params);
|
||||
// Special case buffer check
|
||||
if (params.remaining() < count * 4) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
|
||||
nglProgramParameters4fvNV(target, index, count, params, params.position());
|
||||
|
||||
}
|
||||
|
@ -374,9 +291,8 @@ public final class NVVertexProgram extends NVProgram {
|
|||
public static native void glTrackMatrixNV(int target, int address, int matrix, int transform);
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) {
|
||||
|
||||
BufferChecks.checkDirect(buffer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
|
@ -384,13 +300,11 @@ public final class NVVertexProgram extends NVProgram {
|
|||
stride,
|
||||
buffer,
|
||||
buffer.position());
|
||||
|
||||
}
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) {
|
||||
|
||||
BufferChecks.checkDirect(buffer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
|
@ -398,21 +312,17 @@ public final class NVVertexProgram extends NVProgram {
|
|||
stride,
|
||||
buffer,
|
||||
buffer.position() << 1);
|
||||
|
||||
}
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) {
|
||||
|
||||
BufferChecks.checkDirect(buffer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
nglVertexAttribPointerNV(index, size, GL11.GL_FLOAT, stride, buffer, buffer.position() << 2);
|
||||
|
||||
}
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer buffer) {
|
||||
|
||||
BufferChecks.checkDirect(buffer);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
|
@ -420,7 +330,6 @@ public final class NVVertexProgram extends NVProgram {
|
|||
stride,
|
||||
buffer,
|
||||
buffer.position() << 2);
|
||||
|
||||
}
|
||||
|
||||
private static native void nglVertexAttribPointerNV(
|
||||
|
@ -434,11 +343,8 @@ public final class NVVertexProgram extends NVProgram {
|
|||
// ---------------------------
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) {
|
||||
|
||||
BufferChecks.ensureArrayVBOenabled();
|
||||
|
||||
nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset);
|
||||
|
||||
}
|
||||
|
||||
private static native void nglVertexAttribPointerNVVBO(int index, int size, int type, int stride, int bufferOffset);
|
||||
|
@ -463,48 +369,57 @@ public final class NVVertexProgram extends NVProgram {
|
|||
|
||||
public static native void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w);
|
||||
|
||||
public static void glVertexAttribs1NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs1svNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs1NV(int index, ShortBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs1svNV(index, v.remaining(), v, v.position()<<1);
|
||||
}
|
||||
private static native void nglVertexAttribs1svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs1NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs1fvNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs1NV(int index, FloatBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs1fvNV(index, v.remaining(), v, v.position()<<2);
|
||||
}
|
||||
private static native void nglVertexAttribs1fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs2NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs2svNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs2NV(int index, ShortBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs2svNV(index, v.remaining()>>1, v, v.position()<<1);
|
||||
}
|
||||
private static native void nglVertexAttribs2svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs2NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs2fvNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs2NV(int index, FloatBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs2fvNV(index, v.remaining()>>1, v, v.position()<<2);
|
||||
}
|
||||
private static native void nglVertexAttribs2fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs3NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs3svNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs3NV(int index, ShortBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs3svNV(index, v.remaining()/3, v, v.position()<<1);
|
||||
}
|
||||
private static native void nglVertexAttribs3svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs3NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs3fvNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs3NV(int index, FloatBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs3fvNV(index, v.remaining()/3, v, v.position()<<2);
|
||||
}
|
||||
private static native void nglVertexAttribs3fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs4svNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs4NV(int index, ShortBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs4svNV(index, v.remaining()>>2, v, v.position()<<1);
|
||||
}
|
||||
private static native void nglVertexAttribs4svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs4fvNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs4NV(int index, FloatBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs4fvNV(index, v.remaining()>>2, v, v.position()<<2);
|
||||
}
|
||||
private static native void nglVertexAttribs4fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4uNV(int index, int n, ByteBuffer v) {
|
||||
nglVertexAttribs4ubvNV(index, n, v, v.position());
|
||||
public static void glVertexAttribs4uNV(int index, ByteBuffer v) {
|
||||
BufferChecks.checkDirect(v);
|
||||
nglVertexAttribs4ubvNV(index, v.remaining()>>2, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4ubvNV(int index, int n, ByteBuffer v, int v_offset);
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ public final class Pbuffer {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create an instance of a Pbuffer using the Display context. The buffer is double-buffered, like the Display.
|
||||
* Create an instance of a Pbuffer using the Display context. The buffer is single-buffered, unlike the Display.
|
||||
* <p/>
|
||||
* NOTE: The Pbuffer will use the same context as the Display and requires that the Display has been created. Therefore,
|
||||
* no separate pixel format can be specified. All OpenGL state,
|
||||
|
|
|
@ -128,6 +128,50 @@ static bool createPbufferUsingUniqueContext(JNIEnv *env, PbufferInfo *pbuffer_in
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool configMatches(const GLXFBConfig config1, const GLXFBConfig config2, int glx_val) {
|
||||
int config_val1;
|
||||
int config_val2;
|
||||
if (glXGetFBConfigAttrib(getDisplay(), config1, glx_val, &config_val1) != Success)
|
||||
return false;
|
||||
if (glXGetFBConfigAttrib(getDisplay(), config2, glx_val, &config_val2) != Success)
|
||||
return false;
|
||||
return config_val1 == config_val2;
|
||||
}
|
||||
|
||||
static GLXFBConfig chooseSingleBufferedConfigFromConfig(const GLXFBConfig orig_config) {
|
||||
int num_elements;
|
||||
GLXFBConfig *configs = glXGetFBConfigs(getDisplay(), getCurrentScreen(), &num_elements);
|
||||
for (int i = 0; i < num_elements; i++) {
|
||||
GLXFBConfig config = configs[i];
|
||||
int double_buffer;
|
||||
int drawable_type;
|
||||
if (glXGetFBConfigAttrib(getDisplay(), config, GLX_DOUBLEBUFFER, &double_buffer) != Success)
|
||||
return NULL;
|
||||
if (glXGetFBConfigAttrib(getDisplay(), config, GLX_DRAWABLE_TYPE, &drawable_type) != Success)
|
||||
return NULL;
|
||||
if (double_buffer != False || (drawable_type & GLX_PBUFFER_BIT == 0))
|
||||
continue;
|
||||
if (configMatches(config, orig_config, GLX_RED_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_GREEN_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_BLUE_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_ALPHA_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_DEPTH_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_STENCIL_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_STEREO) &&
|
||||
configMatches(config, orig_config, GLX_AUX_BUFFERS) &&
|
||||
configMatches(config, orig_config, GLX_ACCUM_RED_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_ACCUM_GREEN_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_ACCUM_BLUE_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_ACCUM_ALPHA_SIZE) &&
|
||||
configMatches(config, orig_config, GLX_RENDER_TYPE) &&
|
||||
(!extgl_Extensions.GLX_ARB_multisample || (configMatches(config, orig_config, GLX_SAMPLE_BUFFERS_ARB) &&
|
||||
configMatches(config, orig_config, GLX_SAMPLES_ARB)))) {
|
||||
return config;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool createPbufferUsingDisplayContext(JNIEnv *env, PbufferInfo *buffer_info, int width, int height, const int *buffer_attribs) {
|
||||
if (!checkPbufferCaps(env, getCurrentGLXFBConfig(), width, height)) {
|
||||
return false;
|
||||
|
@ -141,7 +185,12 @@ static bool createPbufferUsingDisplayContext(JNIEnv *env, PbufferInfo *buffer_in
|
|||
throwException(env, "Display context does not support Pbuffers");
|
||||
return false;
|
||||
}
|
||||
GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), getCurrentGLXFBConfig(), buffer_attribs);
|
||||
GLXFBConfig config = chooseSingleBufferedConfigFromConfig(getCurrentGLXFBConfig());
|
||||
if (config == NULL) {
|
||||
throwException(env, "Could not find a suitable GLXFBConfig");
|
||||
return false;
|
||||
}
|
||||
GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), config, buffer_attribs);
|
||||
buffer_info->buffer = buffer;
|
||||
buffer_info->context = getCurrentGLXContext();
|
||||
return true;
|
||||
|
@ -153,7 +202,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass
|
|||
if (disp == NULL) {
|
||||
return;
|
||||
}
|
||||
int current_screen = XDefaultScreen(disp);
|
||||
int current_screen = getCurrentScreen();
|
||||
if (!extgl_InitGLX(env, disp, current_screen)) {
|
||||
decDisplay();
|
||||
throwException(env, "Could not init GLX");
|
||||
|
|
Loading…
Reference in New Issue