Results 1 to 2 of 2

Thread: double-buffering and initial screen

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004

    double-buffering and initial screen

    Hi, I'm posting this not to ask a question , but to tell everyone something they might have a problem with.
    It's about using double-buffering in your program and to clear the screen initially.
    In my case, using double-buffering used to work for my paint program only when i painted something on the screen. The initial screen was always a background of the windows environment I was in (that's confusing for a novice- he would have no idea of whether his program works or not.)
    The I started thinking in terms of buffers, and this is where I hit upon the idea of clearing the screen (one buffer now), swap the buffers, and clear the other one.All cleared!! So the initial screen what one wanted to see is a clear screen(with just code to clear the screen, in the display-callback routine).

    Probably this is one reason why guys in the universities dont write paint programs using double-buffering!!

    I hope this helps certain people now.
    Yup, that's me!!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Gastonia, NC, USA

    Re: double-buffering and initial screen

    That is because you are thinking in the old way and not now it is done in openGL.

    The idea of double buffering is to not let the user see the screen until the next drawing or scene is completed and only then swap it prevent flicker.

    In a traditional 2D bitmap paint program you are drawing directly to a surface buffer vs. in 3D in which everything is rendered to the surface the screen buffer.

    The problem your seeing is when you swap buffers is that you draw one time on buffer A then the next time on buffer B. So some of the drawing it being stored in buffer A and then in buffer B. The correct way to draw using double buffers is to redraw the whole scene data each time.

    It is not a problem to do a paint program in openGL as long as you do it in the openGL way, not with the old 2D thinking way.

Similar Threads

  1. EGL double buffering
    By mustaf in forum EGL
    Replies: 13
    Last Post: 01-06-2012, 08:47 PM
  2. Double buffering
    By link19 in forum OpenGL: Basic Coding
    Replies: 18
    Last Post: 10-28-2003, 09:48 AM
  3. double buffering
    By cobbal in forum OpenGL: macOS
    Replies: 1
    Last Post: 03-17-2003, 05:27 PM
  4. Double Buffering
    By Mr Pink in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 01-13-2003, 01:43 AM
  5. double buffering
    By niranjan in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-09-2001, 07:08 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