16bpp and triple buffering
Kevin Epps

Does 16bpp support triple buffering?

It runs fine, but when I esc to close out, i get a runtime error window. But when I run it as 32bpp, it closes fine.

Neil Walker

Are you doing all the right things, like destroying any sub-bitmaps before destroying the main video pages and not (as the mistake I made) calling set_gfx_mode() before deleting the main video pages.

Kevin Epps

Yes, that's how I have it now.

Tobias Dammers

Your video card is free to support triple buffering for certain modes only. Modern cards are probably optimized for 32bpp, so they might just not bother implementing triple buffering for other color depths in the driver.
Also, keep in mind that windows reports both 15 and 16 bpp as 16, so the only way to find out is check.
In windowed mode, it is possible that triple buffering only works in the desktop color depth.

Steve++

As far as I know, there is nothing special about triple buffering that some cards support and others don't. It is just page flipping with three pages in the flip chain. If your card supports any kind of page flipping in that mode and has enough memory for another page, then "triple buffering" shouldn't be a problem.

On a side note, don't use triple buffering just because you heard it was smooth. It has a chance of smoothing things out only if your rendering times are variable, below and above refresh times. Each page added to the flip chain adds a frame of visual latency and increases the chance of smoothness.

Evert
Quote:

It is just page flipping with three pages in the flip chain. If your card supports any kind of page flipping in that mode and has enough memory for another page, then "triple buffering" shouldn't be a problem.

Not quite, actually.
In addition to being able to pageflip, you need to be able to tell the hardware (driver, whatever) to flip at the next sync. That's why the triple buffering update method looks like

   /* draw screen */
   draw_scene(page[num]);
   /* Make sure last flip was done */
   while (poll_scroll()) { rest(1); /* or not...*/ };
   /* tell hardware to display new page at the next sync */
   request_video_bitmap(page[num]);
   /* Advance to next drawing page */
   num = (num+1)%3;

Whereas double buffering looks like

   /* draw screen */
   draw_scene(page[num]);
   /* tell hardware to display new page right now */
   show_video_bitmap(page[num]);
   /* Advance to next drawing page */
   num = (num+1)%2;

A card may be able to do pageflipping but not triple buffering if you cannot request a pageflip at the next sync.

Thread #558370. Printed from Allegro.cc