I'm currently making a 2D side-scroller game with XNA for my personal project. My goal for the moment is to have fun with shaders. But I'm actually stuck by the SetRenderTarget(RenderTarget2D) method, I don't understand why once i call it the game gets a full purple screen.
I searched everywhere and I still don't understand where the problem is, but i think its maybe due to my way of beginning the spritebatch.
public void Draw(GraphicsDevice graphics, SpriteBatch spriteBatch, RenderTarget2D mainScene)
{
graphics.SetRenderTarget(mainScene);
graphics.Clear(Color.Black);
spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, _camera.GetViewMatrix(Parallax));
foreach(Sprite sprite in Sprites)
sprite.Draw(spriteBatch);
spriteBatch.End();
graphics.SetRenderTarget(null);
}
Any ideas ? Thanks in advance :)