Examples of GL20


Examples of net.rim.device.api.opengles.GL20

    /**
     * @see net.rim.device.api.opengles.GLField#render(GL)
     */
    protected void render(final GL g) {
        final GL20 gl = (GL20) g;

        if (_sizeChanged) {
            sizeChanged(gl, getWidth(), getHeight());
            _sizeChanged = false;
        }

        gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

        gl.glUseProgram(_program);

        // Transform the cube
        _matrix.setIdentity();
        _matrix.translate(0.0f, 0.0f, -3.5f);
        _matrix.rotate(_rotationAxis, _rotation.getFloat());

        // There are no matrix modes in GL20.
        // Multiply the model-view matrix with the projection
        // matrix and pass it to the shader program.
        Matrix4f.multiply(_projection, _matrix, _matrix);
        gl.glUniformMatrix4fv(_matrixLoc, 1, false, _matrix.getArray(), 0);

        // Set the attribute location of the position, normal and texture
        // coordinates
        _cube.enableVertexAttrib(_positionLoc);
        _cube.enableTexcoordAttrib(_texCoordLoc);
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.