mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-27 06:29:19 +00:00
Properly hook up Android shutdown paths
This commit is contained in:
parent
aa31141455
commit
1da7acbaba
@ -111,6 +111,7 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeGraphicsInitialized(JNIEnv
|
|||||||
LOG("native graphicsInitialized width:%d height:%d", width, height);
|
LOG("native graphicsInitialized width:%d height:%d", width, height);
|
||||||
static bool graphicsPreviouslyInitialized = false;
|
static bool graphicsPreviouslyInitialized = false;
|
||||||
if (graphicsPreviouslyInitialized) {
|
if (graphicsPreviouslyInitialized) {
|
||||||
|
LOG("shutting down previous context");
|
||||||
video_backend->shutdown();
|
video_backend->shutdown();
|
||||||
}
|
}
|
||||||
graphicsPreviouslyInitialized = true;
|
graphicsPreviouslyInitialized = true;
|
||||||
@ -144,6 +145,10 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnPause(JNIEnv *env, jobjec
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Java_org_deadc0de_apple2ix_Apple2Activity_nativeRender(JNIEnv *env, jobject obj) {
|
void Java_org_deadc0de_apple2ix_Apple2Activity_nativeRender(JNIEnv *env, jobject obj) {
|
||||||
|
if (UNLIKELY(emulator_shutting_down)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!nativePaused) {
|
if (!nativePaused) {
|
||||||
c_keys_handle_input(-1, 0, 0);
|
c_keys_handle_input(-1, 0, 0);
|
||||||
}
|
}
|
||||||
@ -242,6 +247,9 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnKeyUp(JNIEnv *env, jobjec
|
|||||||
|
|
||||||
jboolean Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnTouch(JNIEnv *env, jobject obj, jint action, jint pointerCount, jint pointerIndex, jfloatArray xCoords, jfloatArray yCoords) {
|
jboolean Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnTouch(JNIEnv *env, jobject obj, jint action, jint pointerCount, jint pointerIndex, jfloatArray xCoords, jfloatArray yCoords) {
|
||||||
//LOG("nativeOnTouch : %d/%d/%d :", action, pointerCount, pointerIndex);
|
//LOG("nativeOnTouch : %d/%d/%d :", action, pointerCount, pointerIndex);
|
||||||
|
if (UNLIKELY(emulator_shutting_down)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (nativePaused) {
|
if (nativePaused) {
|
||||||
LOG("UNPAUSING NATIVE CPU THREAD");
|
LOG("UNPAUSING NATIVE CPU THREAD");
|
||||||
|
@ -318,7 +318,7 @@ static GLuint _build_program(demoSource *vertexSource, demoSource *fragmentSourc
|
|||||||
if (version) {
|
if (version) {
|
||||||
sprintf(sourceString, "#version %d\n%s", version, vertexSource->string);
|
sprintf(sourceString, "#version %d\n%s", version, vertexSource->string);
|
||||||
} else {
|
} else {
|
||||||
RELEASE_LOG("YAY, you have an awesome OpenGL vendor for this device ... no GLSL version specified ... so NOT adding a #version directive to shader sources =P");
|
RELEASE_LOG("No GLSL version specified ... so NOT adding a #version directive to shader sources =P");
|
||||||
sprintf(sourceString, "%s", vertexSource->string);
|
sprintf(sourceString, "%s", vertexSource->string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,6 +631,7 @@ static void gldriver_shutdown(void) {
|
|||||||
#else
|
#else
|
||||||
# if MOBILE_DEVICE
|
# if MOBILE_DEVICE
|
||||||
// it could be a temporary backgrounding do nothing here ...
|
// it could be a temporary backgrounding do nothing here ...
|
||||||
|
_gldriver_shutdown();
|
||||||
# else
|
# else
|
||||||
emulator_shutting_down = true;
|
emulator_shutting_down = true;
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
Reference in New Issue
Block a user