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 System Classes2.2 Creating a simple application with just the System and Keyboard classesThe following steps describe how to create a System and Keyboard interface:1. Open the main.cpp file from the 01 - Introduction to the System <strong>Interface</strong> project in theMDE Tutorial Examples folder.Example 2-1 shows how to create a System interface to use with the other librarycomponents:Example 2-1 Create a System object and a context#include #include int main(){MDE::Managed system = MDE::create_system_backend();#ifdef MDE_OS_PC_LINUXMDE::Context* context = system->createContext(320,240);#endif...The Managed template provides automatic lifetime checking and resource deletion. ARMrecommends that you always use it when creating library objects. If Managed is not used,there must be a corresponding call to release() for each object creation. For example:MDE::System* system = MDE::system_create_backend();...system->release();The createContext() parameters specify the width and height of the graphics window. Forthis example, the framebuffer is created but will not be used.2. Example 2-2 shows how to create a Keyboard interface:Example 2-2 Create a Keyboard object...#ifdef MDE_OS_PC_LINUXMDE::Keyboard* keyboard = system->createKeyboard(context);#elseMDE::Keyboard* keyboard = system->createKeyboard();#endif...NoteThere are minor difference in the creation of inputs between Windows and X11 platforms.Input devices are linked to specific contexts on X11 systems, for example, to a windowon the display that this input device is used with.3. Keyboard input sequences the program to the next stage. Example 2-3 on page 2-4 showshow to prompt the user to press the Esc key:ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 2-3ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!