Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBGL still falls back to CANVAS #5583

Closed
samme opened this issue Feb 27, 2021 · 1 comment · Fixed by #5797
Closed

WEBGL still falls back to CANVAS #5583

samme opened this issue Feb 27, 2021 · 1 comment · Fixed by #5797

Comments

@samme
Copy link
Contributor

samme commented Feb 27, 2021

Version

  • Phaser Version: 3.52.0

Description

Create a game with type Phaser.WEBGL. Run it on a device without WebGL. The game runs in CANVAS mode.

The docs say:

Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is no fallback to Canvas with this setting, so you should trap it and display a suitable message to the user.

But this doesn't happen. In this case WEBGL seems to act just like AUTO.

webgl disabled

Example Test Code

In Firefox you can set webGL.disabled to false in about:config and then visit any WEBGL example, e.g., http://phaser.io/examples/v3/view/display/alpha/single-alpha. The game runs in CANVAS mode with no error.

Or you can do

new Phaser.Game({
    type: Phaser.WEBGL,
    backgroundColor: 0x0074D9,
    callbacks: {
        preBoot: function (game) {
            game.device.features.webGL = false;
        }
    },
    scene: {
        create: function () {
            this.add.text(0, 0, 'Hello');
        }
    }
});
@photonstorm
Copy link
Collaborator

Thanks for opening this issue, and for submitting a PR to fix it. We have merged your PR into the master branch and attributed the work to you in the Change Log. If you need to tweak the code for whatever reason please submit a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants