Package java.nio

Examples of java.nio.FloatBuffer.flip()


          glDeleteBuffers(tfVBO[i]);
      }

      final FloatBuffer state = BufferUtils.createFloatBuffer(count * 4);
      state.put(transform);
      state.flip();

      for ( int i = 0; i < tfVBO.length; i++ ) {
        tfVBO[i] = glGenBuffers();
        glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, tfVBO[i]);
        glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, state, GL_STATIC_DRAW);
View Full Code Here


        transform.put((int)(random.nextFloat() * (SCREEN_WIDTH - ballSize)) + ballSize * 0.5f);
        transform.put((int)(random.nextFloat() * (SCREEN_HEIGHT - ballSize)) + ballSize * 0.5f);
        transform.put(random.nextFloat() * 0.4f - 0.2f);
        transform.put(random.nextFloat() * 0.4f - 0.2f);
      }
      transform.flip();

      if ( animVBO != 0 ) {
        clReleaseMemObject(clTransform);
        glDeleteBuffers(animVBO);
      }
View Full Code Here

    matSpecular.flip();
    matOcean.flip();
    lightPosition.flip();
    whiteLight.flip();
    sunLight.flip();
    lModelAmbient.flip();
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glMaterial(GL_FRONT, GL_SPECULAR, matSpecular);
    glMaterialf(GL_FRONT, GL_SHININESS, 10.0f);
    glLight(GL_LIGHT0, GL_POSITION, lightPosition);
View Full Code Here

      }
    }
    posBuffer.flip();
    texcBuffer.flip();
    norBuffer.flip();
    idBuffer.flip();
   
    temporaryBuffer.put(posBuffer);
    temporaryBuffer.put(texcBuffer);
    temporaryBuffer.put(norBuffer);
    temporaryBuffer.put(idBuffer);
View Full Code Here

    FloatBuffer temporaryBuffer = BufferUtils.createFloatBuffer(data.size());
   
    for(int i=0;i<data.size();i++)
      temporaryBuffer.put(data.get(i));
   
    temporaryBuffer.flip();
   
    return this.create(temporaryBuffer, stride, usage, saveVBO);
  }
 
  /**
 
View Full Code Here

            new float[] { 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f });
        FloatBuffer listenerVel = BufferUtils.createFloatBuffer(3).put(
            new float[] { 0.0f, 0.0f, 0.0f });
        FloatBuffer listenerPos = BufferUtils.createFloatBuffer(3).put(
            new float[] { 0.0f, 0.0f, 0.0f });
        listenerPos.flip();
        listenerVel.flip();
        listenerOri.flip();
        AL10.alListener(AL10.AL_POSITION, listenerPos);
        AL10.alListener(AL10.AL_VELOCITY, listenerVel);
        AL10.alListener(AL10.AL_ORIENTATION, listenerOri);
View Full Code Here

            float cosinus = (float) Math.cos(i * 2.0 * Math.PI / resolutionFaces);
            float sinus = (float) Math.sin(i * 2.0 * Math.PI / resolutionFaces);
            vtx.put(radius * cosinus);
            vtx.put(radius * sinus);
        }
        return (FloatBuffer) vtx.flip();
    }

    /**
     *
     * @param keepBinding
View Full Code Here

  public static void main(String[] args) {
    try { PServer v = null; //new PServer(4444);
    ByteBuffer b = ByteBuffer.allocate(20);
    FloatBuffer fb = b.asFloatBuffer();
    fb.put(0.1f); fb.flip();
    System.out.println(fb.position() + "=fpos   bpos=" + b.position());
    Thread t = new Thread(v);
    t.start();
    try {Thread.sleep(100); } catch (Exception e ) {}
    PServerClient psc = new PServerClient("localhost",4444);
View Full Code Here

  }

  public CompressedFloatsIndexedSupplier toCompressedFloatsIndexedSupplier()
  {
    final FloatBuffer endBufCopy = endBuffer.asReadOnlyBuffer();
    endBufCopy.flip();
   
    return new CompressedFloatsIndexedSupplier(
        numInserted,
        sizePer,
        GenericIndexed.fromIterable(
View Full Code Here

      textureArray[i] = f != null ? f : Float.NaN;
    }

    textures = BufferUtils.createFloatBuffer(textureArray.length);
    textures.put(textureArray);
    textures.flip();

    float[] colorArray = new float[colorList.size()];

    for (int i = 0; i < colorList.size(); i++) {
      Float f = colorList.get(i);
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.