aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/glu
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/glu')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java35
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java10
3 files changed, 25 insertions, 26 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java
index 501f5f585..42f55f982 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java
@@ -48,7 +48,7 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import com.jogamp.opengl.impl.Debug;
-import com.jogamp.opengl.impl.InternalBufferUtil;
+import com.jogamp.common.nio.Buffers;
import java.nio.*;
import java.io.*;
@@ -89,8 +89,8 @@ public class BuildMipmap {
Mipmap.retrieveStoreModes( gl, psm );
try {
- newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, 1, format,
- GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
+ GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -117,7 +117,7 @@ public class BuildMipmap {
if( otherImage == null ) {
memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
try {
- otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer();
+ otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
@@ -178,8 +178,8 @@ public class BuildMipmap {
}
try {
- newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, height,
- format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
+ format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -206,7 +206,7 @@ public class BuildMipmap {
if( otherImage == null ) {
memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
try {
- otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer();
+ otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
@@ -364,7 +364,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -481,7 +481,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -519,7 +519,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -653,7 +653,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -880,8 +880,7 @@ public class BuildMipmap {
int i, j;
try {
- newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size(
- width, height, format, GL2.GL_UNSIGNED_BYTE ) ));
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
} catch( OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -924,7 +923,7 @@ public class BuildMipmap {
if( otherImage == null ) {
memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
try {
- otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ otherImage = Buffers.newDirectByteBuffer( memReq );
} catch( OutOfMemoryError err ) {
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
@@ -1102,7 +1101,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -1288,7 +1287,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -1329,7 +1328,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
@@ -1391,7 +1390,7 @@ public class BuildMipmap {
case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
- dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java
index 1c0707c57..4e3f6c298 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java
@@ -50,7 +50,7 @@ import javax.media.opengl.GL2GL3;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.GLException;
import java.nio.*;
-import com.jogamp.opengl.impl.InternalBufferUtil;
+import com.jogamp.common.nio.Buffers;
/**
*
@@ -575,8 +575,8 @@ public class Mipmap {
if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
- beforeimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) ));
- afterimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) ));
+ beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) );
+ afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) );
if( beforeimage == null || afterimage == null ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java
index f0bb7fb33..804845fe2 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java
@@ -48,7 +48,7 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import java.nio.*;
-import com.jogamp.opengl.impl.InternalBufferUtil;
+import com.jogamp.common.nio.Buffers;
/**
*
@@ -2425,10 +2425,10 @@ public class ScaleInternal {
}
try {
- beforeImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn,
- heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
- afterImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn,
- heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+ afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}