1. What is the most common way modern games perform triple buffering ?
  2. What does the SwapBuffers exactly do in terms of OpenGL states ?
  3. Is it possible to perform double and triple buffering independently of window system (for example, by manipulating with glDrawBuffer or by using FBO/PBO) ? If so, any hints ?
  4. Does 3. even make sense in terms of performance and flexibility ?

This quote answers most of your questions:

You cannot control whether a driver does triple buffering. You could try to implement it yourself using a FBO. But if the driver is already doing triple buffering, your code will only turn it into quadruple buffering. Which is usually overkill.


What does the SwapBuffers exactly do in terms of OpenGL states ?

From what I understand, it doesn't really do anything other than flushing GL and swapping the buffers.

| improve this answer | |
  • \$\begingroup\$ "You could try to implement it yourself using a FBO." it says "You could", but would FBO be actually the best approach ? \$\endgroup\$ – Patryk Czachurski Apr 3 '12 at 22:22
  • \$\begingroup\$ @geneotech The best approach seems to involve no FBO - just let the driver do the buffering. Otherwise, a FBO should be ideal. \$\endgroup\$ – Pubby Apr 3 '12 at 22:25
  • \$\begingroup\$ That's what I wanted to hear. So, referring to the game development, I should probably implement both double and triple buffering and leave an option in graphics settings, so when the user is aware of his driver settings, he can turn off multiple buffering in my application at all, and let it be done by driver. Am I right ? \$\endgroup\$ – Patryk Czachurski Apr 3 '12 at 22:43
  • 1
    \$\begingroup\$ @geneotech: Or... not. Just let the driver do its job and you do your job. Triple buffering exists to solve a problem. If you're not having that problem, then why would you implement it? \$\endgroup\$ – Nicol Bolas Apr 3 '12 at 23:47
  • 1
    \$\begingroup\$ @geneotech: are any of these games using OpenGL, or are the ones you're thinking of using Direct3D? \$\endgroup\$ – Sean Middleditch Apr 4 '12 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.