You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
[HTML5] Implement WebGL fallback.
According to project settings and when WebGL2 is not available.
This commit is contained in:
@@ -719,6 +719,17 @@ const GodotDisplay = {
|
||||
GodotRuntime.setHeapValue(r_y, (y - rect.y) * rh, 'i32');
|
||||
},
|
||||
|
||||
godot_js_display_has_webgl__sig: 'ii',
|
||||
godot_js_display_has_webgl: function (p_version) {
|
||||
if (p_version !== 1 && p_version !== 2) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return !!document.createElement('canvas').getContext(p_version === 2 ? 'webgl2' : 'webgl');
|
||||
} catch (e) { /* Not available */ }
|
||||
return false;
|
||||
},
|
||||
|
||||
/*
|
||||
* Canvas
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user