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> Classes5.3 The application.cpp fileThe application.cpp file contains the code that implements the <strong>Application</strong> class:1. The application.h header file contains the <strong>Application</strong> class definition. SeeExample 5-15:Example 5-14 <strong>Application</strong> header fileclass <strong>Application</strong>{Theme* currentTheme;MDE::System* system;MDE::Context* context;MDE::FileSystem* fileSystem;MDE::Proxy* proxy;MDE::Timer* timer;MDE::Array mtDevices;MDE::vec2i resolution;Render<strong>Engine</strong>* render<strong>Engine</strong>;MultiTouch::Device* calibratingDevice;MDE::vec4i viewport;bool nativeResolution;};public:<strong>Application</strong>();Render<strong>Engine</strong>* getRender<strong>Engine</strong>();MDE::Context* getContext();MDE::System* getSystem();void setResolution(MDE::vec2i resolution);void addMultiTouchDevice(MultiTouch::Device* mtDevice);void setup(Theme* theme);void run();void runApplet(Applet* applet);MDE::Proxy* getProxy();Theme* getTheme();float getTime();void resetViewport();2. The constructor assigns values for the viewing area. See Example 5-15:Example 5-15 <strong>Application</strong> constructor<strong>Application</strong>::<strong>Application</strong>(){nativeResolution = true;viewport = MDE::vec4i(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);resolution = MDE::vec2i(WINDOW_WIDTH, WINDOW_HEIGHT);calibratingDevice = 0;}The constants WINDOW_HEIGHT and WINDOW_WIDTH are 480 and 8003. Initialization code in main.cpp calls the setup methods. See Example 5-16 on page 5-20:ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-19ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!