PDA

View Full Version : glClearColor with Gradient



rks
01-02-2002, 04:02 PM
Hello, I would like to know if it is possible to have a background with a color gradient instead of a single color as with glClearColor.

richardve
01-02-2002, 04:23 PM
Well, here's some advanced code for drawing a background gradient:




DisableZwrites();

setColor(upperGradientColor);
drawVertex2d(-1.f, -1.f);
drawVertex2d( 1.f, -1.f);

setColor(lowerGradientColor);
drawVertex2d( 1.f, 1.f);
drawVertex2d(-1.f, 1.f);

drawClouds();

EnableZwrites();



(yes, that was pseudocode.. please don't try to compile it)