*** empty log message ***

This commit is contained in:
Caspian Rychlik-Prince 2003-08-01 20:57:09 +00:00
parent 67753ed1c2
commit 5c0612ef1f
2 changed files with 14 additions and 22 deletions

View File

@ -66,10 +66,10 @@ public class CoreGL11 implements CoreGL11Constants {
private static native void nglCallLists(int n, int type, Buffer lists, int lists_offset); 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 glCallList(int list);
public static native void glBlendFunc(int sfactor, int dfactor); public static native void glBlendFunc(int sfactor, int dfactor);
private static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) { public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) {
nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position()); nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position());
} }
public static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset); private static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset);
public static native void glBindTexture(int target, int texture); public static native void glBindTexture(int target, int texture);
public static native void glBegin(int mode); public static native void glBegin(int mode);
public static native void glEnd(); public static native void glEnd();
@ -89,7 +89,7 @@ public class CoreGL11 implements CoreGL11Constants {
public static void glColorPointer(int size, int stride, FloatBuffer pointer) { public static void glColorPointer(int size, int stride, FloatBuffer pointer) {
nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2); nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
} }
public static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset); private static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static native void glColorMaterial(int face, int mode); public static native void glColorMaterial(int face, int mode);
public static native void glColorMask(boolean red, boolean green, boolean blue, boolean alpha); public static native void glColorMask(boolean red, boolean green, boolean blue, boolean alpha);
public static native void glColor3b(byte red, byte green, byte blue); public static native void glColor3b(byte red, byte green, byte blue);
@ -236,6 +236,15 @@ public class CoreGL11 implements CoreGL11Constants {
public static void glInterleavedArrays(int format, int stride, ByteBuffer pointer) { public static void glInterleavedArrays(int format, int stride, ByteBuffer pointer) {
nglInterleavedArrays(format, stride, pointer, pointer.position()); nglInterleavedArrays(format, stride, pointer, pointer.position());
} }
public static void glInterleavedArrays(int format, int stride, ShortBuffer pointer) {
nglInterleavedArrays(format, stride, pointer, pointer.position() << 1);
}
public static void glInterleavedArrays(int format, int stride, IntBuffer pointer) {
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
public static void glInterleavedArrays(int format, int stride, FloatBuffer pointer) {
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
private static native void nglInterleavedArrays(int format, int stride, Buffer pointer, int pointer_offset); private static native void nglInterleavedArrays(int format, int stride, Buffer pointer, int pointer_offset);
public static native void glInitNames(); public static native void glInitNames();
public static native void glHint(int target, int mode); public static native void glHint(int target, int mode);

View File

@ -47,23 +47,6 @@ import java.nio.Buffer;
*/ */
public class CoreGL12 extends CoreGL11 implements CoreGL12Constants { public class CoreGL12 extends CoreGL11 implements CoreGL12Constants {
/**
* A helper function which is used to get the byte offset in an arbitrary buffer
* based on its position
* @return the position of the buffer, in BYTES
*/
static int getOffset(Buffer buffer) {
if (buffer instanceof FloatBuffer || buffer instanceof IntBuffer)
return buffer.position() << 2;
else if (buffer instanceof ShortBuffer || buffer instanceof CharBuffer)
return buffer.position() << 1;
else if (buffer instanceof DoubleBuffer || buffer instanceof LongBuffer)
return buffer.position() << 3;
else
return buffer.position();
}
public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) {
nglColorTable(target, internalFormat, width, format, type, data, data.position()); nglColorTable(target, internalFormat, width, format, type, data, data.position());
} }
@ -200,11 +183,11 @@ public class CoreGL12 extends CoreGL11 implements CoreGL12Constants {
} }
private static native void nglGetConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset); 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) { public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, Buffer column) {
nglSeparableFilter2D(target, internalformat, width, height, format, type, row, getOffset(row), column, getOffset(column)); nglSeparableFilter2D(target, internalformat, width, height, format, type, row, Util.getOffset(row), column, Util.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); 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) { public static void glGetSeparableFilter(int target, int format, int type, Buffer row, Buffer column, Buffer span) {
nglGetSeparableFilter(target, format, type, row, getOffset(row), column, getOffset(column), span, getOffset(span)); nglGetSeparableFilter(target, format, type, row, Util.getOffset(row), column, Util.getOffset(column), span, Util.getOffset(span));
} }
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); 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, int count, int type, ByteBuffer indices) { public static void glDrawRangeElements(int mode, int start, int end, int count, int type, ByteBuffer indices) {