The "problem" is that you draw the background first, then change rendertarget, then render that little square, then change rendertarget, then draw the little square again. in this order:
- Render on Screen stuff
- Rendertarget Change
- Render off-screen stuff
- Rendertarget Change
- Render on-screen stuff
Every change of rendertarget clears it.
What you should do;
- Rendertarget Change
- Render off-screen stuff
- Rendertarget Change
- Render on-screen stuff
Like this:
GraphicsDevice.SetRenderTarget(textureBuffer);
spriteBatch.Begin();
spriteBatch.Draw(textureSummer, new Vector2(0, 0), Color.White); // texture Summer is a 20x20 pixels texture while the screen resolution is 480 x 800
spriteBatch.End();
GraphicsDevice.SetRenderTarget(null); // switch back
spriteBatch.Begin();
spriteBatch.Draw(textureBackground, new Vector2(0,0), Color.White); // This is a 480x800 image and my resolution is set to 480x800
spriteBatch.Draw(textureBuffer, new Vector2(0,0), Color.White);
spriteBatch.End();