asdf
This commit is contained in:
@@ -39,9 +39,12 @@ void android_main(struct android_app *pApp) {
|
||||
aout << "Welcome to android_main" << std::endl;
|
||||
g_android_app = pApp;
|
||||
g_assetManager = pApp->activity->assetManager;
|
||||
FaceApp application;
|
||||
g_Application = &application;
|
||||
application.SetInitArg(g_InitArgString);
|
||||
//FaceApp application;
|
||||
//g_Application = &application;
|
||||
if(g_Application == nullptr) {
|
||||
g_Application = new FaceApp();
|
||||
}
|
||||
g_Application->SetInitArg(g_InitArgString);
|
||||
pApp->onAppCmd = handle_cmd;
|
||||
long long last_update_time = 0;
|
||||
android_app_set_motion_event_filter(pApp, nullptr);
|
||||
@@ -73,11 +76,11 @@ void android_main(struct android_app *pApp) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(application.isInited())
|
||||
if(g_Application->isInited())
|
||||
{
|
||||
auto frameTime = (start_time - _lastDrawFrameTime);
|
||||
_lastDrawFrameTime = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
|
||||
application.drawFrame(frameTime);
|
||||
g_Application->drawFrame(frameTime);
|
||||
}
|
||||
auto end_time = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
|
||||
auto frameTime = end_time - last_update_time;
|
||||
@@ -89,7 +92,7 @@ void android_main(struct android_app *pApp) {
|
||||
this_thread::sleep_for(chrono::milliseconds((35-function_time)));
|
||||
}
|
||||
} while (!pApp->destroyRequested);
|
||||
application.cleanup();
|
||||
//application.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +157,7 @@ Java_com_hmwl_face_1sdk_FaceActivity_SetCppInitArg(JNIEnv *env, jobject thiz, js
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_hmwl_face_1sdk_FaceActivity_StopRunning(JNIEnv *env, jobject thiz) {
|
||||
g_Application->_running = false;
|
||||
g_Application->Stop();
|
||||
}
|
||||
|
||||
JavaVM* g_jvm = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user