[MDX]AccessViolationException on Device.Clear

Started by
-1 comments, last by pOtrek 15 years, 5 months ago
Sometimes I'm getting AccessViolationException while executing Device.Clear()

device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, System.Drawing.Color.Black, 1.0f, 0);

and here is my device creation code:

ClientSize = new System.Drawing.Size(1, 1);
// Set our presentation parameters
presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.EnableAutoDepthStencil = true;
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
CreateFlags createFalgs = CreateFlags.FpuPreserve | CreateFlags.DisableDriverManagement ;
if (Engine3DConfiguration.USE_HARDWARE_T_AND_L) {
	createFalgs |= CreateFlags.MixedVertexProcessing;
}
else {
        createFalgs |= CreateFlags.SoftwareVertexProcessing;
}
try {
        device = new Device(0, DeviceType.Hardware, this, createFalgs, presentParams);
}

My render loop is hooked to OnPaint event of WinForms control and that control is hosted by WindowsFormsHost in my WPF application. Could it be that WPF have something to do with that ??

This topic is closed to new replies.

Advertisement