C# Use DateTime.AddHours calculation deviation? After calling d3d to create a device

  • Thread starter Thread starter Helen____
  • Start date Start date
H

Helen____

Guest
normal:

DateTime.MinValue.AddHours(17701774) => {2020/5/29 22:00:00}

abnormal:

DateTime.MinValue.AddHours(17701774) => {2020/5/29 21:25:16}

It is found that this problem occurs when using SharpDX(Direct3D9) to create a device..

this.device = new DeviceEx(this.direct3D, this.adapterId, DeviceType.Hardware, this.hwnd, this.createFlag, presentParameters)


PresentParameters presentParameters = new PresentParameters();
presentParameters .PresentFlags = PresentFlags.Video | PresentFlags.OverlayYCbCrBt709;
presentParameters .Windowed = true;
presentParameters .DeviceWindowHandle = this.hwnd;
presentParameters .BackBufferWidth = width == 0 ? 1 : width;
presentParameters .BackBufferHeight = height == 0 ? 1 : height;
presentParameters .SwapEffect = SwapEffect.Discard;
//presentParameters .Multisample = MultisampleType.NonMaskable;
presentParameters .PresentationInterval = PresentInterval.Immediate;
presentParameters .BackBufferFormat = this.displayMode.Format;
presentParameters .BackBufferCount = 1;
presentParameters .EnableAutoDepthStencil = false;

Continue reading...
 
Back
Top