Results 1 to 4 of 4

Thread: Windows flicker

  1. #1
    Guest

    Windows flicker

    I have alot of flicker and I want to get rid of it.

    I am using MFC and displaying OpenGL graphics in a CView. I use a slider control to manipulate the viewpoint. When the user moves the slider the program calls Invalidate and UpdateWindow which in turn calls OnDraw whichs uses the value from the slider to change the viewpoint. I am not doing anything graphically intensive yet. I have PFD_DOUBLEBUFFER enabled and SwapBuffers(m_pDC->m_hDC)is used in OnDraw.

    Is there a way to stop the flicker?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Windows flicker

    The flicker probably comes from Windows erasing the view background with solid white whenever you draw to it. I think you can disable this by providing a no-op OnEraseBackground callback handler, but it's been years since I looked at MFC so my memory's a little hazy.

  3. #3
    Guest

    Re: Windows flicker

    I had the same problem and solved it by using
    InvalidateRect(NULL,FALSE).
    The Background will not be updated, so there is no flickering.

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Batavia, NY, 14020
    Posts
    234

    Re: Windows flicker

    Use classwizard to include a handler for WM_ERASEBKGND, and within the code handler it provides, comment out the return that calls the base class as such:

    BOOL CMyViewClass::OnEraseBkgnd(CDC *pDC)
    {
    // return CView::OnEraseBkgnd(pDC)
    return TRUE;
    }

    This tells windows that your app is the one thats handling window erases and causes the windows framework not to.

    Siwko
    - I am not opensource! -

Similar Threads

  1. :glutIdleFunc flicker
    By sud24 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-14-2008, 04:13 AM
  2. Flicker .......help!!!!!!
    By akira_lm in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-27-2001, 07:51 PM
  3. Flicker ????
    By yayaya in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-25-2001, 02:47 AM
  4. Mouse flicker
    By Furrage in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 01-18-2001, 03:21 AM
  5. flicker
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-20-2000, 09:56 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