Skip to content

Commit

Permalink
Enable alpha on WebGL canvas if 32-bit colorDepth is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Nov 8, 2017
1 parent 9353d7e commit edb564a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lime/_backend/html5/HTML5Renderer.hx
Expand Up @@ -64,9 +64,12 @@ class HTML5Renderer {

if (#if (canvas || munit) false #elseif webgl true #else !Reflect.hasField (parent.window.config, "hardware") || parent.window.config.hardware #end) {

var transparentBackground = Reflect.hasField (parent.window.config, "background") && parent.window.config.background == null;
var colorDepth = Reflect.hasField (parent.window.config, "colorDepth") ? parent.window.config.colorDepth : 16;

var options = {

alpha: (Reflect.hasField (parent.window.config, "background") && parent.window.config.background == null) ? true : false,
alpha: (transparentBackground || colorDepth > 16) ? true : false,
antialias: Reflect.hasField (parent.window.config, "antialiasing") ? parent.window.config.antialiasing > 0 : false,
depth: Reflect.hasField (parent.window.config, "depthBuffer") ? parent.window.config.depthBuffer : true,
premultipliedAlpha: true,
Expand Down

0 comments on commit edb564a

Please sign in to comment.