|[AD] al_set_color_mask function?|
[ Thread Index |
| More lists.liballeg.org/allegro-developers Archives
I had to use glColorMask  a few times in my A5 code recently, mainly
to control the alpha channel when drawing into a temporary bitmap.
Since blending is done after fragment shaders and ultimately controls
the final RGBA output, not even shaders can be used for the same
effect (and the function is therefore available even in the most recent
OpenGL versions, ES 2.x and normal 4.x).
So, I'd like a function in Allegro which allows this as well:
al_set_color_mask(bool red, green, blue, alpha)
It would be a state just like blending. Each component set to false
would be ignored in all drawing. By default they all would be true
In DirectX D3DRS_COLORWRITEENABLE  seems to be the equivalent
(although I have no idea how to set it there). But I'm not too
concerned about DX support, it would be a somewhat obscure function
anyway. Also wouldn't matter much if we can't easily support it in
So, is it ok to add that function (initially just for OpenGL), or
is it a case where direct use of OpenGL/DirectX seems more appropriate?