Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » 16bpp and triple buffering

This thread is locked; no one can reply to it. rss feed Print
16bpp and triple buffering
Kevin Epps
Member #5,856
May 2005
avatar

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
Member #210
April 2000
avatar

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.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Kevin Epps
Member #5,856
May 2005
avatar

Yes, that's how I have it now.

Tobias Dammers
Member #2,604
August 2002
avatar

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.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Steve++
Member #1,816
January 2002

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
Member #794
November 2000
avatar

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.

Go to: