EFileTahi-A Posted July 3, 2008 Posted July 3, 2008 I simply can't understand why this does not work... Surface s = dxDevice.GetBackBuffer(0, 0, BackBufferType.Mono); GraphicsStream gs = s.LockRectangle(LockFlags.ReadOnly); It gives me an error when executing the second line of code. I've tryed using many different parameters but, always give me "Error-in-application". Why is this happening? Quote
Administrators PlausiblyDamp Posted July 3, 2008 Administrators Posted July 3, 2008 Have you trie drunning with the debug version of DirectX enabled and getting using it's d3dspy.exe to see what is happening under the hood? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
EFileTahi-A Posted July 4, 2008 Author Posted July 4, 2008 Well, I discovered the problem, I needed to add the following lines to the Device Parameters: presentParamsDX1.SwapEffect = SwapEffect.Discard; presentParamsDX1.EnableAutoDepthStencil = false; presentParamsDX1.PresentFlag |= PresentFlag.LockableBackBuffer; presentParamsDX1.MultiSample = MultiSampleType.None; And it works fine :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.