If you don't want to see one quad underneath the other, why are you using blending?
I still want the blending.
Imagine a brush which is not solid but fades out smoothly.
As long as I press the left mouse button I can go over the same pixel as often as I want but it won't get higher alpha values.
But if I release the left mouse button and do the same again it is supposed to blend as usual.
Paint it to a seperate layer, if pixel is not coloured then colour it with the paint value, otherwise do nothing (unless your brush has some falloff). You can render this layer over the top with alpha blending. Once you release the mouse then you apply the layer to the layer your actually trying to draw on. Its sort of doing the "big array" thing you didn't want but slightly differently. Blending alone won't solve your problem as the effect you have is blending, the effect you want is not blending (its logical). Sounds like your doing render to texture, just get 2 render targets. One you render to while the brush is down, once its released you render it onto the "canvas" target and clear it ready for the next time you start painting.
I've just found a function called "glBlendEquation".
If I do this:
glBlendEquation(GL_FUNC_ADD);
glColor4f(red, green, blue, 1.0);
//render brush
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
glColor4f(0.0, 0.0, 0.0, 1.0-alpha);
//render quad which covers the whole screen
I can limit what I am drawing to alpha because it can't go beyond 1.0 and after that I subtract everything.
Unfortunately this will also affect what has been drawn before so I have to save that first, render the brush, save the brush, restore the old stuff and blend the brush on top of it.
I guess this will be too slow if I make a few brushes so I don't think that I'll do it like that.
I remember reading that it is possible to render directly to textures so I could make a bunch of quads which blend as usual and render on the quads by subtracting the alpha.
I have not done this before so I don't know if this works as intended.
Maybe rendering to many textures will consume the same amount of memory or have a big impact on performance.
What would be the fastest way to render the single brush strokes and blend them onto each other?
edit:
Seems to be called "Frame Buffer Object".
So I would:
1. Create one of these
2. Render a brush stroke on it
3. Blend content of it over the main rendering context
4. Clear it
and repeat 2. - 4. (up to lets say 1000 times) until everything is drawn?
Would that still be possible with a nice framerate?