mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 13:59:30 -07:00
The main module can now pick a renderer based on the "renderer" URL parameter.
This commit is contained in:
@@ -9,10 +9,11 @@ document.addEventListener("touchmove", (e) => e.preventDefault(), {
|
||||
});
|
||||
|
||||
document.body.onload = () => {
|
||||
const config = makeConfig(window.location.search);
|
||||
if (navigator.gpu != null) {
|
||||
initWebGPU(canvas, config);
|
||||
} else {
|
||||
const urlParams = Object.fromEntries(new URLSearchParams(window.location.search).entries());
|
||||
const config = makeConfig(urlParams);
|
||||
if (navigator.gpu == null || ["webgl", "regl"].includes(urlParams.renderer?.toLowerCase())) {
|
||||
initREGL(canvas, config);
|
||||
} else {
|
||||
initWebGPU(canvas, config);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user