639 {
642 int num = *(int*)GraphicsAdapter.pComPtr + 56;
643 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DDEVTYPE, _D3DCAPS9*,
int>)(
int)(*(uint*)num))((nint)GraphicsAdapter.pComPtr, adapter.adapter,
_deviceType, t);
644 if (num2 < 0)
645 {
646 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
647 }
648 if (
_deviceType == (_D3DDEVTYPE)1 && ((uint)(*(
int*)((
byte*)
d3dCaps.t + 28)) & 0x10000u) != 0)
649 {
651 }
653 *(int*)(&d3DPRESENT_PARAMETERS_) = 0;
654
657 fixed (IDirect3DDevice9** ptr = &
pComPtr)
658 {
659 try
660 {
661 int num3 = *(int*)GraphicsAdapter.pComPtr + 64;
662 int num4 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DDEVTYPE, HWND__*, uint, _D3DPRESENT_PARAMETERS_*, IDirect3DDevice9**,
int>)(
int)(*(uint*)num3))((nint)GraphicsAdapter.pComPtr, adapter.adapter,
_deviceType, (HWND__*)(
int)
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DPRESENT_PARAMETERS_, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DPRESENT_PARAMETERS_, 28)),
_creationFlags, &d3DPRESENT_PARAMETERS_, ptr);
663 if (num4 < 0)
664 {
665 throw GraphicsHelpers.GetExceptionFromResult((uint)num4);
666 }
667 }
668 catch
669 {
670
671 ptr = null;
672 throw;
673 }
674 }
675 StateTrackerDevice* ptr2 = (StateTrackerDevice*)_003CModule_003E.@
new(144u, (nothrow_t*)
System.
Runtime.
CompilerServices.
Unsafe.AsPointer(ref _003CModule_003E.std_002Enothrow));
676 StateTrackerDevice* ptr3;
677 try
678 {
679 if (ptr2 != null)
680 {
682 ptr3 = _003CModule_003E.Microsoft_002EXna_002EFramework_002EGraphics_002EStateTrackerDevice_002E_007Bctor_007D(ptr2,
pComPtr, profileCapabilities.VertexShaderVersion, profileCapabilities.PixelShaderVersion);
683 }
684 else
685 {
686 ptr3 = null;
687 }
688 }
689 catch
690 {
691
693 throw;
694 }
696 if (ptr3 == null)
697 {
699 }
702 {
703 IDirect3DQuery9* ptr4 = null;
704 IDirect3DDevice9* ptr5 =
pComPtr;
705 int num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DQUERYTYPE, IDirect3DQuery9**,
int>)(
int)(*(uint*)(*(
int*)ptr5 + 472)))((nint)ptr5, (_D3DQUERYTYPE)9, &ptr4);
706 if (ptr4 != null)
707 {
708 IDirect3DQuery9* intPtr = ptr4;
709 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)intPtr + 8)))((nint)intPtr);
710 ptr4 = null;
711 }
712 if (num5 < 0)
713 {
715 if (ptr6 != null)
716 {
717 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)ptr6 + 8)))((nint)ptr6);
719 }
720 IDirect3DDevice9* ptr7 =
pComPtr;
721 if (ptr7 != null)
722 {
723 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)ptr7 + 8)))((nint)ptr7);
725 }
727 }
728 }
729 try
730 {
731 return;
732 }
733 catch
734 {
735
736 throw;
737 }
738 }
readonly EmbeddedNativeType_003C_D3DCAPS9_003E d3dCaps
unsafe StateTrackerDevice * pStateTracker
ProfileCapabilities _profileCapabilities
unsafe void ConvertPresentationParametersToManaged(_D3DPRESENT_PARAMETERS_ *pp, PresentationParameters presentationParameters)
unsafe void ConvertPresentationParametersToNative(GraphicsAdapter adapter, PresentationParameters presentationParameters, _D3DPRESENT_PARAMETERS_ *pp)
unsafe IDirect3DDevice9 * pComPtr
void ThrowNotSupportedException(string message)
static unsafe void InitBlock(void *startAddress, byte value, uint byteCount)