summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-09-03 15:35:25 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-09-03 16:11:59 +0300
commitd4e78b8db5724e529ae024eb7a97bdc0f350ab21 (patch)
tree678af10e5877a042afa1e171d41b30c2b1459aea
parent8120e0324a48190f58616378746d517e4ad40965 (diff)
downloadredot-engine-d4e78b8db5724e529ae024eb7a97bdc0f350ab21.tar.gz
Store GLES over GL status in the OS to avoid direct renderer includes in the editor.
-rw-r--r--core/os/os.h3
-rw-r--r--drivers/gles3/rasterizer_gles3.h1
-rw-r--r--editor/editor_node.cpp8
3 files changed, 5 insertions, 7 deletions
diff --git a/core/os/os.h b/core/os/os.h
index e6ce527720..553ae4cf76 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -75,6 +75,7 @@ class OS {
int _display_driver_id = -1;
String _current_rendering_driver_name;
String _current_rendering_method;
+ bool _is_gles_over_gl = false;
RemoteFilesystemClient default_rfs;
@@ -130,9 +131,11 @@ public:
void set_current_rendering_driver_name(const String &p_driver_name) { _current_rendering_driver_name = p_driver_name; }
void set_current_rendering_method(const String &p_name) { _current_rendering_method = p_name; }
+ void set_gles_over_gl(bool p_enabled) { _is_gles_over_gl = p_enabled; }
String get_current_rendering_driver_name() const { return _current_rendering_driver_name; }
String get_current_rendering_method() const { return _current_rendering_method; }
+ bool get_gles_over_gl() const { return _is_gles_over_gl; }
int get_display_driver_id() const { return _display_driver_id; }
diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h
index 80a4a792bb..92c96519d2 100644
--- a/drivers/gles3/rasterizer_gles3.h
+++ b/drivers/gles3/rasterizer_gles3.h
@@ -113,6 +113,7 @@ public:
static void make_current(bool p_gles_over_gl) {
gles_over_gl = p_gles_over_gl;
+ OS::get_singleton()->set_gles_over_gl(gles_over_gl);
_create_func = _create_current;
low_end = true;
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 32e6126225..a780228a95 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -167,10 +167,6 @@
#include "modules/modules_enabled.gen.h" // For gdscript, mono.
-#if defined(GLES3_ENABLED)
-#include "drivers/gles3/rasterizer_gles3.h"
-#endif
-
EditorNode *EditorNode::singleton = nullptr;
static const String EDITOR_NODE_CONFIG_SECTION = "EditorNode";
@@ -5062,18 +5058,16 @@ String EditorNode::_get_system_info() const {
driver_name = "Vulkan";
} else if (driver_name == "d3d12") {
driver_name = "Direct3D 12";
-#if defined(GLES3_ENABLED)
} else if (driver_name == "opengl3_angle") {
driver_name = "OpenGL ES 3/ANGLE";
} else if (driver_name == "opengl3_es") {
driver_name = "OpenGL ES 3";
} else if (driver_name == "opengl3") {
- if (RasterizerGLES3::is_gles_over_gl()) {
+ if (OS::get_singleton()->get_gles_over_gl()) {
driver_name = "OpenGL 3";
} else {
driver_name = "OpenGL ES 3";
}
-#endif
} else if (driver_name == "metal") {
driver_name = "Metal";
}