summaryrefslogtreecommitdiffstats
path: root/make/config/jogl/glu-CustomJavaCode-gl2.java
diff options
context:
space:
mode:
Diffstat (limited to 'make/config/jogl/glu-CustomJavaCode-gl2.java')
-rw-r--r--make/config/jogl/glu-CustomJavaCode-gl2.java29
1 files changed, 10 insertions, 19 deletions
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java
index 690e0acfa..4dcb5691e 100644
--- a/make/config/jogl/glu-CustomJavaCode-gl2.java
+++ b/make/config/jogl/glu-CustomJavaCode-gl2.java
@@ -218,13 +218,13 @@ private final ByteBuffer copyToByteBuffer(Buffer buf) {
if (buf.position() == 0) {
return (ByteBuffer) buf;
}
- return InternalBufferUtil.copyByteBuffer((ByteBuffer) buf);
+ return Buffers.copyByteBuffer((ByteBuffer) buf);
} else if (buf instanceof ShortBuffer) {
- return InternalBufferUtil.copyShortBufferAsByteBuffer((ShortBuffer) buf);
+ return Buffers.copyShortBufferAsByteBuffer((ShortBuffer) buf);
} else if (buf instanceof IntBuffer) {
- return InternalBufferUtil.copyIntBufferAsByteBuffer((IntBuffer) buf);
+ return Buffers.copyIntBufferAsByteBuffer((IntBuffer) buf);
} else if (buf instanceof FloatBuffer) {
- return InternalBufferUtil.copyFloatBufferAsByteBuffer((FloatBuffer) buf);
+ return Buffers.copyFloatBufferAsByteBuffer((FloatBuffer) buf);
} else {
throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)");
}
@@ -239,11 +239,11 @@ private final int gluScaleImageJava( int format, int widthin, int heightin,
if( dataout instanceof ByteBuffer ) {
out = (ByteBuffer)dataout;
} else if( dataout instanceof ShortBuffer ) {
- out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_SHORT);
+ out = Buffers.newDirectByteBuffer(dataout.remaining() * Buffers.SIZEOF_SHORT);
} else if ( dataout instanceof IntBuffer ) {
- out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_INT);
+ out = Buffers.newDirectByteBuffer(dataout.remaining() * Buffers.SIZEOF_INT);
} else if ( dataout instanceof FloatBuffer ) {
- out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_FLOAT);
+ out = Buffers.newDirectByteBuffer(dataout.remaining() * Buffers.SIZEOF_FLOAT);
} else {
throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)");
}
@@ -536,27 +536,18 @@ public final void gluEndCurve(GLUnurbs r) {
//
private static GLUgl2ProcAddressTable gluProcAddressTable;
-private static volatile boolean gluLibraryLoaded;
private static final GLUgl2ProcAddressTable getGLUProcAddressTable() {
- if (!gluLibraryLoaded) {
- loadGLULibrary();
- }
if (gluProcAddressTable == null) {
GLContext curContext = GLContext.getCurrent();
if (curContext == null) {
throw new GLException("No OpenGL context current on this thread");
}
+ GLDynamicLookupHelper glLookupHelper = ((GLDrawableImpl) curContext.getGLDrawable()).getGLDynamicLookupHelper();
+ glLookupHelper.loadGLULibrary();
GLUgl2ProcAddressTable tmp = new GLUgl2ProcAddressTable(new GLProcAddressResolver());
- tmp.reset(((GLDrawableImpl)curContext.getGLDrawable()).getDynamicLookupHelper());
+ tmp.reset(glLookupHelper);
gluProcAddressTable = tmp;
}
return gluProcAddressTable;
}
-
-private static final synchronized void loadGLULibrary() {
- if (!gluLibraryLoaded) {
- GLDrawableFactoryImpl.getFactoryImpl(null).loadGLULibrary();
- gluLibraryLoaded = true;
- }
-}