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 the Lotion <strong>User</strong> <strong>Interface</strong> Classesstatic float lastFpsTime = 0.0f;static int frameCount = 0;float fpsTime = time - lastFpsTime;if (fpsTime > 1.0f) {fps = float(frameCount) / fpsTime;lastFpsTime = time;frameCount = 0;static float accFps = 0.0f;static float accFpsCount = 0.0f;accFps += fps;accFpsCount += 1.0;float averageFps = accFps / accFpsCount;}printf("Time: %.2f\tFPS: %.2f (%.2f ms)\tAverage FPS: %.2f (%.2f ms)\n",time, fps, 1000.0f / fps, averageFps, 1000.0f / averageFps);frameCount++;for (int i = 0; i < mtDevices.getSize(); i++){mtDevices[i]->update();while (mtDevices[i]->hasNextEvent()){MultiTouch::Event e = mtDevices[i]->getNextEvent();if (calibratingDevice == 0){if (mtDevices[i]->needsCalibration()){calibratingDevice = mtDevices[i];currentTheme->runCalibration();}}#ifdef DRAW_INPUT_POSITIONinputPosition = e.position;#endif}}if (currentTheme)currentTheme->touchEvent(e);if (!nativeResolution){glViewport(0, 0, resolution.x, resolution.y);}glClearColor(0, 0, 0, 0);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);glDisable(GL_CULL_FACE);if (!nativeResolution){resetViewport();}render<strong>Engine</strong>->setTime(time);ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-22ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!