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 the Lotion <strong>User</strong> <strong>Interface</strong> ClassesExample 5-16 <strong>Application</strong> setup methods// called from main.cppvoid <strong>Application</strong>::setup(Theme* theme){system = MDE::create_system_backend();context = system->createContext(resolution.x, resolution.y);fileSystem = system->createFileSystem("data/");timer = system->createTimer();proxy = new MDE::Proxy(fileSystem, context);proxy->addPriorityLoader(new EtcTextureDemoLoader());proxy->addPriorityLoader(new EtcBitmapDemoLoader());render<strong>Engine</strong> = new Render<strong>Engine</strong>(proxy, MDE::vec2i(WINDOW_WIDTH, WINDOW_HEIGHT));}this->currentTheme = theme;printf("Creating theme...\n");if (currentTheme)currentTheme->create(this, 0, 0);printf("Theme created successfully\n");// called from main.cppvoid <strong>Application</strong>::addMultiTouchDevice(MultiTouch::Device* mtDevice){mtDevices.add(mtDevice);}4. The applets and themes use the access methods. See Example 5-17:Example 5-17 <strong>Application</strong> access methods// used in applet.cpp, robot.cpp and widget.cppRender<strong>Engine</strong>* <strong>Application</strong>::getRender<strong>Engine</strong>(){return render<strong>Engine</strong>;}// used in applet.cpp and blue.cppMDE::Proxy* <strong>Application</strong>::getProxy(){return this->proxy;}// used in applet.cpp and blue.cppfloat <strong>Application</strong>::getTime() {return timer->getTime();}// the widget getTheme() method returns the result of get<strong>Application</strong>->getTheme()Theme* <strong>Application</strong>::getTheme(){return currentTheme;}// used by main.cpp to set up the multitouch device and by the appletsMDE::Context* <strong>Application</strong>::getContext(){return context;}ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-20ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!