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.2.2 Convenience functionsSome convenience functions are defined as shown in Example 5-2:Example 5-2 Convenience functionsstatic void cdToExecutable() {char buf[PATH_MAX + 1];#ifdef MDE_OS_WIN32if(GetModuleFileName(GetModuleHandle(NULL), buf, sizeof(buf)) == 0){MDE_GENERAL_ERROR("Can not find location of executing application");}char * enddir = strrchr(buf, '\\');#elseif (readlink("/proc/self/exe", buf, sizeof(buf) - 1) == -1){MDE_GENERAL_ERROR("Can not find location of executing application");}char * enddir = strrchr(buf, '/');#endif*enddir = 0;chdir(buf);}static void errorExit(const char * fmt, const char * arg){printf(fmt, arg);#ifdef MDE_OS_WIN32// Pause so that we don't lose the message on exit.printf("Press RETURN to exit ...");getchar();#endifexit(-1);}static void printHelp() {printf("SYNTAX: lotion [-resolution arg] [-depth arg] [-theme arg] [-applets args] [-input args]\n\n");printf("-resolution\n");printf(" 800x480\n");printf(" 800x600\n\n");printf("-depth\n");printf(" bits per pixel\n\n");printf("-theme\n");printf(" blue\n");printf(" robot\n");printf(" minimal\n");printf("-applets\n");printf(" all\n");printf(" default (all)\n");printf(" lightshow\n");printf(" planet\n");printf(" buzzword\n");printf(" photo\n");printf(" presentation\n");printf(" slideshow\n");printf(" browser\n\n");ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-11ID070710Non-Confidential - Draft - Beta

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

Saved successfully!

Ooh no, something went wrong!