changing the color of a luminance/alpha bitmap

Hello,

I have a problem I cannot solve.
In my programme I put a luminance/alpha bitmap
on the color-buffer. The result is a white image
(a letter/digit). I would like to be able to set
the color, but my first attempts very unsuccessful.

glPixelTransferf(GL_RED_SCALE,float®)
worked fine, but soooo sloooooow. Is there another
technique to set the color? Low level conversion
of the luminance_alpha bitmap to RGBA is not an
option.

An option would be the use of tectures and GL_MODULATE, but I would like to avoid textures for this.

Thanks,
Frits

Assuming the imaging subset available, you can use the blending stage. Set the constant blend color to the color you want, and multiply the source fragmens with it. Like this.

glBlendFunc(GL_CONSTANT_COLOR, GL_ZERO);
glBlendColor(1, 0, 0, 1); // Red
glEnable(GL_BLEND);

Originally posted by fwest:
An option would be the use of tectures and GL_MODULATE, but I would like to avoid textures for this.

So… You would like to avoid the most efficient way of doing this? You’d rather copy a heap of data across your AGP Bus every frame? Good luck!

Thanks for the tips. I never thought about the
data-transfer load, only about code complexity.