Mali GPU User Interface Engine Application Development Guide
Mali GPU User Interface Engine Application Development Guide
Mali GPU User Interface Engine Application Development Guide
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> ClassesrenderLbl = wg->createCustomLabel(this);renderLbl->build(NORMAL_FONT_SIZE, 16);renderLbl->setPosition(vec2i(10, 90));renderLbl->setColor(vec4(1.f, 1.f, 1.f, 1.f));renderLbl->setTextAlign(TEXT_ALIGN_LEFT | TEXT_ALIGN_TOP);renderLbl->setText("Rendermode");solidChk = wg->createRadioButton(this);solidChk->setText("Solid");solidChk->setPosition(vec2i(10, 115));wireframeChk = wg->createRadioButton(this);wireframeChk->setText("Wireframe");wireframeChk->setPosition(vec2i(10, 140));renderMode = new RadioButtonGroup();renderMode->add(solidChk);renderMode->add(wireframeChk);exitButton = wg->createExitButton(this);exitButton->setPosition(MDE::vec2i(130, 150));solidChk->check();gl20Chk->check();}setPosition(MDE::vec2i(0, 0));setSize(MDE::vec2i(800, 480));void LightShow::onValueChanged(Widget* w) {useWireframe = wireframeChk->isChecked();styggShader = gl11Chk->isChecked();}5.4.6 Modified draw loopThe code in the original draw loop is moved to a draw() method.The FPS calculation has been removed. See Example 5-25:Example 5-25 Modified draw functionality in lightshow.cppvoid LightShow::draw() {Context* context = get<strong>Application</strong>()->getContext();float deltat = getTime() * 0.3f - time;time = getTime() * 0.3f;glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);float scenetime = time;while (scenetime > 10)scenetime -= 10;MDE::Program* prg;if (styggShader)prg = prg_gl1;elseprg = prg_gl2;ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-30ID070710Non-Confidential - Draft - Beta