Mali GPU User Interface Engine Application Development Guide
Mali GPU User Interface Engine Application Development Guide
Mali GPU User Interface Engine Application Development Guide
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...0.5f, 0.5f, -0.5f, 1.0f, 1.0f,// LEFT-0.5f, -0.5f, 0.5f, 0.0f, 0.0f,-0.5f, 0.5f, 0.5f, 1.0f, 0.0f,-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,-0.5f, 0.5f, -0.5f, 1.0f, 1.0f,// RIGHT0.5f, -0.5f, -0.5f, 0.0f, 0.0f,0.5f, 0.5f, -0.5f, 1.0f, 0.0f,0.5f, -0.5f, 0.5f, 0.0f, 1.0f,0.5f, 0.5f, 0.5f, 1.0f, 1.0f,// TOP-0.5f, 0.5f, 0.5f, 0.0f, 0.0f,0.5f, 0.5f, 0.5f, 1.0f, 0.0f,-0.5f, 0.5f, -0.5f, 0.0f, 1.0f,0.5f, 0.5f, -0.5f, 1.0f, 1.0f,// BOTTOM-0.5f, -0.5f, 0.5f, 0.0f, 0.0f,-0.5f, -0.5f, -0.5f, 1.0f, 0.0f,0.5f, -0.5f, 0.5f, 0.0f, 1.0f,0.5f, -0.5f, -0.5f, 1.0f, 1.0f,}4. Example 4-10 shows the buffer assignments:Example 4-10 Buffer assignments for the textured cube...Managed vertexBuffer =context->createBuffer(GL_ARRAY_BUFFER, sizeof(vertexData), sizeof(GLfloat)*5);vertexBuffer->setData(0, sizeof(vertexData), vertexData);context->setVertexBuffer(0, vertexBuffer);VertexElement elements[2];elements[0].components = 3;elements[0].offset = 0;elements[0].semantic = POSITION;elements[0].stream = 0;elements[0].type = GL_FLOAT;elements[1].components = 2;elements[1].offset = 3*sizeof(GLfloat);elements[1].semantic = TEXCOORD0;elements[1].stream = 0;elements[1].type = GL_FLOAT;Managed vertexDeclaration =context->createVertexDeclaration(elements, 2);context->setVertexDeclaration(vertexDeclaration);...5. Example 4-11 shows the camera, projection, view, and world setup:Example 4-11 Camera and view setup...// The camera position, target and up vector for use when creating the view matrixfloat cameraAngle = 45.0f;ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 4-9ID070710Non-Confidential - Draft - Beta