diff --git a/examples/modules/util.js b/examples/modules/util.js index 8429ed0..71be0d2 100755 --- a/examples/modules/util.js +++ b/examples/modules/util.js @@ -33,7 +33,7 @@ const fonts = { }; function start() { - const color = new Float32Array([255, 255, 255, 1]); + const color = new Float32Array([255, 255, 255, 0]); openVG.setFVOL(VG_CLEAR_COLOR, color, 0, 4); openVG.clear(0, 0, openVG.screen.width, openVG.screen.height); (color[0] = 0), (color[1] = 0), (color[2] = 0); diff --git a/src/egl.cc b/src/egl.cc index e5b0b1d..c6da40f 100755 --- a/src/egl.cc +++ b/src/egl.cc @@ -66,6 +66,11 @@ extern void egl::Init() { static EGL_DISPMANX_WINDOW_T nativewindow; + static VC_DISPMANX_ALPHA_T alpha = { + DISPMANX_FLAGS_ALPHA_FROM_SOURCE, + 255, 0 + }; + // bcm_host_init() must be called before anything else bcm_host_init(); @@ -107,10 +112,10 @@ extern void egl::Init() { dispman_update = vc_dispmanx_update_start(0); dispman_element = - vc_dispmanx_element_add(dispman_update, dispman_display, 0 /*layer */ , + vc_dispmanx_element_add(dispman_update, dispman_display, 1 /*layer */ , &dst_rect, 0 /*src */ , &src_rect, DISPMANX_PROTECTION_NONE, - 0 /*alpha */ , 0 /*clamp */ , + &alpha /*alpha */ , 0 /*clamp */ , DISPMANX_NO_ROTATE /*transform */); nativewindow.element = dispman_element;