I know there is a section devoted to double buffering in "Learn", but it does not really explain how to use it. I am creating a kind of "Get used to ICE" game and I need to move my sprite around the screen. I also need it so that when I move it, it only moves the sprite and does not mess with the background. Thanks. Smile
Okay, let me try to explain it. Smile

First of all, you need to tell your program to draw all the sprites, circles and whatever to the BUFFER, which you can do with det(9,1). You can put this before the loop, or even inside the loop if you want that, but that wastes time. Next thing is the main loop. You first need to clear the buffer, in order to remove trash; then you can draw all the sprites, and right before your loop ends, you want the buffer to be displayed. That can be done with det(10). This tells the program to display the BUFFER and to set the current visible screenbuffer to be the backbuffer. And that's all! If you have more questions, feel free to ask me! Smile
It may help to read this page; which describes how the buffers work. https://github.com/CE-Programming/toolchain/wiki/GraphX-Library:-Buffering
PT_ wrote:
Okay, let me try to explain it. Smile

First of all, you need to tell your program to draw all the sprites, circles and whatever to the BUFFER, which you can do with det(9,1). You can put this before the loop, or even inside the loop if you want that, but that wastes time. Next thing is the main loop. You first need to clear the buffer, in order to remove trash; then you can draw all the sprites, and right before your loop ends, you want the buffer to be displayed. That can be done with det(10). This tells the program to display the BUFFER and to set the current visible screenbuffer to be the backbuffer. And that's all! If you have more questions, feel free to ask me! Smile


What is "clear buffer" Is it a command?
You need to be sure all the previous contents are erased, which means you either need to fill it with a color - det(5,X) or fill it quicly with black - det(76).
Ok, thank you so much, it's working great!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement