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> Classes// used by main.cpp to set up the multitouch deviceMDE::System* <strong>Application</strong>::getSystem(){return system;}5. The run() function performs initialization. See Example 5-18:Example 5-18 <strong>Application</strong> run methods// called from run() if not using native resolutionvoid <strong>Application</strong>::resetViewport(){glViewport(viewport.x, viewport.y, viewport.z, viewport.w);}// called from run() if not using native resolutionvoid <strong>Application</strong>::setResolution(MDE::vec2i resolution){this->resolution = resolution;nativeResolution = resolution.x == WINDOW_WIDTH && resolution.y == WINDOW_HEIGHT;}viewport.x = 0;viewport.y = resolution.y - WINDOW_HEIGHT;viewport.z = WINDOW_WIDTH;viewport.w = WINDOW_HEIGHT;void <strong>Application</strong>::runApplet(Applet* applet) {currentTheme->runApplet(applet);}// main.cpp calls app->run()void <strong>Application</strong>::run() {#ifdef DRAW_INPUT_POSITIONprintf("creating mouse pointer\n");if (!currentTheme){throw MDE::Exception("<strong>Application</strong>::run: currentTheme not set");}WidgetGroup* wg = currentTheme->createWidgetGroup(currentTheme, "input_pointer");Widgets::Image* inputPointerWidget = wg->createImage(0);inputPointerWidget->setImage(inputPointerWidget->getBitmap2DAsset("themes/blue/widgets/mouse_widget.png"));inputPointerWidget->setSize(MDE::vec2i(32, 32));wg->build();MDE::vec2i inputPosition;#endiftimer->reset();while (context->update()){//printf("mainloop\n");float time = timer->getTime();float fps = 0.0f;ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-21ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!