I've been dabbling with XNA for a couple of days now. This chunk of code doesn't work as I expect. The goal is to render sprites individually and composite them on another rendertarget.

P = RenderTarget2D(with RenderTargetUsage.PreserveContents)
D = RenderTarget2D(with RenderTargetUsage.DiscardContents)

for all sprites:
{
    graphicsDevice.SetRenderTarget(D);
    &lt;draw sprite i&gt;

    graphicsDevice.SetRenderTarget(P);
    &lt;Draw D&gt;
}

graphicsDevice.SetRenderTarget(null);
&lt;Draw P&gt;


The result I get is - only the last sprite is visible. I'm sure I'm missing some piece of information about RenderTarget2D. Any hints on what that might be?


Question: Is there an easy way to background a sudo shell?
Answer: You can use suspend (as long as you invoked the shell with sudo -s instead of sudo -i):

anthony@Haruhi:~$ sudo -s
[sudo] password for anthony: 
root@Haruhi:~# suspend

[1]+  Stopped                 sudo -s
anthony@Haruhi:~$ 


If you invoked it with sudo -i, you can use suspend -f to force it to suspend anyway; note that you need to be careful there (as if you did that to an actual login shell, it could be pretty difficult to resume it).