Results 1 to 3 of 3

Thread: glClearcolor() problem : I am not sure ??

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2002
    Posts
    2

    glClearcolor() problem : I am not sure ??

    Hi,

    My problem is when i am trying to change the background color in run time, i want to call the display function two times to made the color change.I am using Opengl with MFC.For color selection i used the standard windows color dialog.I am getting the correct values from the color dialog and the that same values in the glClearcolor() function's arguments also.But i need to call the display function two times.The function call is given below:-

    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    glClearColor(m_nRBackgroundColor,m_nGBackgroundCol or,m_nBBackgroundColor,1);

    What is the problem ? How i can solve this ? If any buffer clearing problem ?

    Thanks for any input,

    Jerry

  2. #2
    Guest

    Re: glClearcolor() problem : I am not sure ??

    Change the order of the two statements: first set the color, then call clear...

    HTH

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2002
    Posts
    2

    Re: glClearcolor() problem : I am not sure ??

    Yes it is working well !.
    Thank U very much.
    My knowledge was that first clear the buffer and after that specify the color to clear the background.Now i got the correct way.

    Thank u once again

    Jerry

Similar Threads

  1. glClearColor and ARR[]
    By Olexandr in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-18-2013, 01:15 AM
  2. glClearColor and glClear
    By anime.igala.net in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-15-2008, 02:35 AM
  3. glClearColor
    By darren in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-27-2003, 01:25 PM
  4. glClearColor() question
    By MickeyMouse in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-11-2002, 12:14 AM
  5. glClearColor
    By guju in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-20-2002, 12:22 PM

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