project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
changeset 7167 0b3b306f129a
parent 6597 814683bbd230
child 7185 92a045156255
--- a/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp	Sat Jun 02 16:25:13 2012 -0400
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp	Sat Jun 02 22:31:41 2012 +0200
@@ -638,6 +638,21 @@
     return Android_JNI_FileClose(ctx, true);
 }
 
+/*******************************************************************************
+             Functions called by the hwengine into Java
+*******************************************************************************/
+
+extern "C" float Android_JNI_getDensity(){
+    jmethodID mid;
+    jfloat density;
+    //SDLActivity.getDensity()
+    mid = mEnv->GetStaticMethodID(mActivityClass, "getDensity", "()F");
+        if(!mid) return 1.5f;
+    density = mEnv->CallStaticFloatMethod(mActivityClass, mid);
+    return density;
+
+}
+
 #endif /* __ANDROID__ */
 
 /* vi: set ts=4 sw=4 expandtab: */