doublebuffering.bb 729 B

123456789101112131415161718192021222324252627
  1. ; Example of double bufferiing
  2. ; An easy to use and important feature in Blitz
  3. ; for more examples visit www.blitzbasic.com
  4. ; or visit http://users.breathemail.net/georgebray
  5. Graphics 640,480 ; goes into graphics mode & sets the resolution
  6. Text 50,50,"Press spacebar..."
  7. SetBuffer FrontBuffer() ; draw to the front buffer
  8. Text 0,0,"This drawn to the front buffer"
  9. Text 50,100,"Press ecape to exit."
  10. SetBuffer BackBuffer() ; draw to the back buffer
  11. Text 50,50,"Press spacebar again..."
  12. Text 0,0,"This drawn to the back buffer"
  13. Text 50,100,"Press ecape to exit."
  14. While Not KeyDown(1) ;keep looping until ESC pressed
  15. WaitKey ;wait for any keypress
  16. Flip ;swap front and back buffers
  17. Wend ; continue until progrgram ends