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> Classes5.4 Modifications to lightshow.cppThis section describes the modifications required to convert the standalone lightshowapplication to an applet that runs in the lotion interface:• New lightshow.h file• Modified startup code in lightshow.cpp on page 5-26• Changes to traverseDraw() on page 5-27• Utility functions for lighting on page 5-28• Widget initialization and event handling on page 5-29• Modified draw loop on page 5-30.The standalone version of the application is described in Lightshow animation with movingsprite and camera on page 4-47.5.4.1 New lightshow.h fileA new lightshow.h file is required because the lightshow applet is used by the lotion main.cppcode. Example 5-19 lists the new header file:Example 5-19 New lightshow.h code#ifndef __LIGHTSHOW_APPLET_H__#define __LIGHTSHOW_APPLET_H__#include "../../lotion.h"#include "../../applet.h"#include "../../application.h"#include "../../theme.h"namespace Lotion // was namespace MDE in the original lightshow app{namespace Applets{// lightshow is now an applet classclass LightShow: public Applet{MDE::Buffer* flareTexcoord; // this was in the original lightshow appGLint flareTexcoordsLoc; // this was in the original lightshow appbool useWireframe;bool styggShader;int lightCount;MDE::SceneAsset* scene;MDE::Program* flarePrg;MDE::Program* prg_gl2;MDE::Program* prg_gl1;MDE::NodeAsset* camNode;MDE::NodeAsset* targetNode;MDE::NodeAsset* light0Node;MDE::NodeAsset* light1Node;MDE::Texture* flareTex;// references to functions that were in the original appvoid prepareFlares(MDE::Context* context, MDE::Program* p);void drawFlare(MDE::Context* context, MDE::vec3 position,MDE::vec3 color, float size);ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-24ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!