How i can specify a Gradient background color rather than glClearColor() ???


If any way to display a gradient color as the window background color ? rather than specifying a constant color using glClearColor().

I just did a search on words “gradient background” on this forum, and there were several hits returned.

You can draw a full screen quad with no texture and use the vertex color to create the gradient. If you draw it at the far clipping plane and set the Z test to GL_ALWAYS, this will clear your z-buffer at the same time. However, it might be faster to disable depth testing for this poly and to separately do an explicit clear of the depth buffer.