Package java.nio

Examples of java.nio.FloatBuffer.flip()


    FloatBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.clear();
    int saved_position = buffer.position();
    direct_buffer.put(buffer);
    buffer.position(saved_position);
    direct_buffer.flip();
    return direct_buffer;
  }

  private static IntBuffer lookupBuffer(IntBuffer buffer) {
    CachedBuffers buffers = getCachedBuffers(buffer.remaining()*4);
 
View Full Code Here


    FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});

    pos.flip();
    red.flip();
    green.flip();
    blue.flip();

    glLight(GL_LIGHT0, GL_POSITION, pos);
    glEnable(GL_CULL_FACE);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
View Full Code Here

    } else {
      // --- using extensions
      final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
                                                                                  new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
                                                                                      0, 0, 1, 0, 0, 0, 0, 1});
      identityTranspose.flip();
      glLoadTransposeMatrixARB(identityTranspose);
    }

    float h = (float) 300 / (float) 300;
    glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
View Full Code Here

    FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
    FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
    pos.flip();
    red.flip();
    green.flip();
    blue.flip();

    glLight(GL_LIGHT0, GL_POSITION, pos);
    glEnable(GL_CULL_FACE);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
View Full Code Here

    } else {
      // --- using extensions
      final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
                                                                                  new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
                                                                                      0, 0, 1, 0, 0, 0, 0, 1});
      identityTranspose.flip();
      glLoadTransposeMatrixARB(identityTranspose);
    }

    float h = (float) 300 / (float) 300;
    glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
View Full Code Here

   * @param array to hold
   * @return created FloatBuffer
   */
  protected FloatBuffer createFloatBuffer(float[] data) {
    FloatBuffer temp = BufferUtils.createFloatBuffer(data.length).put(data);
    temp.flip();
    return temp;
  }

  /**
   * Pauses the invoking thread for specified milliseconds
View Full Code Here

      FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
      FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
      pos.flip();
      red.flip();
      green.flip();
      blue.flip();

      glClearColor(0, 0, 0, 1f);

      glLight(GL_LIGHT0, GL_POSITION, pos);
      glEnable(GL_CULL_FACE);
View Full Code Here

      } else {
        // --- using extensions
        final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
                                                                                    new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
                                                                                        0, 0, 1, 0, 0, 0, 0, 1});
        identityTranspose.flip();
        glLoadTransposeMatrixARB(identityTranspose);
      }

      float h = (float) 300 / (float) 300;
      glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
View Full Code Here

    FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
    FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
    pos.flip();
    red.flip();
    green.flip();
    blue.flip();

    glLight(GL_LIGHT0, GL_POSITION, pos);
    glEnable(GL_CULL_FACE);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
View Full Code Here

    } else {
      // --- using extensions
      final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
                                                                                  new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
                                                                                      0, 0, 1, 0, 0, 0, 0, 1});
      identityTranspose.flip();
      glLoadTransposeMatrixARB(identityTranspose);
    }

    float h = (float) 300 / (float) 300;
    glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
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.