Package java.nio

Examples of java.nio.ShortBuffer.limit()


        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)
        Gdx.gl11.glDrawElements(primitiveType, count, GL10.GL_UNSIGNED_SHORT, offset * 2);
 
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);
View Full Code Here

      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 {
        Gdx.gl20.glDrawArrays(primitiveType, offset, count);
View Full Code Here

        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 {
      if (indices.getNumIndices() > 0)
View Full Code Here

    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
   * will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is
View Full Code Here

    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
   * will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is
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, GL20.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
View Full Code Here

      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, GL20.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else {
        Gdx.gl20.glDrawArrays(primitiveType, offset, count);
View Full Code Here

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

      public void onAudioSamples(IAudioSamplesEvent event)
    {
      // get the raw audio byes and adjust it's value
     
      ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer();
      for (int i = 0; i < buffer.limit(); ++i)
        buffer.put(i, (short)(buffer.get(i) * mVolume));
     
      // call parent which will pass the audio onto next tool in chain

      super.onAudioSamples(event);
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.