From 84e5ba7a4821469f43c0f4bbeaa8e383b203d050 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Mar 2010 03:39:16 +0200 Subject: http://www.jogamp.org/bugzilla/show_bug.cgi?id=392 32bit/64bit values and arrays are misrepresented - PointerBuffer: Adding methods PointeRBuffer referenceBuffer(int index, Buffer data) PointeRBuffer referenceBuffer(Buffer data) Buffer getReferencedBuffer(int index) Buffer getReferencedBuffer() Adding a reference of a given direct Buffer to this pointer buffer, and retrieving a previously referenced direct Buffer. This allows a more convenient handling of PointerBuffer with the user API's .. --- src/native/common/CPU.c | 10 ---------- src/native/common/Platform.c | 10 ++++++++++ src/native/common/PointerBuffer.c | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 src/native/common/CPU.c create mode 100644 src/native/common/Platform.c create mode 100644 src/native/common/PointerBuffer.c (limited to 'src/native') diff --git a/src/native/common/CPU.c b/src/native/common/CPU.c deleted file mode 100644 index 0cc7adc..0000000 --- a/src/native/common/CPU.c +++ /dev/null @@ -1,10 +0,0 @@ - -#include - -#include - -JNIEXPORT jint JNICALL -Java_com_jogamp_gluegen_runtime_Platform_getPointerSizeInBitsImpl(JNIEnv *env, jclass _unused) { - return sizeof(void *) * 8; -} - diff --git a/src/native/common/Platform.c b/src/native/common/Platform.c new file mode 100644 index 0000000..0cc7adc --- /dev/null +++ b/src/native/common/Platform.c @@ -0,0 +1,10 @@ + +#include + +#include + +JNIEXPORT jint JNICALL +Java_com_jogamp_gluegen_runtime_Platform_getPointerSizeInBitsImpl(JNIEnv *env, jclass _unused) { + return sizeof(void *) * 8; +} + diff --git a/src/native/common/PointerBuffer.c b/src/native/common/PointerBuffer.c new file mode 100644 index 0000000..9736edc --- /dev/null +++ b/src/native/common/PointerBuffer.c @@ -0,0 +1,10 @@ + +#include + +#include + +JNIEXPORT jlong JNICALL +Java_com_jogamp_gluegen_runtime_PointerBuffer_getDirectBufferAddressImpl(JNIEnv *env, jclass _unused, jobject directBuffer) { + return ( NULL != directBuffer ) ? ( jlong) (*env)->GetDirectBufferAddress(env, directBuffer) : 0L ; +} + -- cgit v1.2.3