1

Take for example I draw a circle at (10,10) then on the next frame another at (20,20). the circle at (10,10) is no longer visible.

I am not calling graphicsdevice.clear.

is there a way to make the previously drawn graphics not be cleared?

I am drawing these into a seconary rendertarget so I can use it as a background.

Any Ideas?

braX
  • 11,506
  • 5
  • 20
  • 33
Tony Raymond
  • 187
  • 10

1 Answers1

3

When you initialize the RenderTarget2D you need to use RenderTargetUsage.PreserveContents.

// Disregard the arguments up to RenderTargetUsage
RenderTarget2D r = new RenderTarget2D(GraphicsDevice,
                                      graphics.PreferredBackBufferWidth,
                                      graphics.PreferredBackBufferHeight,
                                      false,
                                      RenderTargetUsage.PreserveContents);
annonymously
  • 4,708
  • 6
  • 33
  • 47