Fixed VBO checks and disabled BufferChecks (for now)

This commit is contained in:
Elias Naur 2004-02-16 03:35:45 +00:00
parent 4658cc1c77
commit 547e50ed2d
14 changed files with 106 additions and 82 deletions

View File

@ -59,20 +59,20 @@ public class ARBMatrixPalette {
public static native void glCurrentPaletteMatrixARB(int index);
public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, pPointer, pPointer.position());
}
public static void glMatrixIndexPointerARB(int size, int stride, ShortBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, pPointer, pPointer.position()<<1);
}
public static void glMatrixIndexPointerARB(int size, int stride, IntBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, pPointer, pPointer.position()<<2);
}
private static native void nglMatrixIndexPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset);
public static void glMatrixIndexPointerARB(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglMatrixIndexPointerARBVBO(size, type, stride, buffer_offset);
}
private static native void nglMatrixIndexPointerARBVBO(int size, int type, int stride, int buffer_offset);

View File

@ -126,26 +126,26 @@ public class ARBVertexBlend {
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.ensureVBOdisabled();
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.ensureVBOdisabled();
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.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglWeightPointerARB(size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pPointer, pPointer.position()<<2);
}
private static native void nglWeightPointerARB(int size, int type, int stride, Buffer pPointer, int pPointer_offset);
public static void glWeightPointerARB(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglWeightPointerARBVBO(size, type, stride, buffer_offset);
}
private static native void nglWeightPointerARBVBO(int size, int type, int stride, int buffer_offset);
public static native void glVertexBlendARB(int count);
public static native void glVertexBlendARB(int count);
}

View File

@ -113,22 +113,22 @@ public class ARBVertexProgram extends ARBProgram {
public static native void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w);
public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position());
}
public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1);
}
public static void glVertexAttribPointerARB(int index, int size, boolean normalized, int stride, FloatBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerARB(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2);
}
public static void glVertexAttribPointerARB(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerARB(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2);
}
@ -136,7 +136,7 @@ public class ARBVertexProgram extends ARBProgram {
// ---------------------------
public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, int bufferOffset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglVertexAttribPointerARBVBO(index, size, type, normalized, stride, bufferOffset);
}

View File

