   SlimDX: How do you read pixels from the render target?
  Hi,I am trying to copy the render target to a local texture so I can read a pixel from it. How would I do this. I have tried using CopyResource without any luck.After copying the rendertarget to a local staging texture, I am not able to read the pixels. All bytes are 0 even though I cleared the render target to white.I am using F#://--------------------deviceContext.CopyResource(mainRenderTargetView.Resource, localTexture)    let pixelData = deviceContext.MapSubresource(    localTexture,0,width*height*sizeof<int32>, //Correct?    MapMode.Read,SlimDX.Direct3D11.MapFlags.None)let marshalPixels index =Marshal.ReadInt32(pixelData.Data.DataPointer, index*4)let pixels = Array.init (width*height) marshalPixels//--------------------Any ideas?ThanksJohan[Edited by - Rookboom on April 4, 2010 9:20:57 AM]
  I know this question is off-topic but why do you use F#?   ;  Why F#? I started using simply out of curiosity. I love learning new languages. Now that I have been using it for about 4 months, I am hooked. I never want to go back to anything else. It has the terseness of dynamic languages like python or ruby, but it is type safe and has the same performance as C#. Being a functional language it also allows you to solve many problems in far fewer lines of code than you would use in an imperative language. And of course it is the only functional language that allows you to leverage the .NET framework. There is a lot to like about F#.   ;  False alarm, I was rendering to the wrong render target. :-|   