Log in or register to post comments

What is requiresAlpha ?

November 25, 2012 - 8:32am #1

I don't understand the meaning of the QCAR::requiresAlpha() method. In which case will it be true or false ?

I need to use it to define the gl background color ?


What is requiresAlpha ?

May 4, 2014 - 9:38pm #4

I'm now creating an application based on BackgroundTextureAccess, but stuck in the problem that QCAR::requiresAlpha returns false.

I want to render glview over surfaceview, and glview needs to be transparent.

How can I fix QCAR::requiresAlpha value?

What is requiresAlpha ?

November 26, 2012 - 9:14am #3

Perfect answer, thanks !

What is requiresAlpha ?

November 26, 2012 - 1:07am #2

Hi, if the QCAR::requiresAlpha returns true, then it would indicate that your QCAR OpenGL view must be considered as "translucent" (e.g. if you want to render the QCAR view on top of something else); 

this is why in the samples (e.g. ImageTargets.cpp), we clear the alpha component of the OpenGL clear color with alpha = 0 (=> transparent view) or alpha = 1 (=> opaque view) depending on the value returned by QCAR::requiresAlpha()

glClearColor(0.0f, 0.0f, 0.0f, QCAR::requiresAlpha() ? 0.0f, 1.0f); 

However, from a practical point of view, you could ignore this flag and set the alpha component just to 1.0f

(unless you plan to render something behind the video background of qcar, which is unlikely, as usually you render everything ON TOP of the qcar view).




Log in or register to post comments