Skip to content

Commit

Permalink
Merge pull request #1462 from rommapp/romm-1335
Browse files Browse the repository at this point in the history
[ROMM-1335] Check for webGL when testing emulatorjs supported
  • Loading branch information
gantoine authored Jan 11, 2025
2 parents 9aa99ec + d384117 commit c671bbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,14 @@ export function isEJSEmulationSupported(
platformSlug: string,
heartbeat: Heartbeat,
) {
const canvas = document.createElement("canvas");
const gl =
canvas.getContext("webgl") || canvas.getContext("experimental-webgl");

return (
!heartbeat.EMULATION.DISABLE_EMULATOR_JS &&
getSupportedEJSCores(platformSlug).length > 0
getSupportedEJSCores(platformSlug).length > 0 &&
gl instanceof WebGLRenderingContext
);
}

Expand Down

0 comments on commit c671bbb

Please sign in to comment.