Functions specific to the Android Platform.
More...
#include <AndroidPlatform.h>
List of all members.
Static Public Member Functions |
static bool | getAndroidAsset (JNIEnv *JNIEnvironment, const char destinationDirectory[], const char filename[]) |
| Extract an asset file from the APK.
|
static void | checkGlesError (const char *operation) |
| Checks if OpenGL ES has reported any errors.
|
static const char * | glErrorToString (int glErrorCode) |
| Converts OpenGL ES error codes into the readable strings.
|
static char * | copyString (const char *string) |
| Deep copy a string using memcopy().
|
Detailed Description
Functions specific to the Android Platform.
Member Function Documentation
void MaliSDK::AndroidPlatform::checkGlesError |
( |
const char * |
operation | ) |
|
|
static |
Checks if OpenGL ES has reported any errors.
- Parameters:
-
[in] | operation | The OpenGL ES function that has been called. |
Calls glGetError() until no more errors are reported. GL stores all the errors since the last call to glGetError(). These are returned one-by-one with calls to getGetError(). Each call clears an error flag from GL. If GL_NO_ERROR is returned no errors have occured since the last call to glGetError(). Prints the original error code the operation which caused the error (passed in) and the string version of the error.
char * MaliSDK::AndroidPlatform::copyString |
( |
const char * |
string | ) |
|
|
static |
Deep copy a string using memcopy().
- Parameters:
-
[in] | string | The string to make a copy of. |
- Returns:
- A deep copy of the string.
bool MaliSDK::AndroidPlatform::getAndroidAsset |
( |
JNIEnv * |
JNIEnvironment, |
|
|
const char |
destinationDirectory[], |
|
|
const char |
filename[] |
|
) |
| |
|
static |
Extract an asset file from the APK.
If the file specified by filename is not avaliable in destinationDirectory, this method will attempt to extract it from the APK into destinationDirectory. Typically used in OpenGL ES applications to extract shader files and textures.
- Parameters:
-
[in] | JNIEnvironment | A pointer to the JNI environment which allows interfacing with the Java Virtual Machine (JVM). Allows extensive interaction with the JVM including accessing Java classes, fields and methods. This pointer is provided as part of a JNI call from Java to C++. |
[in] | destinationDirectory | The destination directory where the file should be placed. |
[in] | filename | Name of the file to extract from the APK. Can be any file placed inside the "assets" directory of the Android project when the APK is built. |
- Returns:
- Returns true if the file is avaliable in the destinationDirectory.
const char * MaliSDK::AndroidPlatform::glErrorToString |
( |
int |
glErrorCode | ) |
|
|
static |
Converts OpenGL ES error codes into the readable strings.
- Parameters:
-
[in] | glErrorCode | The OpenGL ES error code to convert. |
- Returns:
- The string form of the error code.
Converts the error codes into strings using the definitions found in <GLES2/gl2.h>
The documentation for this class was generated from the following files: