Each of the two buffers has an n_uses counter, so at the time of switching buffers, the age of the new current buffer can be figured out of that. Also, make offscreen surfaces single buffered, those are conceptually back buffers always.