Available html5 renderers

I’m having some trouble understanding how openfl next renders in html5…

Does the openfl support the old canvas renderer, or only webgl now?
Is there an automatic capabilities detection and fallback like in pixi.js?
Can I detect at runtime what renderer has been chosen?

Thanks!

This is done at compile time, by default you are in canvas mode.
But you can do webgl openfl build html5 -Dwebgl and dom openfl build html5 -Ddom.

So is this possible to display in code, what render is used? A macro maybe?

You can do:

#if dom
trace("dom");
#elseif canvas
trace("canvas");
#elseif webgl
trace("webgl");
#end

You can also check:

stage.window.renderer.type
1 Like

This is exactly what I was looking for! Thanks!