如何在 XNA 中的每一帧后不刷新渲染目标
举个例子,我在 (10,10) 处画了一个圆,然后在下一帧上在 (20,20) 处画了另一个圆。 (10,10) 处的圆不再可见。
我没有调用graphicsdevice.clear。
有没有办法让之前绘制的图形不被清除?
我将它们绘制到辅助渲染目标中,以便我可以将其用作背景。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
初始化 RenderTarget2D 时,您需要使用 RenderTargetUsage.PreserveContents。
When you initialize the
RenderTarget2D
you need to useRenderTargetUsage.PreserveContents
.