@ -51,21 +51,21 @@ public class ATIElementArray {
public static final int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A;
public static void glElementPointerATI(ByteBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglElementPointerATI(GL11.GL_UNSIGNED_BYTE, pPointer, pPointer.position());
}
public static void glElementPointerATI(ShortBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglElementPointerATI(GL11.GL_UNSIGNED_SHORT, pPointer, pPointer.position()<<1);
}
public static void glElementPointerATI(IntBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglElementPointerATI(GL11.GL_UNSIGNED_INT, pPointer, pPointer.position()<<2);
}
private static native void nglElementPointerATI(int type, Buffer pPointer, int pPointer_offset);
public static void glElementPointerATI(int type, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglElementPointerATIVBO(type, buffer_offset);
}
private static native void nglElementPointerATIVBO(int type, int buffer_offset);

View File

@ -67,7 +67,9 @@ class BufferChecks {
*/
static void checkBuffer(Buffer buf) {
if (buf.remaining() < MIN_BUFFER_SIZE) {
throw new BufferOverflowException();
// TODO: I don't think the default MIN_BUFFER_SIZE should be used for other than glGet*
// Others, like glTexEnvf, should use their individual buffer max size (like 4)
// throw new BufferOverflowException();
}
}
/**
@ -89,7 +91,7 @@ class BufferChecks {
* Helper method to ensure that vertex buffer objects are disabled. If they
* are enabled, we'll throw an OpenGLException
*/
static void ensureVBOdisabled() {
static void ensureArrayVBOdisabled() {
if (VBOTracker.getVBOArrayStack().getState() != 0) {
throw new OpenGLException("Cannot use Buffers when VBO is enabled");
}
@ -98,11 +100,29 @@ class BufferChecks {
* Helper method to ensure that vertex buffer objects are enabled. If they
* are disabled, we'll throw an OpenGLException
*/
static void ensureVBOenabled() {
static void ensureArrayVBOenabled() {
if (VBOTracker.getVBOArrayStack().getState() == 0) {
throw new OpenGLException("Cannot use offsets when VBO is disabled");
}
}
/**
* Helper method to ensure that vertex buffer objects are disabled. If they
* are enabled, we'll throw an OpenGLException
*/
static void ensureElementVBOdisabled() {
if (VBOTracker.getVBOElementStack().getState() != 0) {
throw new OpenGLException("Cannot use Buffers when VBO is enabled");
}
}
/**
* Helper method to ensure that vertex buffer objects are enabled. If they
* are disabled, we'll throw an OpenGLException
*/
static void ensureElementVBOenabled() {
if (VBOTracker.getVBOElementStack().getState() == 0) {
throw new OpenGLException("Cannot use offsets when VBO is disabled");
}
}
/**
* Calculate the storage required for an image.
*
@ -136,7 +156,9 @@ class BufferChecks {
bpe = 4;
break;
default :
throw new IllegalArgumentException("Unknown type " + type);
// TODO: Add more types (like the GL12 types GL_UNSIGNED_INT_8_8_8_8
return 0;
// throw new IllegalArgumentException("Unknown type " + type);
}
int epp;
switch (format) {
@ -158,8 +180,10 @@ class BufferChecks {
epp = 4;
break;
default :
// Assume 4 elements per pixel
epp = 4;
// TODO: Add more formats. Assuming 4 is too wasteful on buffer sizes where e.g. 1 is enough (like GL_DEPTH_COMPONENT)
return 0;
/* // Assume 4 elements per pixel
epp = 4;*/
}
return epp * bpe * width * height * depth;
}

View File

@ -50,21 +50,21 @@ public class EXTDrawRangeElements {
public static final int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9;
public static void glDrawRangeElementsEXT(int mode, int start, int end, ByteBuffer pIndices) {
BufferChecks.ensureVBOdisabled();
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.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL11.GL_UNSIGNED_INT, pIndices, pIndices.position()<<2);
}
private static native void nglDrawRangeElementsEXT(int mode, int start, int end, int count, int type, Buffer pIndices, int pIndices_offset);
public static void glDrawRangeElementsEXT(int mode, int start, int end, int count, int type, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureElementVBOenabled();
nglDrawRangeElementsEXTVBO(mode, start, end, count, type, buffer_offset);
}
private static native void nglDrawRangeElementsEXTVBO(int mode, int start, int end, int count, int type, int buffer_offset);

View File

@ -56,12 +56,12 @@ public class EXTFogCoord {
public static native void glFogCoordfEXT(float coord);
public static void glFogCoordPointerEXT(int stride, FloatBuffer data) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglFogCoordPointerEXT(GL11.GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglFogCoordPointerEXT(int type, int stride, Buffer data, int data_offset);
public static void glFogCoordPointerEXT(int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglFogCoordPointerEXTVBO(type, stride, buffer_offset);
}
private static native void nglFogCoordPointerEXTVBO(int type, int stride, int buffer_offset);

View File

@ -60,17 +60,17 @@ public 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.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglSecondaryColorPointerEXT(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2);
}
private static native void nglSecondaryColorPointerEXT(int size, int type, int stride, Buffer pPointer, int pPointer_offset);
public static void glSecondaryColorPointerEXT(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglSecondaryColorPointerEXTVBO(size, type, stride, buffer_offset);
}
private static native void nglSecondaryColorPointerEXTVBO(int size, int type, int stride, int buffer_offset);

View File

@ -279,24 +279,24 @@ public 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.ensureVBOdisabled();
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.ensureVBOdisabled();
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.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pAddr, pAddr.position()<<2);
}
private static native void nglVariantPointerEXT(int id, int type, int stride, Buffer pAddr, int pAddr_offset);
public static void glVariantPointerEXT(int id, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglVariantPointerEXTVBO(id, type, stride, buffer_offset);
}
private static native void nglVariantPointerEXTVBO(int id, int type, int stride, int buffer_offset);

View File

@ -61,12 +61,12 @@ public class EXTVertexWeighting {
public static native void glVertexWeightfEXT(float weight);
public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexWeightPointerEXT(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position()<<2);
}
private static native void nglVertexWeightPointerEXT(int size, int type, int stride, Buffer pPointer, int pPointer_offset);
public static void glVertexWeightPointerEXT(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglVertexWeightPointerEXTVBO(size, type, stride, buffer_offset);
}
private static native void nglVertexWeightPointerEXTVBO(int size, int type, int stride, int buffer_offset);

View File

@ -763,16 +763,16 @@ public abstract 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.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glColorPointer(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglColorPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglColorPointerVBO(int size, int type, int stride, int buffer_offset);
@ -804,12 +804,12 @@ public abstract 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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglEdgeFlagPointer(stride, pointer, pointer.position());
}
private static native void nglEdgeFlagPointer(int stride, Buffer pointer, int pointer_offset);
public static void glEdgeFlagPointer(int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglEdgeFlagPointerVBO(stride, buffer_offset);
}
private static native void nglEdgeFlagPointerVBO(int stride, int buffer_offset);
@ -834,20 +834,20 @@ public abstract class GL11 {
}
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.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position());
}
public static void glDrawElements(int mode, ShortBuffer indices) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1);
}
public static void glDrawElements(int mode, IntBuffer indices) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2);
}
private static native void nglDrawElements(int mode, int count, int type, Buffer indices, int indices_offset);
public static void glDrawElements(int mode, int count, int type, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureElementVBOenabled();
nglDrawElementsVBO(mode, count, type, buffer_offset);
}
private static native void nglDrawElementsVBO(int mode, int count, int type, int buffer_offset);
@ -963,24 +963,24 @@ public abstract 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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglInterleavedArrays(format, stride, pointer, pointer.position());
}
public static void glInterleavedArrays(int format, int stride, ShortBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglInterleavedArrays(format, stride, pointer, pointer.position() << 1);
}
public static void glInterleavedArrays(int format, int stride, IntBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
public static void glInterleavedArrays(int format, int stride, FloatBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
private static native void nglInterleavedArrays(int format, int stride, Buffer pointer, int pointer_offset);
public static void glInterleavedArrays(int format, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglInterleavedArraysVBO(format, stride, buffer_offset);
}
private static native void nglInterleavedArraysVBO(int format, int stride, int buffer_offset);
@ -1155,20 +1155,20 @@ public abstract class GL11 {
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglNormalPointer(GL_BYTE, stride, pointer, pointer.position());
}
public static void glNormalPointer(int stride, IntBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglNormalPointer(GL_INT, stride, pointer, pointer.position() << 2);
}
public static void glNormalPointer(int stride, FloatBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglNormalPointer(GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglNormalPointer(int type, int stride, Buffer pointer, int pointer_offset);
public static void glNormalPointer(int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglNormalPointerVBO(type, stride, buffer_offset);
}
private static native void nglNormalPointerVBO(int type, int stride, int buffer_offset);
@ -1245,16 +1245,16 @@ public abstract 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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
public static void glVertexPointer(int size, int stride, IntBuffer pointer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexPointer(size, GL_INT, stride, pointer, pointer.position() << 2);
}
private static native void nglVertexPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glVertexPointer(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglVertexPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglVertexPointerVBO(int size, int type, int stride, int buffer_offset);
@ -1390,12 +1390,12 @@ public abstract 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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglTexCoordPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglTexCoordPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glTexCoordPointer(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglTexCoordPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglTexCoordPointerVBO(int size, int type, int stride, int buffer_offset);

View File

@ -343,20 +343,20 @@ public abstract class GL12 extends GL11 {
}
private static native void nglGetSeparableFilter(int target, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset, Buffer span, int span_offset);
public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position());
}
public static void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1);
}
public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureElementVBOdisabled();
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2);
}
private static native void nglDrawRangeElements(int mode, int start, int end, int count, int type, Buffer indices, int indices_offset);
public static void glDrawRangeElements(int mode, int start, int end, int count, int type, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureElementVBOenabled();
nglDrawRangeElementsVBO(mode, start, end, count, type, buffer_offset);
}
private static native void nglDrawRangeElementsVBO(int mode, int start, int end, int count, int type, int buffer_offset);

