Package java.nio

Examples of java.nio.ShortBuffer.position()


    }

    protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) {
        int nDotProduct = 0;
        ShortBuffer a = ShortBuffer.wrap(pA);
        a.position(indexA);
        ShortBuffer b = ShortBuffer.wrap(pB);
        b.position(indexB);
        for (int i = 0; i < 40; i++) {
            nDotProduct += a.get() * b.get() +
                    a.get() * b.get() +
View Full Code Here


    protected int CalculateDotProductNoMMX(short[] pA, int indexA, short[] pB, int indexB) {
        int nDotProduct = 0;
        ShortBuffer a = ShortBuffer.wrap(pA);
        a.position(indexA);
        ShortBuffer b = ShortBuffer.wrap(pB);
        b.position(indexB);
        for (int i = 0; i < 40; i++) {
            nDotProduct += a.get() * b.get() +
                    a.get() * b.get() +
                    a.get() * b.get() +
                    a.get() * b.get() +
View Full Code Here

      float[] histogram = calcHist();
      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) {
      Util.log("updateDepth(): " + e.getLocalizedMessage(), this);
View Full Code Here

        GL15.glGenBuffers(terrainIndexVBOBuffer);
        terrainIndexVBO = terrainIndexVBOBuffer.get(0);
               
        ShortBuffer terrainIndicesDataBuffer =  ByteBuffer.allocateDirect(terrainIndices.length*4).order(ByteOrder.nativeOrder()).asShortBuffer();
        terrainIndicesDataBuffer.put(terrainIndices);
        terrainIndicesDataBuffer.position(0);       
        GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, terrainIndexVBO);
        GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, terrainIndicesDataBuffer, GL15.GL_STATIC_DRAW);
     
     
    }
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, GL20.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, GL20.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, GL20.GL_UNSIGNED_SHORT, buffer);
        buffer.position(oldPosition);
        buffer.limit(oldLimit);
      } else {
        Gdx.gl20.glDrawArrays(primitiveType, offset, count);
      }
    } else {
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.