OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaliSDK::AndroidPlatform Class Reference

Functions specific to the Android Platform. More...

#include <AndroidPlatform.h>

Static Public Member Functions

static bool getAndroidAsset (JNIEnv *JNIEnvironment, const char destinationDirectory[], const char filename[])
 Extract an asset file from the APK. More...
 
static void checkGlesError (const char *operation)
 Checks if OpenGL ES has reported any errors. More...
 
static const char * glErrorToString (int glErrorCode)
 Converts OpenGL ES error codes into the readable strings. More...
 
static char * copyString (const char *string)
 Deep copy a string using memcopy(). More...
 

Detailed Description

Functions specific to the Android Platform.

Definition at line 42 of file AndroidPlatform.h.

Member Function Documentation

void MaliSDK::AndroidPlatform::checkGlesError ( const char *  operation)
static

Checks if OpenGL ES has reported any errors.

Parameters
[in]operationThe 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.

Definition at line 43 of file AndroidPlatform.cpp.

char * MaliSDK::AndroidPlatform::copyString ( const char *  string)
static

Deep copy a string using memcopy().

Parameters
[in]stringThe string to make a copy of.
Returns
A deep copy of the string.

Definition at line 84 of file AndroidPlatform.cpp.

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]JNIEnvironmentA 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]destinationDirectoryThe destination directory where the file should be placed.
[in]filenameName 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.

Definition at line 103 of file AndroidPlatform.cpp.

const char * MaliSDK::AndroidPlatform::glErrorToString ( int  glErrorCode)
static

Converts OpenGL ES error codes into the readable strings.

Parameters
[in]glErrorCodeThe 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>

Definition at line 56 of file AndroidPlatform.cpp.


The documentation for this class was generated from the following files: