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

[HTML5] Implement WebGL fallback.

According to project settings and when WebGL2 is not available.
This commit is contained in:
Fabio Alessandrelli
2021-04-06 12:46:33 +02:00
parent ea5b3dda93
commit 00f3807a24
3 changed files with 14 additions and 2 deletions

View File

@@ -811,7 +811,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
while (true) {
if (gles3) {
if (RasterizerGLES3::is_viable() == OK) {
if (godot_js_display_has_webgl(2) && RasterizerGLES3::is_viable() == OK) {
attributes.majorVersion = 2;
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
@@ -827,7 +827,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
}
}
} else {
if (RasterizerGLES2::is_viable() == OK) {
if (godot_js_display_has_webgl(1) && RasterizerGLES2::is_viable() == OK) {
attributes.majorVersion = 1;
RasterizerGLES2::register_config();
RasterizerGLES2::make_current();