Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DisplayMode

unsafe DisplayMode Microsoft.Xna.Framework.Graphics.GraphicsDevice.DisplayMode
get

Definition at line 314 of file GraphicsDevice.cs.

315 {
316 get
317 {
318 IntPtr intPtr = (IntPtr)pComPtr;
319 Helpers.CheckDisposed(this, intPtr);
320 IDirect3DDevice9* ptr = pComPtr;
321 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DDISPLAYMODE d3DDISPLAYMODE);
322 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDISPLAYMODE*, int>)(int)(*(uint*)(*(int*)ptr + 32)))((nint)ptr, 0u, &d3DDISPLAYMODE);
323 if (num < 0)
324 {
325 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
326 }
327 DisplayMode displayMode = _displayMode;
328 if (displayMode == null)
329 {
330 _displayMode = new DisplayMode(*(int*)(&d3DDISPLAYMODE), System.Runtime.CompilerServices.Unsafe.As<_D3DDISPLAYMODE, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DDISPLAYMODE, 4)), _003CModule_003E.ConvertWindowsFormatToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DDISPLAYMODE, _D3DFORMAT>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DDISPLAYMODE, 12))));
331 }
332 else
333 {
334 displayMode._width = *(int*)(&d3DDISPLAYMODE);
335 _displayMode._height = System.Runtime.CompilerServices.Unsafe.As<_D3DDISPLAYMODE, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DDISPLAYMODE, 4));
336 _displayMode._format = _003CModule_003E.ConvertWindowsFormatToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DDISPLAYMODE, _D3DFORMAT>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DDISPLAYMODE, 12)));
337 }
338 return _displayMode;
339 }
340 }