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> Classesprintf("-input\n");printf(" mouse\n");printf(" touch \n");}static void argErrorExit(const char * fmt, const char * printfArg) {printHelp();errorExit(fmt, printfArg);}5.2.3 Evaluating the start-up argumentsThe first part of main() evaluates the passed arguments:1. Entering resolution on the command line specifies a new resolution to replace the defaultresolution. See Example 5-3:Example 5-3 Setting the resolutionint main(int argc, char* argv[]) {try {// Run from the directory containing the executable,// so that we can find the data wherever it is run fromcdToExecutable();// parse commandline args//bool configStandalone = false;int configApplets = 0;bool configAppletsAdded = false;themes configTheme = THEME_BLUE;MDE::Array configInputs;MDE::vec2i configResolution(800, 480);unsigned int configDepth = 0; // Use platform default config depth.for (int i = 1; i < argc; i++) {if (strcmp(argv[i], "-resolution") == 0) {if (i + 1 == argc) {argErrorExit("No argument specified for -resolution switch",NULL);} else if (sscanf(argv[i + 1],"%dx%d", &configResolution.x,&configResolution.y) != 2) {argErrorExit("Invalid -resolution: %s\n", argv[i + 1]);}...i++;} else if (strcmp(argv[i], "-depth") == 0) {2. Entering depth on the command line specifies the bits per pixel. See Example 5-4 onpage 5-13:ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-12ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!