Problem about using double buffer with vertical sync?

Hi!

In windows, I used the double buffer to display 1000 random dots with a 1024x768 resolution, 60Hz CRT monitor. I am using Ge-force FX 5900 also.

  1. The default of the vertical sync alway is on for the OpenGL.
  2. The 2D texture is used.
  3. Also the double buffer is used.
  4. Swapbuffer() is called after calling all OppenGL draw functions in the display
    updata loop.
  5. In each display updata loop, GetTickCount() is called to check the time before
    I call all draw functions.

So, the difference between two frame time’s readings is the time interval between two frames. The followings are the time intervals between frames.

16
15
16
16
15
16
16
15
16
15
16
16
15
16
31
.
.
.
(repeat)

I found the interval between 15th and 16 frame takes two frame times 30~31msecond, which happens in each 16 frames, even I decreased the dots number down to one dot from 1000 dots.

I guess:
It looks like that there may be 1 msecond time delay on each frame. After 16 frames, totally there are 16 msecond cumulated time delay. This made the 16th video buffer updating request just after the vertical sync of the new 16th frame, So, the time waiting for the 16th swapbuffer() return takes two frame time(30~31msecond).

Is there any ideal how to solve this problem?

What I need is the exactly updating screen in the each single frame time period. Could someone recommend me how to do this?

Thanks,

Haolei

Just for clarification:

Do you draw your “dots” into a 2d texture and upload that every frame?

Because thats is what I think you do or at least that is what I understood from “the 2d texture is used”.

Could you elaborate a bit more detailed what exactly you are doing?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.