Added createARBVBOBuffer to enable VBO indexing with Buffers

This commit is contained in:
Elias Naur 2003-07-17 09:16:51 +00:00
parent 926121d83f
commit 794c802253
5 changed files with 50 additions and 3 deletions

View File

@ -127,13 +127,30 @@ public final class Sys {
private static void initialize() {
System.loadLibrary(LIBRARY_NAME);
setTime(0);
}
}
/**
* Gets the native NULL constant value
*/
private static native ByteBuffer nGetNULLValue();
/**
* Create a buffer representing an index into a ARB_vertex_buffer_object buffer.
*
* Example:
*
* ByteBuffer b = Sys.createARBVBOBuffer(0);
* gl.glVertexPointer(3, GL.GL_INT, 0, b);
*
* is equivalent to the C call:
*
* glVertexPointer(3, GL.GL_INT, 0, 0);
*
* @param index The VBO index to represent
* @return a ByteBuffer representing the VBO index
*/
public static native ByteBuffer createARBVBOBuffer(int index);
/**
* Obtains the number of ticks that the hires timer does in a second.
*

View File

@ -29,6 +29,14 @@ extern "C" {
JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_nGetNULLValue
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_Sys
* Method: createARBVBOBuffer
* Signature: (I)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_createARBVBOBuffer
(JNIEnv *, jclass, jint);
/*
* Class: org_lwjgl_Sys
* Method: getTimerResolution

View File

@ -51,8 +51,8 @@ if test "x$JAVA_HOME" = x; then
else
AC_MSG_RESULT($JAVA_HOME)
JAVA_HOME="$JAVA_HOME"
CPPFLAGS="$CPPFLAGS -D_DEBUG -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
CFLAGS="$CFLAGS -D_DEBUG -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
CPPFLAGS="$CPPFLAGS -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
CFLAGS="$CFLAGS -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
fi
dnl Checks for libraries.

View File

@ -58,6 +58,17 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_nGetNULLValue
{
return env->NewDirectByteBuffer(NULL, 0);
}
/*
* Class: org_lwjgl_Sys
* Method: createARBVBOBuffer
* Signature: (I)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_createARBVBOBuffer
(JNIEnv *env, jclass clazz, jint address)
{
return env->NewDirectByteBuffer((void *)address, 0);
}
/*
* Class: org_lwjgl_Sys

View File

@ -60,6 +60,17 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_nGetNULLValue
return env->NewDirectByteBuffer(NULL, 0);
}
/*
* Class: org_lwjgl_Sys
* Method: createARBVBOBuffer
* Signature: (I)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_createARBVBOBuffer
(JNIEnv *env, jclass clazz, jint address)
{
return env->NewDirectByteBuffer((void *)address, 0);
}
/*
* Class: org_lwjgl_Sys
* Method: getTimerResolution