Results 1 to 3 of 3

Thread: gradient background?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    13

    gradient background?

    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?

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: gradient background?

    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

  3. #3
    Senior Member Regular Contributor trinitrotoluene's Avatar
    Join Date
    Sep 2008
    Location
    Montérégie,Québec
    Posts
    362

    Re: gradient background?

    You just need to draw a fullscreen quad. See this link

Similar Threads

  1. Drawing background gradient
    By esapir in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-14-2014, 01:03 PM
  2. Gradient background in shader
    By ciranmc in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-11-2010, 09:59 AM
  3. Gradient background
    By gourou in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 03-27-2008, 02:41 PM
  4. How to render gradient background?
    By kangarooxy in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-28-2003, 02:01 AM
  5. Gradient Background
    By mandyV in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-06-2001, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean