How to enable WebGL

Hello everyone!

I’m rather new to Flutter and really like what I’ve seen so far, but I have a question about WebGL usage.

I built a simple web game starting with “flutter create” and then adding Flame and move around some sprites. Building the app with “fluter build web --wasm” (or running it with “flutter run -d chrome --wasm”) does work, but I noticed that the canvas used for rendering uses the “bitmaprenderer” context type.

Checking the canvas for the web build of “Super Dash” (https://superdash.flutter.dev/), I noticed that it uses a webgl2 context. If I am not mistaken, that game also uses the Flame engine.

Does anyone have an Idea what could be wrong in my setup or the way I build/run the app that causes the canvas to use the “bitmaprenderer” context type instead of “webgl2”?

Any hints and tipps would be greatly appreciated!

Thanks in advance and best regards,
Patrick

Your setup is defaulting to bitmaprenderer instead of webgl2, which might be a config issue. Also, double-check your Flame and Flutter versions, maybe Super Dash is using a different build setup.