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.
- The default of the vertical sync alway is on for the OpenGL.
- The 2D texture is used.
- Also the double buffer is used.
- Swapbuffer() is called after calling all OppenGL draw functions in the display
updata loop. - 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