Jump to content
  • Advertisement
Sign in to follow this  
Guardanapitcho

Draw without clean the buffer

This topic is 2616 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I wrote an application that simulates a double pendulum, and I want to draw it's path on the screen. The problem is: If I don't clean the buffer, the pendulum will "multiply", appearing all over the screen.
So, basically, I need to clean the pendulum but not the path.
I thought of storing all the points of the path and draw it at every clean, but I guess it's not a nice way to do it.
So, I thought of drawing the pendulum in a "layer" and the path in another one. But there is a way to do it? If not, what do you suggest me to do?

Thanks

cleaning* Edited by Guardanapitcho

Share this post


Link to post
Share on other sites
Advertisement
To do what you want you have to clear the render target and draw everything you want again... Thats how "every" game is done :lol:

Share this post


Link to post
Share on other sites

So, I thought of drawing the pendulum in a "layer" and the path in another one. But there is a way to do it? If not, what do you suggest me to do?


You could create a rendertarget which receives the draw call for the path every frame without being cleared, then begin rendering to the backbuffer with a normal clear, but then restore the content of the rendertarget so it fills the background, then draw the entire pendulum.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!