summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-03-02 18:43:18 +0100
committerGitHub <noreply@github.com>2018-03-02 18:43:18 +0100
commit8d01b706ff461a2f0d364685a1a884bbcc6b2920 (patch)
tree824680f2ded5306aa9c73993f5cd605b91678695 /platform
parent2067932e2afac7fc8106f037bafaee7c89d01a99 (diff)
parentf0d24de960d7617ebcbd8bd6f708d7bbd842152a (diff)
Merge pull request #17158 from bruvzg/gles2_driver_select
[GLES2] Renderer selection improvement
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/os_osx.mm2
-rw-r--r--platform/x11/os_x11.cpp20
-rw-r--r--platform/x11/os_x11.h5
3 files changed, 15 insertions, 12 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 901232bc50..049191c7de 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1181,8 +1181,6 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
/*** END OSX INITIALIZATION ***/
- bool use_gl2 = p_video_driver != 1;
-
AudioDriverManager::add_driver(&audio_driver);
// only opengl support here...
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 76fc51d52c..0cdd0f338b 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -78,19 +78,23 @@
#include <X11/XKBlib.h>
int OS_X11::get_video_driver_count() const {
- return 1;
+
+ return 2;
}
const char *OS_X11::get_video_driver_name(int p_driver) const {
- String driver_name = GLOBAL_GET("rendering/quality/driver/driver_name");
- if (driver_name == "GLES2") {
- return "GLES2";
+ switch (p_driver) {
+ case VIDEO_DRIVER_GLES2:
+ return "GLES2";
+ case VIDEO_DRIVER_GLES3:
+ default:
+ return "GLES3";
}
- return "GLES3";
}
int OS_X11::get_audio_driver_count() const {
+
return AudioDriverManager::get_driver_count();
}
@@ -289,13 +293,9 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
//print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height));
#if defined(OPENGL_ENABLED)
- String setting_name = "rendering/quality/driver/driver_name";
- ProjectSettings::get_singleton()->set_custom_property_info(setting_name, PropertyInfo(Variant::STRING, setting_name, PROPERTY_HINT_ENUM, "GLES3,GLES2"));
- String video_driver_name = GLOBAL_DEF("rendering/quality/driver/driver_name", "GLES3");
-
ContextGL_X11::ContextType opengl_api_type = ContextGL_X11::GLES_3_0_COMPATIBLE;
- if (video_driver_name == "GLES2") {
+ if (p_video_driver == VIDEO_DRIVER_GLES2) {
opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE;
}
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 494845bc56..9aa742b0a7 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -53,6 +53,11 @@
#include <X11/extensions/XInput2.h>
#endif
+enum VideoDriver {
+ VIDEO_DRIVER_GLES3,
+ VIDEO_DRIVER_GLES2
+};
+
// Hints for X11 fullscreen
typedef struct {
unsigned long flags;