Package java.nio

Examples of java.nio.IntBuffer.capacity()


      // Convert from RGBA8888 to ARGB8888 and flip vertically
      IntBuffer pixelBuffer = pixmap.getPixels().asIntBuffer();
      int[] pixelsRGBA = new int[pixelBuffer.capacity()];
      pixelBuffer.get(pixelsRGBA);
      int[] pixelsARGBflipped = new int[pixelBuffer.capacity()];
      int pixel;
      if (pixelBuffer.order() == ByteOrder.BIG_ENDIAN) {
        for (int y = 0; y < pixmap.getHeight(); ++y) {
          for (int x = 0; x < pixmap.getWidth(); ++x) {
            pixel = pixelsRGBA[x + (y * pixmap.getWidth())];
 
View Full Code Here


    }
    public void testIntBufferArgument() {
        IntBuffer buf  = IntBuffer.allocate(1024);
        final int MAGIC = 0xABEDCF23;
        lib.fillInt32Buffer(buf, 1024, MAGIC);
        for (int i=0;i < buf.capacity();i++) {
            assertEquals("Bad value at index " + i, MAGIC, buf.get(i));
        }
    }
    public void testLongBufferArgument() {
        LongBuffer buf  = LongBuffer.allocate(1024);
View Full Code Here

    public void testDirectIntBufferArgument() {
        ByteBuffer buf  = ByteBuffer.allocateDirect(1024*4).order(ByteOrder.nativeOrder());
        IntBuffer intBuf = buf.asIntBuffer();
        final int MAGIC = 0xABEDCF23;
        lib.fillInt32Buffer(intBuf, 1024, MAGIC);
        for (int i=0;i < intBuf.capacity();i++) {
            assertEquals("Bad value at index " + i, MAGIC, intBuf.get(i));
        }
    }
   
    public void testDirectLongBufferArgument() {
View Full Code Here

        gl.glBindTexture(textureTarget, usedTextureID);
      }
     
      //DRAW with drawElements if geometry is indexed, else draw with drawArrays!
      if (geometryInfo.isIndexed()){
        gl.glDrawElements(fillDrawMode, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); //limit() oder capacity()??
      }else{
        gl.glDrawArrays(fillDrawMode, 0, vertBuff.capacity()/3);
      }
     
      if (textureDrawn){
View Full Code Here

      if (strokeWeight > 0)
        gl.glLineWidth(strokeWeight);
     
      //DRAW
      if (geometryInfo.isIndexed()){
        gl.glDrawElements(GL.GL_LINE_STRIP, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); ////indices.limit()?
      }else{
        gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertBuff.capacity()/3);
      }
     
//      if (drawSmooth)
View Full Code Here

        gl.glColorPointer(4, GL.GL_FLOAT, 0, colorBuff);
      }
     
      //DRAW with drawElements if geometry is indexed, else draw with drawArrays!
      if (this.getGeometryInfo().isIndexed()){
        gl.glDrawElements(this.getFillDrawMode(), indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); //limit() oder capacity()??

        /*
        int error = gl.glGetError();
        if (error != GL.GL_NO_ERROR){
          System.out.println("GL Error: " + error);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.