Skip to main content
GameDev.net gamedev.net
🔒 Locked

Draw without clean the buffer

Started by Guardanapitcho Aug 21, 2011 at 2:32 PM 1 replies 1.2k views
Original Post
Guardanapitcho
Guardanapitcho
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*
Aqua Costa
Aqua Costa
To do what you want you have to clear the render target and draw everything you want again... Thats how "every" game is done
Digitalfragment
Digitalfragment

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.