Advertisement

Backbuffer

Started by May 18, 2002 05:53 PM
1 comment, last by Rudi 22 years, 7 months ago
Maybe you know the DirectX-Book from MicrosoftPress. There is an example about page-flipping ( chapter 9 ): a moving rectangle is drawn to the backbuffer. To make the procedure more time-extensive, the program repeats the drawing of the same rectangle for over 1000 times for each frame. You can define the number of repititions. For only 100 repititions per frame, the frame-rate is the same as the screen-frequenzy (on a Pentium). But if you increase the repititions per frame, there should come a point, where the frame-rate suddenly decreases. (For example: 1-1000 repititions/frame -> 150 frames/sec; 1001 repititions/frame -> 75 frames/sec). There are graphic-cards, where you can watch this sudden decreasing. But usually the frame-rate doesn''t decrease abruptly, because of a buffer on the graphic-card (but the animation becomes jerky). This buffer is like a second backbuffer. I would like to switch it off. Is there a DirectX-Method? (Sorry for my bad english)
*confused*

Are you talking about the video memory?? I wouldn''t recommend getting rid of that.

Or you''re double duffering and want to get rid of the backbuffer? Go for it if you want to, but your program will look like shit. It will flicker a lot.

Maybe you''re triple buffering and just want to double buffer it? If so, you simply have to change the dwBackBufferCount of the primary surface description to 1 before the surface is created (DirectDraw / D3D7 IM).

Another thing: the framerate shouldn''t decrease that much with a few extra hardware blits. It could happen if you''re loading a lot of graphics and you run out of video memory or something. Blititng from system memory can cause a speed decrease like the one you''re talking about.
Advertisement
As described in the MicrosoftPress-book, the frame-rate can descrease that much with a few extra blits. The page-flipping can only occurs during the vertical blank interval. If you have a screen with 100 Hz, every 1/100 sec a page-flipping can occurs. If your drawings are ready. Maybe your system is able to blit 1000 times during the period between two vertical blank intervals. But with one more extra blit, the drawings aren''t finished on time. The result is, that the frame rate is cut in half (the backbuffer is blocked until the page-flipping (DDFLIP_WAIT ist set)). And to avoid this, you will use a second back-buffer. But although defining only one Backbuffer, the program behaves like having defined two backbuffers. This is a strange buffer on the video-card. It "simulates" a second backbuffer and I want to switch of this strange buffer.

This topic is closed to new replies.

Advertisement