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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tutorial on Drawing 3D Shapes// Check for ambient attributeAttribute* ambient = b.material->getAttribute("ambient");if(ambient){float values[4];ambient->getValue(time, values);context->setUniform("MATERIAL_AMBIENT", 4, 1, values);}// Check for specular attributeAttribute* specular = b.material->getAttribute("specular");if(specular){float values[4];specular->getValue(time, values);context->setUniform("MATERIAL_SPECULAR", 4, 1, values);}// Check for shininess attributeAttribute* shininess = b.material->getAttribute("shininess");if(shininess){float value;shininess->getValue(time, &value);context->setUniform("MATERIAL_SHININESS", value);}}if (b.geometry){// draw the geometryb.geometry->draw();}}}// continue traversal over the child nodestraverse(node->getFirstChild(), context, prjViw, world, time);}...2. Example 4-53 shows the initialization and loading of the asset files:Example 4-53 Creating the context and loading the scene assets...int main(){try{Managed system = create_system_backend();Managed filesystem = system->createFileSystem("data/");Managed context = system->createContext(320, 240);#ifdef MDE_OS_PC_LINUXManaged keyboard = system->createKeyboard(context);#elseManaged keyboard = system->createKeyboard();#endifManaged timer = system->createTimer();Proxy proxy(filesystem, context);ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 4-42ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!