Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
AndroidPlatform.h
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2012 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10 
11 #ifndef ANDROIDPLATFORM_H
12 #define ANDROIDPLATFORM_H
13 
14 #include <jni.h>
15 #include <android/log.h>
16 
17 #define LOG_TAG __FILE__
18 
19 #define LOGI(format, args...) { fprintf(stderr, format, ##args); __android_log_print(ANDROID_LOG_INFO, LOG_TAG, format, ##args); }
20 #define LOGE(format, args...) { fprintf(stderr, format, ##args); __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, format, ##args); }
21 #define LOGD(format, args...) { fprintf(stderr, format, ##args); __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, format, ##args); }
22 
23 #define GL_CHECK(x) \
24  x; \
25  AndroidPlatform::checkGlesError(#x);
26 
27 namespace MaliSDK
28 {
33  {
34  public:
47  static bool getAndroidAsset(JNIEnv* JNIEnvironment, const char destinationDirectory[], const char filename[]);
48 
53  static void checkGlesError(const char* operation);
54 
60  static const char* glErrorToString(int glErrorCode);
61 
67  static char* copyString(const char* string);
68  };
69 }
70 #endif /* ANDROIDPLATFORM_H */