Plain colored quad with glBlendFunc()

Started by simonhyttfors, June 17, 2013, 16:04:25

Previous topic - Next topic

simonhyttfors

I've put glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); in my OpenGL initialization code so the transparent part of my textures remains so. But I now want to add a simple colored quad, without any texture. This won't show up as long as I keep the glBlendFunc line. How do I fix it?

quew8

Disable blend function, disable textures, draw quad, enable blend function, enable textures.

Fool Running

You should be able to keep the blend function enabled and just disable the textures. Just make sure you don't use a color with a zero alpha channel.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

quew8

I was thinking along the lines of performance. If it's just the one non-blended quad, don't bother disabling blend. If there are a lot of them, I think disabling blend would be a fair amount quicker.

But maybe not. If nothing else, disabling blend is less error prone.