Make Pbuffers that share the display context be single-buffered (linux part)

This commit is contained in:
Elias Naur 2004-07-26 13:36:04 +00:00
parent 1aee4598a9
commit 665f971aec
37 changed files with 525 additions and 281 deletions

View file

@ -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);