PDA

View Full Version : gradient background?



popapez
05-07-2009, 02:38 PM
right now i am using

glClearColor( 0.7, 0.9, 1.0, 0.0 );

to just set the entire background to a light blue. i would like it to be a gradient though. i cannot simply create a quad and change the color with the vertices because my image is rotate-able, and i dont want the background to rotate with it.


or is there a way to set up rotation so that everything moves except a quad?

dletozeun
05-07-2009, 03:00 PM
or is there a way to set up rotation so that everything moves except a quad?


Of course! :)

glMatrixMode( GL_MODELVIEW );
glLoadIdentity();

// draw the fullscreen quad

// Apply transformations
glRotatef(...)
...

// draw everything else.

// swap buffers

trinitrotoluene
05-07-2009, 03:01 PM
You just need to draw a fullscreen quad. See this link (http://www.opengl.org/resources/faq/technical/transformations.htm#tran0090)