Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Android: Fix unused variable warning when building without OpenGL 3

Claire Blackshawcdb458f60aea
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index f294118fa6d..eb3521321c4 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -722,7 +722,6 @@ void DisplayServerAndroid::register_android_driver() {
#ifdef VULKAN_ENABLED
bool DisplayServerAndroid::check_vulkan_global_context(bool p_vulkan_requirements_met) {
if (!rendering_context_global_checked) {
- bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
Error err = ERR_CANT_CREATE;
if (p_vulkan_requirements_met) {
rendering_context_global = memnew(RenderingContextDriverVulkanAndroid);
@@ -736,6 +735,7 @@ bool DisplayServerAndroid::check_vulkan_global_context(bool p_vulkan_requirement
}
#if defined(GLES3_ENABLED)
+ bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
if (fallback_to_opengl3) {
WARN_PRINT("Your device does not seem to support Vulkan, switching to OpenGL 3.");
OS::get_singleton()->set_current_rendering_driver_name("opengl3", OS::RENDERING_SOURCE_FALLBACK);