Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...