[HTML5] Editor video driver option. Replace canvas on exit.

Default is "Auto", but can be forced to a specific WebGL version if the
automatic detection fails.

The game and editor canvas are now replaced with a new one in the exit
hooks. This helps the browser do some context cleanup, and allow us to
create a new context of a different type (WebGL/WebGL2).

Enable GLES3/WebGL2 in the Web Editor.
This commit is contained in:
Fabio Alessandrelli 2021-09-20 14:47:55 +02:00
parent 11d1b0387e
commit 3a61d0990e
2 changed files with 30 additions and 16 deletions

View file

@ -702,14 +702,10 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
set_window_per_pixel_transparency_enabled(true);
}
#ifdef TOOLS_ENABLED
bool gles3 = false;
#else
bool gles3 = true;
if (p_video_driver == VIDEO_DRIVER_GLES2) {
gles3 = false;
}
#endif
bool gl_initialization_error = false;