Package java.nio

Examples of java.nio.IntBuffer.position()


    CharBuffer cBuffer = buffer.asCharBuffer();
    cBuffer.position(1);
    System.out.println(Memory.getPosition(cBuffer));
   
    IntBuffer iBuffer = buffer.asIntBuffer();
    iBuffer.position(1);
    System.out.println(Memory.getPosition(iBuffer));
   
    FloatBuffer fBuffer = buffer.asFloatBuffer();
    fBuffer.position(1);
    System.out.println(Memory.getPosition(fBuffer));
View Full Code Here


    if (dst instanceof ByteBuffer)
      buffer = ((ByteBuffer)dst).asIntBuffer();
    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
    buffer.limit(oldPosition + numElements);
  }
View Full Code Here

    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
    buffer.limit(oldPosition + numElements);
  }

  /** Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The {@link Buffer} instance's
   * {@link Buffer#position()} is used to define the offset into the Buffer itself. The position will stay the same, the limit
View Full Code Here

    if (dst instanceof ByteBuffer)
      buffer = ((ByteBuffer)dst).asIntBuffer();
    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
  }

  /** Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The {@link Buffer} instance's
View Full Code Here

    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
  }

  /** Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The {@link Buffer} instance's
   * {@link Buffer#position()} is used to define the offset into the Buffer itself. The position and limit will stay the same.
   * <b>The Buffer must be a direct Buffer with native byte order. No error checking is performed</b>.
View Full Code Here

    if (dst instanceof ByteBuffer)
      buffer = ((ByteBuffer)dst).asIntBuffer();
    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
    buffer.limit(oldPosition + numElements);
  }
View Full Code Here

    else if (dst instanceof IntBuffer) buffer = (IntBuffer)dst;
    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
    buffer.limit(oldPosition + numElements);
  }

  /** Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The {@link Buffer} instance's
   * {@link Buffer#position()} is used to define the offset into the Buffer itself. The position will stay the same, the limit
View Full Code Here

        int width = texture.getWidth();
        int height = texture.getHeight();

        heightmap = new float[width][height];
        while (intBuf.position() < intBuf.limit()) {
            int pos = intBuf.position();
            int val = intBuf.get();
            heightmap[pos % width][pos / width] = val / (256 * 256 * 256 * 12.8f);
        }

View Full Code Here

        int width = texture.getWidth();
        int height = texture.getHeight();

        heightmap = new float[width][height];
        while (intBuf.position() < intBuf.limit()) {
            int pos = intBuf.position();
            int val = intBuf.get();
            heightmap[pos % width][pos / width] = val / (256 * 256 * 256 * 12.8f);
        }

        heightmap = shiftArray(rotateArray(heightmap), -50, -100);
View Full Code Here

       
       
        IntBuffer terrainVBOBuffer = ByteBuffer
              .allocateDirect(1*4).order(ByteOrder.nativeOrder()).asIntBuffer();
        terrainVBOBuffer.position(0);
        GL15.glGenBuffers(terrainVBOBuffer);
        terrainVBO = terrainVBOBuffer.get(0);
       
        byte[] verticesData = ColorVertex.toBytes(terrainVertices);
        ByteBuffer dataBuffer = ByteBuffer.allocateDirect(verticesData.length).order(ByteOrder.nativeOrder());
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.