diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-09-19 10:57:10 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-09-22 23:33:56 +0300 |
commit | 779fc8aeeed7a76022aa4b14e5e72d62745dd2b6 (patch) | |
tree | 46ac6fe2e74ceadb3e833617923f4f02106c7be2 /platform/android/src/example_custom_layer.cpp | |
parent | d1e69c8bafec2b799fae441be17b79c3566baac3 (diff) | |
download | qtlocation-mapboxgl-779fc8aeeed7a76022aa4b14e5e72d62745dd2b6.tar.gz |
[android] example custom layer - add context lost callback
Diffstat (limited to 'platform/android/src/example_custom_layer.cpp')
-rw-r--r-- | platform/android/src/example_custom_layer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index c55c9c3527..1ed68d0835 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -92,6 +92,10 @@ void nativeRender(void *context, const mbgl::style::CustomLayerRenderParameters& reinterpret_cast<ExampleCustomLayer*>(context)->render(); } +void nativeContextLost(void */*context*/) { + mbgl::Log::Info(mbgl::Event::General, "nativeContextLost"); +} + void nativeDenitialize(void *context) { mbgl::Log::Info(mbgl::Event::General, "nativeDeinitialize"); delete reinterpret_cast<ExampleCustomLayer*>(context); @@ -123,6 +127,10 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { reinterpret_cast<jlong>(nativeRender)); env->SetStaticLongField(customLayerClass, + env->GetStaticFieldID(customLayerClass, "ContextLostFunction", "J"), + reinterpret_cast<jlong>(nativeContextLost)); + + env->SetStaticLongField(customLayerClass, env->GetStaticFieldID(customLayerClass, "DeinitializeFunction", "J"), reinterpret_cast<jlong>(nativeDenitialize)); |