문제

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?

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top