13.07.2015 Views

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Tutorial on Drawing 3D Shapes...}}7. The projection has been calculated based on the keyboard input and can be redrawn. SeeExample 4-6.Example 4-6 Redrawing the hello_world view...// Recalculate modelviewprojection matrix in case it has been altered (rotation)wvpMatrix = proj * view * world;context->setUniformMatrix("WORLD_VIEW_PROJECTION", wvpMatrix);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);}// Draw the objectcontext->drawArrays(GL_TRIANGLE_STRIP, 0, 2);context->drawArrays(GL_TRIANGLE_STRIP, 4, 2);context->drawArrays(GL_TRIANGLE_STRIP, 8, 2);context->drawArrays(GL_TRIANGLE_STRIP, 12, 2);context->drawArrays(GL_TRIANGLE_STRIP, 16, 2);context->drawArrays(GL_TRIANGLE_STRIP, 20, 2);}while ( context->update() );}catch (Exception &e){printf(e.getMessage().getCharString());}8. Rebuild the project and run it. Figure 4-1 shows the shape:9. Press the left or right arrows and observe that the object rotates.Figure 4-1 The Hello World shape10. Press and hold the spacebar while pressing the left or right arrows and observe that thecamera position changes.ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 4-5ID070710Non-Confidential - Draft - Beta

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!