So I am trying to store the result from a render target into an array of Colors so I can manipulate them individually with an iterator. For some reason, the below code sets every value in the array to R=0, G=0, B=0, A=0. As though it was never initialized. Is the GetData method used incorrectly? Is it something else? It should be a very colorful image, and definitely not transparent.
The issue is NOT that the textures are not drawing properly, I executed the code with no set render target (using the default backbuffer) and the game ran perfectly fine.
//Creating a new render target and setting it
RenderTarget2D unprocessed = new RenderTarget2D(graphics.GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height,false,SurfaceFormat.Color,DepthFormat.Depth24,4,RenderTargetUsage.PreserveContents);
graphics.GraphicsDevice.SetRenderTarget(unprocessed);
//Drawing background and main player
spriteBatch.Draw(bgTex,new Rectangle(0,0,Window.ClientBounds.Width,Window.ClientBounds.Height),Color.White);
mainPlayer.Draw(spriteBatch);
//resetting render target
graphics.GraphicsDevice.SetRenderTarget(null);
//creating array of Color to copy render to
Color[] baseImage = new Color[Window.ClientBounds.Width * Window.ClientBounds.Height];
//I pause the program here and baseImage is an array of black transparent colors
unprocessed.GetData<Color>(baseImage);
spriteBatch.End();