diff options
Diffstat (limited to 'platform/android/src/math/math.hpp')
-rw-r--r-- | platform/android/src/math/math.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/android/src/math/math.hpp b/platform/android/src/math/math.hpp new file mode 100644 index 0000000000..c6a8549f10 --- /dev/null +++ b/platform/android/src/math/math.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include <mbgl/util/noncopyable.hpp> + +#include <jni/jni.hpp> + +namespace mbgl { +namespace android { +namespace math { + +class Math : private mbgl::util::noncopyable { +public: + static constexpr auto Name() { return "java/lang/Math"; }; + + static jni::jdouble rint(jni::JNIEnv& env, const jni::jdouble value) { + static auto& javaClass = jni::Class<Math>::Singleton(env); + static auto method = javaClass.GetStaticMethod<jni::jdouble (jni::jdouble)>(env, "rint"); + return javaClass.Call(env, method, value); + }; +}; + +void registerNative(jni::JNIEnv&); + +} // namespace math +} // namespace android +} // namespace mbgl
\ No newline at end of file |