1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add off-screen GL context

This commit is contained in:
Pedro J. Estébanez
2021-09-24 14:07:44 +02:00
parent 25f01cb09d
commit abdf931832
25 changed files with 252 additions and 23 deletions

View File

@@ -152,6 +152,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env
delete godot_io_java;
}
if (godot_java) {
godot_java->destroy_offscreen_gl(env);
delete godot_java;
}
if (input_handler) {
@@ -212,11 +213,11 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, j
os_android->set_display_size(Size2(width, height));
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits) {
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jclass clazz) {
if (os_android) {
if (step.get() == 0) {
// During startup
os_android->set_context_is_16_bits(!p_32_bits);
os_android->set_offscreen_gl_available(godot_java->create_offscreen_gl(env));
} else {
// GL context recreated because it was lost; restart app to let it reload everything
step.set(-1); // Ensure no further steps are attempted and no further events are sent