Package java.nio

Examples of java.nio.FloatBuffer.flip()


      buffer.put(vertices[i].GetTangent().GetX());
      buffer.put(vertices[i].GetTangent().GetY());
      buffer.put(vertices[i].GetTangent().GetZ());
    }
   
    buffer.flip();
   
    return buffer;
  }
 
  public static FloatBuffer CreateFlippedBuffer(Matrix4f value)
View Full Code Here


   
    for(int i = 0; i < 4; i++)
      for(int j = 0; j < 4; j++)
        buffer.put(value.Get(i, j));
   
    buffer.flip();
   
    return buffer;
  }
 
  public static String[] RemoveEmptyStrings(String[] data)
View Full Code Here

        perspectiveMatrix[14] = (2 * zFar * zNear) / (zNear - zFar);
        perspectiveMatrix[11] = -1.0f;

        FloatBuffer perspectiveMatrixBuffer = BufferUtils.createFloatBuffer( perspectiveMatrix.length );
        perspectiveMatrixBuffer.put( perspectiveMatrix );
        perspectiveMatrixBuffer.flip();

        glUseProgram( theProgram );
        glUniformMatrix4( perspectiveMatrixUnif, false, perspectiveMatrixBuffer );
        glUseProgram( 0 );
    }
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexDataBuffer = BufferUtils.createFloatBuffer( vertexData.length );
        vertexDataBuffer.put( vertexData );
        vertexDataBuffer.flip();

        vertexBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, vertexBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here

        perspectiveMatrix[0] = frustumScale * (h / (float) w);
        perspectiveMatrix[5] = frustumScale;

        FloatBuffer perspectiveMatrixBuffer = BufferUtils.createFloatBuffer( perspectiveMatrix.length );
        perspectiveMatrixBuffer.put( perspectiveMatrix );
        perspectiveMatrixBuffer.flip();

        glUseProgram( theProgram );
        glUniformMatrix4( perspectiveMatrixUnif, false, perspectiveMatrixBuffer );
        glUseProgram( 0 );

View Full Code Here

        perspectiveMatrix[14] = (2 * zFar * zNear) / (zNear - zFar);
        perspectiveMatrix[11] = -1.0f;

        FloatBuffer perspectiveMatrixBuffer = BufferUtils.createFloatBuffer( perspectiveMatrix.length );
        perspectiveMatrixBuffer.put( perspectiveMatrix );
        perspectiveMatrixBuffer.flip();

        glUseProgram( theProgram );
        glUniformMatrix4( perspectiveMatrixUnif, false, perspectiveMatrixBuffer );
        glUseProgram( 0 );
    }
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexDataBuffer = BufferUtils.createFloatBuffer( vertexData.length );
        vertexDataBuffer.put( vertexData );
        vertexDataBuffer.flip();

        vertexBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, vertexBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here

        perspectiveMatrix[0] = frustumScale * (h / (float) w);
        perspectiveMatrix[5] = frustumScale;

        FloatBuffer perspectiveMatrixBuffer = BufferUtils.createFloatBuffer( perspectiveMatrix.length );
        perspectiveMatrixBuffer.put( perspectiveMatrix );
        perspectiveMatrixBuffer.flip();

        glUseProgram( theProgram );
        glUniformMatrix4( perspectiveMatrixUnif, false, perspectiveMatrixBuffer );
        glUseProgram( 0 );

View Full Code Here

        perspectiveMatrix[14] = (2 * zFar * zNear) / (zNear - zFar);
        perspectiveMatrix[11] = -1.0f;

        FloatBuffer perspectiveMatrixBuffer = BufferUtils.createFloatBuffer( perspectiveMatrix.length );
        perspectiveMatrixBuffer.put( perspectiveMatrix );
        perspectiveMatrixBuffer.flip();

        glUseProgram( theProgram );
        glUniformMatrix4( perspectiveMatrixUnif, false, perspectiveMatrixBuffer );
        glUseProgram( 0 );
    }
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexDataBuffer = BufferUtils.createFloatBuffer( vertexData.length );
        vertexDataBuffer.put( vertexData );
        vertexDataBuffer.flip();

        vertexBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, vertexBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
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.