How to put a gradient background?

Started by sergicion, November 25, 2012, 11:37:25

Previous topic - Next topic

sergicion

I know I can put a color for the background with glClearColor(), but, how can I put a gradient?

Thanks a lot!!

Fool Running

The only way to make a gradient is to create a polygon that fills up the whole view and render it (well, you can also use a fullscreen image and blit it on the screen, but that would be slower). Just change the colors of the vertexes of the polygon and you have a nice gradient. ;D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

sergicion

Quote from: Fool Running on November 26, 2012, 14:37:40
The only way to make a gradient is to create a polygon that fills up the whole view and render it (well, you can also use a fullscreen image and blit it on the screen, but that would be slower). Just change the colors of the vertexes of the polygon and you have a nice gradient. ;D
And a sun gradient? Like minecraft

OverBlob

Another way to do it, is to make the gradient image by yourself with a image editor software (easy done with photofiltre or photoshop), and draw a quad textured with this image, that fits your whole screen!  :)
To keep it in background you must draw it before all your other drawings.