diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-12-05 00:31:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-05 00:31:12 +0100 |
commit | 8912f3e4a7c012443e941f4c6f2342c9913fa330 (patch) | |
tree | e54c2aeda06a53fc4e4bbe48e126f31a5b3dc919 /platform/android | |
parent | 55da3c1631906d7daabcc8bb5b43a74235567f39 (diff) | |
parent | 61cec0b023a87c61e4aeec3b79b723fd461bc8a4 (diff) |
Merge pull request #69578 from dsnopek/android-native-handles
Clean up DisplayServerAndroid::window_get_native_handle() with the GLES3 renderer
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/display_server_android.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index f76f3844e9..937b929d62 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -316,9 +316,6 @@ DisplayServer::WindowID DisplayServerAndroid::get_window_at_screen_position(cons int64_t DisplayServerAndroid::window_get_native_handle(HandleType p_handle_type, WindowID p_window) const { ERR_FAIL_COND_V(p_window != MAIN_WINDOW_ID, 0); switch (p_handle_type) { - case DISPLAY_HANDLE: { - return 0; // Not supported. - } case WINDOW_HANDLE: { return reinterpret_cast<int64_t>(static_cast<OS_Android *>(OS::get_singleton())->get_godot_java()->get_activity()); } @@ -326,8 +323,17 @@ int64_t DisplayServerAndroid::window_get_native_handle(HandleType p_handle_type, return 0; // Not supported. } #ifdef GLES3_ENABLED + case DISPLAY_HANDLE: { + if (rendering_driver == "opengl3") { + return reinterpret_cast<int64_t>(eglGetCurrentDisplay()); + } + return 0; + } case OPENGL_CONTEXT: { - return reinterpret_cast<int64_t>(eglGetCurrentContext()); + if (rendering_driver == "opengl3") { + return reinterpret_cast<int64_t>(eglGetCurrentContext()); + } + return 0; } #endif default: { |