View File

@ -88,12 +88,12 @@ public abstract class GL14 extends GL13 {
public static native void glFogCoordf(float coord);
public static void glFogCoordPointer(int stride, FloatBuffer data) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglFogCoordPointer(GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglFogCoordPointer(int type, int stride, Buffer data, int data_offset);
public static void glFogCoordPointer(int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglFogCoordPointerVBO(type, stride, buffer_offset);
}
private static native void nglFogCoordPointerVBO(int type, int stride, int buffer_offset);
@ -115,16 +115,16 @@ public abstract class GL14 extends GL13 {
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglSecondaryColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, data, data.position());
}
public static void glSecondaryColorPointer(int size, int stride, FloatBuffer data) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglSecondaryColorPointer(size, GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglSecondaryColorPointer (int size, int type, int stride, Buffer data, int data_offset);
public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglSecondaryColorPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset);

View File

@ -381,7 +381,7 @@ public class NVVertexProgram extends NVProgram {
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerNV(
index,
@ -395,8 +395,8 @@ public class NVVertexProgram extends NVProgram {
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) {
BufferChecks.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerNV(
index,
size,
@ -409,16 +409,16 @@ public class NVVertexProgram extends NVProgram {
public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) {
BufferChecks.ensureVBOdisabled();
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.ensureVBOdisabled();
BufferChecks.ensureArrayVBOdisabled();
nglVertexAttribPointerNV(
index,
size,
@ -441,8 +441,8 @@ public class NVVertexProgram extends NVProgram {
public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) {
BufferChecks.ensureVBOenabled();
BufferChecks.ensureArrayVBOenabled();
nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset);
}