编译时正常,运行时出现以下错误:未处理的“System.NullReferenceException”类型的异常出现在 microsoft.directx.direct3d.dll 中。其他信息: 未将对象引用设置到对象的实例。以下是部分代码:
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed=true;
presentParams.SwapEffect = SwapEffect.Discard;
出错时光标停的地方device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
return true;