Package java.nio

Examples of java.nio.ShortBuffer.position()


    if (isVertexArray) {
      if (indices.getNumIndices() > 0) {
        ShortBuffer buffer = indices.getBuffer();
        int oldPosition = buffer.position();
        int oldLimit = buffer.limit();
        buffer.position(offset);
        buffer.limit(offset + count);
        Gdx.gl10.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else
View Full Code Here


        int oldPosition = buffer.position();
        int oldLimit = buffer.limit();
        buffer.position(offset);
        buffer.limit(offset + count);
        Gdx.gl10.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else
        Gdx.gl10.glDrawArrays(primitiveType, offset, count);
    } else {
      if (indices.getNumIndices() > 0)
View Full Code Here

    if (autoBind) bind(shader);

    if (isVertexArray) {
      if (indices.getNumIndices() > 0) {
        ShortBuffer buffer = indices.getBuffer();
        int oldPosition = buffer.position();
        int oldLimit = buffer.limit();
        buffer.position(offset);
        buffer.limit(offset + count);
        Gdx.gl20.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
View Full Code Here

    if (isVertexArray) {
      if (indices.getNumIndices() > 0) {
        ShortBuffer buffer = indices.getBuffer();
        int oldPosition = buffer.position();
        int oldLimit = buffer.limit();
        buffer.position(offset);
        buffer.limit(offset + count);
        Gdx.gl20.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else {
View Full Code Here

        int oldPosition = buffer.position();
        int oldLimit = buffer.limit();
        buffer.position(offset);
        buffer.limit(offset + count);
        Gdx.gl20.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else {
        Gdx.gl20.glDrawArrays(primitiveType, offset, count);
      }
    } else {
View Full Code Here

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

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

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

    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

            ShortBuffer depth = depthMD.getData().createShortBuffer();
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
                imgbytes[pos] = (byte)histogram[pixel];
            }
        } catch (GeneralException e) {
            e.printStackTrace();
View Full Code Here

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

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

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

    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

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.