Mercurial > sdl-ios-xcode
diff src/SDL_android.cpp @ 5000:6a10693e66c3
Cleaned up internal accelerometer interface
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Jan 2011 18:03:56 -0800 |
parents | a514bfe6952a |
children | 77df56570442 |
line wrap: on
line diff
--- a/src/SDL_android.cpp Thu Jan 13 17:13:00 2011 -0800 +++ b/src/SDL_android.cpp Thu Jan 13 18:03:56 2011 -0800 @@ -57,7 +57,7 @@ static jmethodID midAudioQuit; // Accelerometer data storage -float fLastAccelerometer[3]; +static float fLastAccelerometer[3]; /******************************************************************************* @@ -184,6 +184,14 @@ } } +extern "C" void Android_JNI_GetAccelerometerValues(float values[3]) +{ + int i; + for (i = 0; i < 3; ++i) { + values[i] = fLastAccelerometer[i]; + } +} + // // Audio support //