Package java.nio

Examples of java.nio.FloatBuffer.flip()



    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



    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


    private void initializeVertexBuffer() {
        FloatBuffer vertexPositionsBuffer = BufferUtils.createFloatBuffer( vertexPositions.length );
        vertexPositionsBuffer.put( vertexPositions );
        vertexPositionsBuffer.flip();

        positionBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, positionBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexPositionsBuffer, GL_STREAM_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexPositionsBuffer = BufferUtils.createFloatBuffer( vertexPositions.length );
        vertexPositionsBuffer.put( vertexPositions );
        vertexPositionsBuffer.flip();

        positionBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, positionBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexPositionsBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexPositionsBuffer = BufferUtils.createFloatBuffer( vertexPositions.length );
        vertexPositionsBuffer.put( vertexPositions );
        vertexPositionsBuffer.flip();

        positionBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, positionBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexPositionsBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here


    private void initializeVertexBuffer() {
        FloatBuffer vertexPositionsBuffer = BufferUtils.createFloatBuffer( vertexPositions.length );
        vertexPositionsBuffer.put( vertexPositions );
        vertexPositionsBuffer.flip();

        positionBufferObject = glGenBuffers();
        glBindBuffer( GL_ARRAY_BUFFER, positionBufferObject );
        glBufferData( GL_ARRAY_BUFFER, vertexPositionsBuffer, GL_STREAM_DRAW );
        glBindBuffer( GL_ARRAY_BUFFER, 0 );
View Full Code Here

            newData[vertex + 1] += yOffset;
        }

        FloatBuffer newDataBuffer = BufferUtils.createFloatBuffer( newData.length );
        newDataBuffer.put( newData );
        newDataBuffer.flip();

        glBindBuffer( GL_ARRAY_BUFFER, positionBufferObject );
        glBufferSubData( GL_ARRAY_BUFFER, 0, newDataBuffer );
        glBindBuffer( GL_ARRAY_BUFFER, 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

        for ( MaterialBlock materialBlock : materials ) {
            materialBlock.fillBuffer( materialsBuffer );
            materialsBuffer.put( padding );     // The buffer size must be sizeMaterialUniformBuffer
        }

        materialsBuffer.flip();

        materialUniformBuffer = glGenBuffers();
        glBindBuffer( GL_UNIFORM_BUFFER, materialUniformBuffer );
        glBufferData( GL_UNIFORM_BUFFER, materialsBuffer, GL_STATIC_DRAW );
        glBindBuffer( GL_UNIFORM_BUFFER, 0 );
View Full Code Here


    private void initializeVAO() {
        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.