Package java.nio

Examples of java.nio.FloatBuffer.flip()


        for ( float f : color ) {
            colorBuffer.put( f );
        }

        colorBuffer.flip();

        glSamplerParameter( samplers[1], GL_TEXTURE_BORDER_COLOR, colorBuffer );
    }

View Full Code Here


                for ( VertexData vertexData : posSizeArray ) {
                    vertexData.fillBuffer( vertexDataBuffer );
                }

                vertexDataBuffer.flip();

                glBufferData( GL_ARRAY_BUFFER, vertexDataBuffer, GL_STREAM_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

            for ( int i = 0; i < ubArray.size(); i++ ) {
                ubArray.get( i ).fillBuffer( ubArrayBuffer );
            }

            ubArrayBuffer.flip();

            glBufferData( GL_UNIFORM_BUFFER, ubArrayBuffer, GL_STATIC_DRAW );
        }

        glBindBuffer( GL_UNIFORM_BUFFER, materialTerrainUniformBuffer );
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

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.