summaryrefslogtreecommitdiffstats
path: root/Common/NativeApp/src/Android
diff options
context:
space:
mode:
Diffstat (limited to 'Common/NativeApp/src/Android')
-rw-r--r--Common/NativeApp/src/Android/AndroidAppBase.cpp9
-rw-r--r--Common/NativeApp/src/Android/AndroidMain.cpp6
2 files changed, 7 insertions, 8 deletions
diff --git a/Common/NativeApp/src/Android/AndroidAppBase.cpp b/Common/NativeApp/src/Android/AndroidAppBase.cpp
index 4a1a4e2..f3e341c 100644
--- a/Common/NativeApp/src/Android/AndroidAppBase.cpp
+++ b/Common/NativeApp/src/Android/AndroidAppBase.cpp
@@ -37,7 +37,7 @@ int AndroidAppBase::InitDisplay()
{
if( !initialized_resources_ )
{
- Initialize(app_->window);
+ Initialize();
LoadResources();
initialized_resources_ = true;
@@ -51,7 +51,7 @@ int AndroidAppBase::InitDisplay()
LoadResources();
}
}
-
+
ShowUI();
//tap_camera_.SetFlip( 1.f, -1.f, -1.f );
@@ -89,7 +89,7 @@ void AndroidAppBase::DrawFrame()
auto CurrTime = Timer.GetElapsedTime();
auto ElapsedTime = CurrTime - PrevTime;
PrevTime = CurrTime;
-
+
Update(CurrTime, ElapsedTime);
Render();
@@ -211,9 +211,10 @@ void AndroidAppBase::SuspendSensors()
//-------------------------------------------------------------------------
//Misc
//-------------------------------------------------------------------------
-void AndroidAppBase::SetState( android_app* state )
+void AndroidAppBase::SetState( android_app* state, const char* native_activity_class_name )
{
app_ = state;
+ native_activity_class_name_ = native_activity_class_name;
doubletap_detector_.SetConfiguration( app_->config );
drag_detector_.SetConfiguration( app_->config );
pinch_detector_.SetConfiguration( app_->config );
diff --git a/Common/NativeApp/src/Android/AndroidMain.cpp b/Common/NativeApp/src/Android/AndroidMain.cpp
index 27fd90c..6e65b8a 100644
--- a/Common/NativeApp/src/Android/AndroidMain.cpp
+++ b/Common/NativeApp/src/Android/AndroidMain.cpp
@@ -30,6 +30,7 @@
#define HELPER_CLASS_NAME "com/android/helper/NDKHelper" //Class name of helper function
+#define NATIVEACTIVITY_CLASS_NAME "android/app/NativeActivity"
using namespace Diligent;
@@ -38,11 +39,8 @@ using namespace Diligent;
// event loop for receiving input events and doing other things.
void android_main( android_app* state )
{
- // Despite the deprecation warning, removing call to app_dummy causes the app to crash!
- app_dummy();
-
std::unique_ptr<AndroidAppBase> theApp(CreateApplication());
- theApp->SetState( state );
+ theApp->SetState( state, NATIVEACTIVITY_CLASS_NAME );
//Init helper functions
ndk_helper::JNIHelper::Init( state->activity, HELPER_CLASS_NAME );