Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of OverlayDearImGui Shared v2.0.0
plugins/OverlayDearImGui.Shared/ImGui.NET.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: InternalsVisibleTo("ImPlot.NET")] [assembly: InternalsVisibleTo("ImNodes.NET")] [assembly: AssemblyCompany("Eric Mellino")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A .NET wrapper for the Dear ImGui library.")] [assembly: AssemblyFileVersion("1.90.1.1")] [assembly: AssemblyInformationalVersion("1.0.0+94d483978526a3cf3ae9161d5029f1ee00412879")] [assembly: AssemblyProduct("ImGui.NET")] [assembly: AssemblyTitle("ImGui.NET")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.90.1.1")] [module: UnverifiableCode] namespace ImGuiNET; public delegate void Platform_CreateWindow(ImGuiViewportPtr vp); public delegate void Platform_DestroyWindow(ImGuiViewportPtr vp); public delegate void Platform_ShowWindow(ImGuiViewportPtr vp); public delegate void Platform_SetWindowPos(ImGuiViewportPtr vp, Vector2 pos); public unsafe delegate void Platform_GetWindowPos(ImGuiViewportPtr vp, Vector2* outPos); public delegate void Platform_SetWindowSize(ImGuiViewportPtr vp, Vector2 size); public unsafe delegate void Platform_GetWindowSize(ImGuiViewportPtr vp, Vector2* outSize); public delegate void Platform_SetWindowFocus(ImGuiViewportPtr vp); public delegate byte Platform_GetWindowFocus(ImGuiViewportPtr vp); public delegate byte Platform_GetWindowMinimized(ImGuiViewportPtr vp); public delegate void Platform_SetWindowTitle(ImGuiViewportPtr vp, IntPtr title); public struct ImColor { public Vector4 Value; } public struct ImColorPtr { public unsafe ImColor* NativePtr { get; } public unsafe ref Vector4 Value => ref Unsafe.AsRef<Vector4>(&NativePtr->Value); public unsafe ImColorPtr(ImColor* nativePtr) { NativePtr = nativePtr; } public unsafe ImColorPtr(IntPtr nativePtr) { NativePtr = (ImColor*)(void*)nativePtr; } public unsafe static implicit operator ImColorPtr(ImColor* nativePtr) { return new ImColorPtr(nativePtr); } public unsafe static implicit operator ImColor*(ImColorPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImColorPtr(IntPtr nativePtr) { return new ImColorPtr(nativePtr); } public unsafe void Destroy() { ImGuiNative.ImColor_destroy(NativePtr); } public unsafe ImColor HSV(float h, float s, float v) { float a = 1f; ImColor result = default(ImColor); ImGuiNative.ImColor_HSV(&result, h, s, v, a); return result; } public unsafe ImColor HSV(float h, float s, float v, float a) { ImColor result = default(ImColor); ImGuiNative.ImColor_HSV(&result, h, s, v, a); return result; } public unsafe void SetHSV(float h, float s, float v) { float a = 1f; ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); } public unsafe void SetHSV(float h, float s, float v, float a) { ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); } } public struct ImDrawChannel { public ImVector _CmdBuffer; public ImVector _IdxBuffer; } public struct ImDrawChannelPtr { public unsafe ImDrawChannel* NativePtr { get; } public unsafe ImPtrVector<ImDrawCmdPtr> _CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->_CmdBuffer, Unsafe.SizeOf<ImDrawCmd>()); public unsafe ImVector<ushort> _IdxBuffer => new ImVector<ushort>(NativePtr->_IdxBuffer); public unsafe ImDrawChannelPtr(ImDrawChannel* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawChannelPtr(IntPtr nativePtr) { NativePtr = (ImDrawChannel*)(void*)nativePtr; } public unsafe static implicit operator ImDrawChannelPtr(ImDrawChannel* nativePtr) { return new ImDrawChannelPtr(nativePtr); } public unsafe static implicit operator ImDrawChannel*(ImDrawChannelPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawChannelPtr(IntPtr nativePtr) { return new ImDrawChannelPtr(nativePtr); } } public struct ImDrawCmd { public Vector4 ClipRect; public IntPtr TextureId; public uint VtxOffset; public uint IdxOffset; public uint ElemCount; public IntPtr UserCallback; public unsafe void* UserCallbackData; } public struct ImDrawCmdPtr { public unsafe ImDrawCmd* NativePtr { get; } public unsafe ref Vector4 ClipRect => ref Unsafe.AsRef<Vector4>(&NativePtr->ClipRect); public unsafe ref IntPtr TextureId => ref Unsafe.AsRef<IntPtr>(&NativePtr->TextureId); public unsafe ref uint VtxOffset => ref Unsafe.AsRef<uint>(&NativePtr->VtxOffset); public unsafe ref uint IdxOffset => ref Unsafe.AsRef<uint>(&NativePtr->IdxOffset); public unsafe ref uint ElemCount => ref Unsafe.AsRef<uint>(&NativePtr->ElemCount); public unsafe ref IntPtr UserCallback => ref Unsafe.AsRef<IntPtr>(&NativePtr->UserCallback); public unsafe IntPtr UserCallbackData { get { return (IntPtr)NativePtr->UserCallbackData; } set { NativePtr->UserCallbackData = (void*)value; } } public unsafe ImDrawCmdPtr(ImDrawCmd* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawCmdPtr(IntPtr nativePtr) { NativePtr = (ImDrawCmd*)(void*)nativePtr; } public unsafe static implicit operator ImDrawCmdPtr(ImDrawCmd* nativePtr) { return new ImDrawCmdPtr(nativePtr); } public unsafe static implicit operator ImDrawCmd*(ImDrawCmdPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawCmdPtr(IntPtr nativePtr) { return new ImDrawCmdPtr(nativePtr); } public unsafe void Destroy() { ImGuiNative.ImDrawCmd_destroy(NativePtr); } public unsafe IntPtr GetTexID() { return ImGuiNative.ImDrawCmd_GetTexID(NativePtr); } } public struct ImDrawCmdHeader { public Vector4 ClipRect; public IntPtr TextureId; public uint VtxOffset; } public struct ImDrawCmdHeaderPtr { public unsafe ImDrawCmdHeader* NativePtr { get; } public unsafe ref Vector4 ClipRect => ref Unsafe.AsRef<Vector4>(&NativePtr->ClipRect); public unsafe ref IntPtr TextureId => ref Unsafe.AsRef<IntPtr>(&NativePtr->TextureId); public unsafe ref uint VtxOffset => ref Unsafe.AsRef<uint>(&NativePtr->VtxOffset); public unsafe ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawCmdHeaderPtr(IntPtr nativePtr) { NativePtr = (ImDrawCmdHeader*)(void*)nativePtr; } public unsafe static implicit operator ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr) { return new ImDrawCmdHeaderPtr(nativePtr); } public unsafe static implicit operator ImDrawCmdHeader*(ImDrawCmdHeaderPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawCmdHeaderPtr(IntPtr nativePtr) { return new ImDrawCmdHeaderPtr(nativePtr); } } public struct ImDrawData { public byte Valid; public int CmdListsCount; public int TotalIdxCount; public int TotalVtxCount; public ImVector CmdLists; public Vector2 DisplayPos; public Vector2 DisplaySize; public Vector2 FramebufferScale; public unsafe ImGuiViewport* OwnerViewport; } public struct ImDrawDataPtr { public unsafe ImDrawData* NativePtr { get; } public unsafe ref bool Valid => ref Unsafe.AsRef<bool>(&NativePtr->Valid); public unsafe ref int CmdListsCount => ref Unsafe.AsRef<int>(&NativePtr->CmdListsCount); public unsafe ref int TotalIdxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalIdxCount); public unsafe ref int TotalVtxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalVtxCount); public unsafe ImVector<ImDrawListPtr> CmdLists => new ImVector<ImDrawListPtr>(NativePtr->CmdLists); public unsafe ref Vector2 DisplayPos => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayPos); public unsafe ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize); public unsafe ref Vector2 FramebufferScale => ref Unsafe.AsRef<Vector2>(&NativePtr->FramebufferScale); public unsafe ImGuiViewportPtr OwnerViewport => new ImGuiViewportPtr(NativePtr->OwnerViewport); public unsafe ImDrawDataPtr(ImDrawData* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawDataPtr(IntPtr nativePtr) { NativePtr = (ImDrawData*)(void*)nativePtr; } public unsafe static implicit operator ImDrawDataPtr(ImDrawData* nativePtr) { return new ImDrawDataPtr(nativePtr); } public unsafe static implicit operator ImDrawData*(ImDrawDataPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawDataPtr(IntPtr nativePtr) { return new ImDrawDataPtr(nativePtr); } public unsafe void AddDrawList(ImDrawListPtr draw_list) { ImDrawList* nativePtr = draw_list.NativePtr; ImGuiNative.ImDrawData_AddDrawList(NativePtr, nativePtr); } public unsafe void Clear() { ImGuiNative.ImDrawData_Clear(NativePtr); } public unsafe void DeIndexAllBuffers() { ImGuiNative.ImDrawData_DeIndexAllBuffers(NativePtr); } public unsafe void Destroy() { ImGuiNative.ImDrawData_destroy(NativePtr); } public unsafe void ScaleClipRects(Vector2 fb_scale) { ImGuiNative.ImDrawData_ScaleClipRects(NativePtr, fb_scale); } } [Flags] public enum ImDrawFlags { None = 0, Closed = 1, RoundCornersTopLeft = 0x10, RoundCornersTopRight = 0x20, RoundCornersBottomLeft = 0x40, RoundCornersBottomRight = 0x80, RoundCornersNone = 0x100, RoundCornersTop = 0x30, RoundCornersBottom = 0xC0, RoundCornersLeft = 0x50, RoundCornersRight = 0xA0, RoundCornersAll = 0xF0, RoundCornersDefault = 0xF0, RoundCornersMask = 0x1F0 } public struct ImDrawList { public ImVector CmdBuffer; public ImVector IdxBuffer; public ImVector VtxBuffer; public ImDrawListFlags Flags; public uint _VtxCurrentIdx; public IntPtr _Data; public unsafe byte* _OwnerName; public unsafe ImDrawVert* _VtxWritePtr; public unsafe ushort* _IdxWritePtr; public ImVector _ClipRectStack; public ImVector _TextureIdStack; public ImVector _Path; public ImDrawCmdHeader _CmdHeader; public ImDrawListSplitter _Splitter; public float _FringeScale; } public struct ImDrawListPtr { public unsafe ImDrawList* NativePtr { get; } public unsafe ImPtrVector<ImDrawCmdPtr> CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->CmdBuffer, Unsafe.SizeOf<ImDrawCmd>()); public unsafe ImVector<ushort> IdxBuffer => new ImVector<ushort>(NativePtr->IdxBuffer); public unsafe ImPtrVector<ImDrawVertPtr> VtxBuffer => new ImPtrVector<ImDrawVertPtr>(NativePtr->VtxBuffer, Unsafe.SizeOf<ImDrawVert>()); public unsafe ref ImDrawListFlags Flags => ref Unsafe.AsRef<ImDrawListFlags>(&NativePtr->Flags); public unsafe ref uint _VtxCurrentIdx => ref Unsafe.AsRef<uint>(&NativePtr->_VtxCurrentIdx); public unsafe ref IntPtr _Data => ref Unsafe.AsRef<IntPtr>(&NativePtr->_Data); public unsafe NullTerminatedString _OwnerName => new NullTerminatedString(NativePtr->_OwnerName); public unsafe ImDrawVertPtr _VtxWritePtr => new ImDrawVertPtr(NativePtr->_VtxWritePtr); public unsafe IntPtr _IdxWritePtr { get { return (IntPtr)NativePtr->_IdxWritePtr; } set { NativePtr->_IdxWritePtr = (ushort*)(void*)value; } } public unsafe ImVector<Vector4> _ClipRectStack => new ImVector<Vector4>(NativePtr->_ClipRectStack); public unsafe ImVector<IntPtr> _TextureIdStack => new ImVector<IntPtr>(NativePtr->_TextureIdStack); public unsafe ImVector<Vector2> _Path => new ImVector<Vector2>(NativePtr->_Path); public unsafe ref ImDrawCmdHeader _CmdHeader => ref Unsafe.AsRef<ImDrawCmdHeader>(&NativePtr->_CmdHeader); public unsafe ref ImDrawListSplitter _Splitter => ref Unsafe.AsRef<ImDrawListSplitter>(&NativePtr->_Splitter); public unsafe ref float _FringeScale => ref Unsafe.AsRef<float>(&NativePtr->_FringeScale); public unsafe ImDrawListPtr(ImDrawList* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawListPtr(IntPtr nativePtr) { NativePtr = (ImDrawList*)(void*)nativePtr; } public unsafe static implicit operator ImDrawListPtr(ImDrawList* nativePtr) { return new ImDrawListPtr(nativePtr); } public unsafe static implicit operator ImDrawList*(ImDrawListPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawListPtr(IntPtr nativePtr) { return new ImDrawListPtr(nativePtr); } public unsafe int _CalcCircleAutoSegmentCount(float radius) { return ImGuiNative.ImDrawList__CalcCircleAutoSegmentCount(NativePtr, radius); } public unsafe void _ClearFreeMemory() { ImGuiNative.ImDrawList__ClearFreeMemory(NativePtr); } public unsafe void _OnChangedClipRect() { ImGuiNative.ImDrawList__OnChangedClipRect(NativePtr); } public unsafe void _OnChangedTextureID() { ImGuiNative.ImDrawList__OnChangedTextureID(NativePtr); } public unsafe void _OnChangedVtxOffset() { ImGuiNative.ImDrawList__OnChangedVtxOffset(NativePtr); } public unsafe void _PathArcToFastEx(Vector2 center, float radius, int a_min_sample, int a_max_sample, int a_step) { ImGuiNative.ImDrawList__PathArcToFastEx(NativePtr, center, radius, a_min_sample, a_max_sample, a_step); } public unsafe void _PathArcToN(Vector2 center, float radius, float a_min, float a_max, int num_segments) { ImGuiNative.ImDrawList__PathArcToN(NativePtr, center, radius, a_min, a_max, num_segments); } public unsafe void _PopUnusedDrawCmd() { ImGuiNative.ImDrawList__PopUnusedDrawCmd(NativePtr); } public unsafe void _ResetForNewFrame() { ImGuiNative.ImDrawList__ResetForNewFrame(NativePtr); } public unsafe void _TryMergeDrawCmds() { ImGuiNative.ImDrawList__TryMergeDrawCmds(NativePtr); } public unsafe void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness) { int num_segments = 0; ImGuiNative.ImDrawList_AddBezierCubic(NativePtr, p1, p2, p3, p4, col, thickness, num_segments); } public unsafe void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness, int num_segments) { ImGuiNative.ImDrawList_AddBezierCubic(NativePtr, p1, p2, p3, p4, col, thickness, num_segments); } public unsafe void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness) { int num_segments = 0; ImGuiNative.ImDrawList_AddBezierQuadratic(NativePtr, p1, p2, p3, col, thickness, num_segments); } public unsafe void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness, int num_segments) { ImGuiNative.ImDrawList_AddBezierQuadratic(NativePtr, p1, p2, p3, col, thickness, num_segments); } public unsafe void AddCallback(IntPtr callback, IntPtr callback_data) { void* callback_data2 = callback_data.ToPointer(); ImGuiNative.ImDrawList_AddCallback(NativePtr, callback, callback_data2); } public unsafe void AddCircle(Vector2 center, float radius, uint col) { int num_segments = 0; float thickness = 1f; ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness); } public unsafe void AddCircle(Vector2 center, float radius, uint col, int num_segments) { float thickness = 1f; ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness); } public unsafe void AddCircle(Vector2 center, float radius, uint col, int num_segments, float thickness) { ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness); } public unsafe void AddCircleFilled(Vector2 center, float radius, uint col) { int num_segments = 0; ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, center, radius, col, num_segments); } public unsafe void AddCircleFilled(Vector2 center, float radius, uint col, int num_segments) { ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, center, radius, col, num_segments); } public unsafe void AddConvexPolyFilled(ref Vector2 points, int num_points, uint col) { fixed (Vector2* points2 = &points) { ImGuiNative.ImDrawList_AddConvexPolyFilled(NativePtr, points2, num_points, col); } } public unsafe void AddDrawCmd() { ImGuiNative.ImDrawList_AddDrawCmd(NativePtr); } public unsafe void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col) { float rot = 0f; int num_segments = 0; float thickness = 1f; ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius_x, radius_y, col, rot, num_segments, thickness); } public unsafe void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot) { int num_segments = 0; float thickness = 1f; ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius_x, radius_y, col, rot, num_segments, thickness); } public unsafe void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments) { float thickness = 1f; ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius_x, radius_y, col, rot, num_segments, thickness); } public unsafe void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments, float thickness) { ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius_x, radius_y, col, rot, num_segments, thickness); } public unsafe void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col) { float rot = 0f; int num_segments = 0; ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius_x, radius_y, col, rot, num_segments); } public unsafe void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col, float rot) { int num_segments = 0; ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius_x, radius_y, col, rot, num_segments); } public unsafe void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments) { ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius_x, radius_y, col, rot, num_segments); } public unsafe void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max) { Vector2 uv_min = default(Vector2); Vector2 uv_max = new Vector2(1f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col); } public unsafe void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min) { Vector2 uv_max = new Vector2(1f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col); } public unsafe void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max) { uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col); } public unsafe void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col) { ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4) { Vector2 uv = default(Vector2); Vector2 uv2 = new Vector2(1f, 0f); Vector2 uv3 = new Vector2(1f, 1f); Vector2 uv4 = new Vector2(0f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv, uv2, uv3, uv4, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1) { Vector2 uv2 = new Vector2(1f, 0f); Vector2 uv3 = new Vector2(1f, 1f); Vector2 uv4 = new Vector2(0f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2) { Vector2 uv3 = new Vector2(1f, 1f); Vector2 uv4 = new Vector2(0f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3) { Vector2 uv4 = new Vector2(0f, 1f); uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4) { uint col = uint.MaxValue; ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); } public unsafe void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4, uint col) { ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); } public unsafe void AddImageRounded(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding) { ImDrawFlags flags = ImDrawFlags.None; ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags); } public unsafe void AddImageRounded(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding, ImDrawFlags flags) { ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags); } public unsafe void AddLine(Vector2 p1, Vector2 p2, uint col) { float thickness = 1f; ImGuiNative.ImDrawList_AddLine(NativePtr, p1, p2, col, thickness); } public unsafe void AddLine(Vector2 p1, Vector2 p2, uint col, float thickness) { ImGuiNative.ImDrawList_AddLine(NativePtr, p1, p2, col, thickness); } public unsafe void AddNgon(Vector2 center, float radius, uint col, int num_segments) { float thickness = 1f; ImGuiNative.ImDrawList_AddNgon(NativePtr, center, radius, col, num_segments, thickness); } public unsafe void AddNgon(Vector2 center, float radius, uint col, int num_segments, float thickness) { ImGuiNative.ImDrawList_AddNgon(NativePtr, center, radius, col, num_segments, thickness); } public unsafe void AddNgonFilled(Vector2 center, float radius, uint col, int num_segments) { ImGuiNative.ImDrawList_AddNgonFilled(NativePtr, center, radius, col, num_segments); } public unsafe void AddPolyline(ref Vector2 points, int num_points, uint col, ImDrawFlags flags, float thickness) { fixed (Vector2* points2 = &points) { ImGuiNative.ImDrawList_AddPolyline(NativePtr, points2, num_points, col, flags, thickness); } } public unsafe void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col) { float thickness = 1f; ImGuiNative.ImDrawList_AddQuad(NativePtr, p1, p2, p3, p4, col, thickness); } public unsafe void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness) { ImGuiNative.ImDrawList_AddQuad(NativePtr, p1, p2, p3, p4, col, thickness); } public unsafe void AddQuadFilled(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col) { ImGuiNative.ImDrawList_AddQuadFilled(NativePtr, p1, p2, p3, p4, col); } public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col) { float rounding = 0f; ImDrawFlags flags = ImDrawFlags.None; float thickness = 1f; ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness); } public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding) { ImDrawFlags flags = ImDrawFlags.None; float thickness = 1f; ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness); } public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags) { float thickness = 1f; ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness); } public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags, float thickness) { ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness); } public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col) { float rounding = 0f; ImDrawFlags flags = ImDrawFlags.None; ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags); } public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding) { ImDrawFlags flags = ImDrawFlags.None; ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags); } public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags) { ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags); } public unsafe void AddRectFilledMultiColor(Vector2 p_min, Vector2 p_max, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left) { ImGuiNative.ImDrawList_AddRectFilledMultiColor(NativePtr, p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left); } public unsafe void AddText(Vector2 pos, uint col, string text_begin) { int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; ImGuiNative.ImDrawList_AddText_Vec2(NativePtr, pos, col, ptr, ptr + num); if (num > 2048) { Util.Free(ptr); } } public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin) { ImFont* nativePtr = font.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; float wrap_width = 0f; Vector4* cpu_fine_clip_rect = null; ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect); if (num > 2048) { Util.Free(ptr); } } public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width) { ImFont* nativePtr = font.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; Vector4* cpu_fine_clip_rect = null; ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect); if (num > 2048) { Util.Free(ptr); } } public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width, ref Vector4 cpu_fine_clip_rect) { ImFont* nativePtr = font.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; fixed (Vector4* cpu_fine_clip_rect2 = &cpu_fine_clip_rect) { ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect2); if (num > 2048) { Util.Free(ptr); } } } public unsafe void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col) { float thickness = 1f; ImGuiNative.ImDrawList_AddTriangle(NativePtr, p1, p2, p3, col, thickness); } public unsafe void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness) { ImGuiNative.ImDrawList_AddTriangle(NativePtr, p1, p2, p3, col, thickness); } public unsafe void AddTriangleFilled(Vector2 p1, Vector2 p2, Vector2 p3, uint col) { ImGuiNative.ImDrawList_AddTriangleFilled(NativePtr, p1, p2, p3, col); } public unsafe void ChannelsMerge() { ImGuiNative.ImDrawList_ChannelsMerge(NativePtr); } public unsafe void ChannelsSetCurrent(int n) { ImGuiNative.ImDrawList_ChannelsSetCurrent(NativePtr, n); } public unsafe void ChannelsSplit(int count) { ImGuiNative.ImDrawList_ChannelsSplit(NativePtr, count); } public unsafe ImDrawListPtr CloneOutput() { return new ImDrawListPtr(ImGuiNative.ImDrawList_CloneOutput(NativePtr)); } public unsafe void Destroy() { ImGuiNative.ImDrawList_destroy(NativePtr); } public unsafe Vector2 GetClipRectMax() { Vector2 result = default(Vector2); ImGuiNative.ImDrawList_GetClipRectMax(&result, NativePtr); return result; } public unsafe Vector2 GetClipRectMin() { Vector2 result = default(Vector2); ImGuiNative.ImDrawList_GetClipRectMin(&result, NativePtr); return result; } public unsafe void PathArcTo(Vector2 center, float radius, float a_min, float a_max) { int num_segments = 0; ImGuiNative.ImDrawList_PathArcTo(NativePtr, center, radius, a_min, a_max, num_segments); } public unsafe void PathArcTo(Vector2 center, float radius, float a_min, float a_max, int num_segments) { ImGuiNative.ImDrawList_PathArcTo(NativePtr, center, radius, a_min, a_max, num_segments); } public unsafe void PathArcToFast(Vector2 center, float radius, int a_min_of_12, int a_max_of_12) { ImGuiNative.ImDrawList_PathArcToFast(NativePtr, center, radius, a_min_of_12, a_max_of_12); } public unsafe void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4) { int num_segments = 0; ImGuiNative.ImDrawList_PathBezierCubicCurveTo(NativePtr, p2, p3, p4, num_segments); } public unsafe void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4, int num_segments) { ImGuiNative.ImDrawList_PathBezierCubicCurveTo(NativePtr, p2, p3, p4, num_segments); } public unsafe void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3) { int num_segments = 0; ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo(NativePtr, p2, p3, num_segments); } public unsafe void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3, int num_segments) { ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo(NativePtr, p2, p3, num_segments); } public unsafe void PathClear() { ImGuiNative.ImDrawList_PathClear(NativePtr); } public unsafe void PathEllipticalArcTo(Vector2 center, float radius_x, float radius_y, float rot, float a_min, float a_max) { int num_segments = 0; ImGuiNative.ImDrawList_PathEllipticalArcTo(NativePtr, center, radius_x, radius_y, rot, a_min, a_max, num_segments); } public unsafe void PathEllipticalArcTo(Vector2 center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments) { ImGuiNative.ImDrawList_PathEllipticalArcTo(NativePtr, center, radius_x, radius_y, rot, a_min, a_max, num_segments); } public unsafe void PathFillConvex(uint col) { ImGuiNative.ImDrawList_PathFillConvex(NativePtr, col); } public unsafe void PathLineTo(Vector2 pos) { ImGuiNative.ImDrawList_PathLineTo(NativePtr, pos); } public unsafe void PathLineToMergeDuplicate(Vector2 pos) { ImGuiNative.ImDrawList_PathLineToMergeDuplicate(NativePtr, pos); } public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max) { float rounding = 0f; ImDrawFlags flags = ImDrawFlags.None; ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags); } public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding) { ImDrawFlags flags = ImDrawFlags.None; ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags); } public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding, ImDrawFlags flags) { ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags); } public unsafe void PathStroke(uint col) { ImDrawFlags flags = ImDrawFlags.None; float thickness = 1f; ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness); } public unsafe void PathStroke(uint col, ImDrawFlags flags) { float thickness = 1f; ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness); } public unsafe void PathStroke(uint col, ImDrawFlags flags, float thickness) { ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness); } public unsafe void PopClipRect() { ImGuiNative.ImDrawList_PopClipRect(NativePtr); } public unsafe void PopTextureID() { ImGuiNative.ImDrawList_PopTextureID(NativePtr); } public unsafe void PrimQuadUV(Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col) { ImGuiNative.ImDrawList_PrimQuadUV(NativePtr, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); } public unsafe void PrimRect(Vector2 a, Vector2 b, uint col) { ImGuiNative.ImDrawList_PrimRect(NativePtr, a, b, col); } public unsafe void PrimRectUV(Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col) { ImGuiNative.ImDrawList_PrimRectUV(NativePtr, a, b, uv_a, uv_b, col); } public unsafe void PrimReserve(int idx_count, int vtx_count) { ImGuiNative.ImDrawList_PrimReserve(NativePtr, idx_count, vtx_count); } public unsafe void PrimUnreserve(int idx_count, int vtx_count) { ImGuiNative.ImDrawList_PrimUnreserve(NativePtr, idx_count, vtx_count); } public unsafe void PrimVtx(Vector2 pos, Vector2 uv, uint col) { ImGuiNative.ImDrawList_PrimVtx(NativePtr, pos, uv, col); } public unsafe void PrimWriteIdx(ushort idx) { ImGuiNative.ImDrawList_PrimWriteIdx(NativePtr, idx); } public unsafe void PrimWriteVtx(Vector2 pos, Vector2 uv, uint col) { ImGuiNative.ImDrawList_PrimWriteVtx(NativePtr, pos, uv, col); } public unsafe void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max) { byte intersect_with_current_clip_rect = 0; ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect); } public unsafe void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max, bool intersect_with_current_clip_rect) { byte intersect_with_current_clip_rect2 = (intersect_with_current_clip_rect ? ((byte)1) : ((byte)0)); ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect2); } public unsafe void PushClipRectFullScreen() { ImGuiNative.ImDrawList_PushClipRectFullScreen(NativePtr); } public unsafe void PushTextureID(IntPtr texture_id) { ImGuiNative.ImDrawList_PushTextureID(NativePtr, texture_id); } } [Flags] public enum ImDrawListFlags { None = 0, AntiAliasedLines = 1, AntiAliasedLinesUseTex = 2, AntiAliasedFill = 4, AllowVtxOffset = 8 } public struct ImDrawListSplitter { public int _Current; public int _Count; public ImVector _Channels; } public struct ImDrawListSplitterPtr { public unsafe ImDrawListSplitter* NativePtr { get; } public unsafe ref int _Current => ref Unsafe.AsRef<int>(&NativePtr->_Current); public unsafe ref int _Count => ref Unsafe.AsRef<int>(&NativePtr->_Count); public unsafe ImPtrVector<ImDrawChannelPtr> _Channels => new ImPtrVector<ImDrawChannelPtr>(NativePtr->_Channels, Unsafe.SizeOf<ImDrawChannel>()); public unsafe ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawListSplitterPtr(IntPtr nativePtr) { NativePtr = (ImDrawListSplitter*)(void*)nativePtr; } public unsafe static implicit operator ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr) { return new ImDrawListSplitterPtr(nativePtr); } public unsafe static implicit operator ImDrawListSplitter*(ImDrawListSplitterPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawListSplitterPtr(IntPtr nativePtr) { return new ImDrawListSplitterPtr(nativePtr); } public unsafe void Clear() { ImGuiNative.ImDrawListSplitter_Clear(NativePtr); } public unsafe void ClearFreeMemory() { ImGuiNative.ImDrawListSplitter_ClearFreeMemory(NativePtr); } public unsafe void Destroy() { ImGuiNative.ImDrawListSplitter_destroy(NativePtr); } public unsafe void Merge(ImDrawListPtr draw_list) { ImDrawList* nativePtr = draw_list.NativePtr; ImGuiNative.ImDrawListSplitter_Merge(NativePtr, nativePtr); } public unsafe void SetCurrentChannel(ImDrawListPtr draw_list, int channel_idx) { ImDrawList* nativePtr = draw_list.NativePtr; ImGuiNative.ImDrawListSplitter_SetCurrentChannel(NativePtr, nativePtr, channel_idx); } public unsafe void Split(ImDrawListPtr draw_list, int count) { ImDrawList* nativePtr = draw_list.NativePtr; ImGuiNative.ImDrawListSplitter_Split(NativePtr, nativePtr, count); } } public struct ImDrawVert { public Vector2 pos; public Vector2 uv; public uint col; } public struct ImDrawVertPtr { public unsafe ImDrawVert* NativePtr { get; } public unsafe ref Vector2 pos => ref Unsafe.AsRef<Vector2>(&NativePtr->pos); public unsafe ref Vector2 uv => ref Unsafe.AsRef<Vector2>(&NativePtr->uv); public unsafe ref uint col => ref Unsafe.AsRef<uint>(&NativePtr->col); public unsafe ImDrawVertPtr(ImDrawVert* nativePtr) { NativePtr = nativePtr; } public unsafe ImDrawVertPtr(IntPtr nativePtr) { NativePtr = (ImDrawVert*)(void*)nativePtr; } public unsafe static implicit operator ImDrawVertPtr(ImDrawVert* nativePtr) { return new ImDrawVertPtr(nativePtr); } public unsafe static implicit operator ImDrawVert*(ImDrawVertPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImDrawVertPtr(IntPtr nativePtr) { return new ImDrawVertPtr(nativePtr); } } public struct ImFont { public ImVector IndexAdvanceX; public float FallbackAdvanceX; public float FontSize; public ImVector IndexLookup; public ImVector Glyphs; public unsafe ImFontGlyph* FallbackGlyph; public unsafe ImFontAtlas* ContainerAtlas; public unsafe ImFontConfig* ConfigData; public short ConfigDataCount; public ushort FallbackChar; public ushort EllipsisChar; public short EllipsisCharCount; public float EllipsisWidth; public float EllipsisCharStep; public byte DirtyLookupTables; public float Scale; public float Ascent; public float Descent; public int MetricsTotalSurface; public unsafe fixed byte Used4kPagesMap[2]; } public struct ImFontPtr { public unsafe ImFont* NativePtr { get; } public unsafe ImVector<float> IndexAdvanceX => new ImVector<float>(NativePtr->IndexAdvanceX); public unsafe ref float FallbackAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->FallbackAdvanceX); public unsafe ref float FontSize => ref Unsafe.AsRef<float>(&NativePtr->FontSize); public unsafe ImVector<ushort> IndexLookup => new ImVector<ushort>(NativePtr->IndexLookup); public unsafe ImPtrVector<ImFontGlyphPtr> Glyphs => new ImPtrVector<ImFontGlyphPtr>(NativePtr->Glyphs, Unsafe.SizeOf<ImFontGlyph>()); public unsafe ImFontGlyphPtr FallbackGlyph => new ImFontGlyphPtr(NativePtr->FallbackGlyph); public unsafe ImFontAtlasPtr ContainerAtlas => new ImFontAtlasPtr(NativePtr->ContainerAtlas); public unsafe ImFontConfigPtr ConfigData => new ImFontConfigPtr(NativePtr->ConfigData); public unsafe ref short ConfigDataCount => ref Unsafe.AsRef<short>(&NativePtr->ConfigDataCount); public unsafe ref ushort FallbackChar => ref Unsafe.AsRef<ushort>(&NativePtr->FallbackChar); public unsafe ref ushort EllipsisChar => ref Unsafe.AsRef<ushort>(&NativePtr->EllipsisChar); public unsafe ref short EllipsisCharCount => ref Unsafe.AsRef<short>(&NativePtr->EllipsisCharCount); public unsafe ref float EllipsisWidth => ref Unsafe.AsRef<float>(&NativePtr->EllipsisWidth); public unsafe ref float EllipsisCharStep => ref Unsafe.AsRef<float>(&NativePtr->EllipsisCharStep); public unsafe ref bool DirtyLookupTables => ref Unsafe.AsRef<bool>(&NativePtr->DirtyLookupTables); public unsafe ref float Scale => ref Unsafe.AsRef<float>(&NativePtr->Scale); public unsafe ref float Ascent => ref Unsafe.AsRef<float>(&NativePtr->Ascent); public unsafe ref float Descent => ref Unsafe.AsRef<float>(&NativePtr->Descent); public unsafe ref int MetricsTotalSurface => ref Unsafe.AsRef<int>(&NativePtr->MetricsTotalSurface); public unsafe RangeAccessor<byte> Used4kPagesMap => new RangeAccessor<byte>(NativePtr->Used4kPagesMap, 2); public unsafe ImFontPtr(ImFont* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontPtr(IntPtr nativePtr) { NativePtr = (ImFont*)(void*)nativePtr; } public unsafe static implicit operator ImFontPtr(ImFont* nativePtr) { return new ImFontPtr(nativePtr); } public unsafe static implicit operator ImFont*(ImFontPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontPtr(IntPtr nativePtr) { return new ImFontPtr(nativePtr); } public unsafe void AddGlyph(ImFontConfigPtr src_cfg, ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x) { ImFontConfig* nativePtr = src_cfg.NativePtr; ImGuiNative.ImFont_AddGlyph(NativePtr, nativePtr, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x); } public unsafe void AddRemapChar(ushort dst, ushort src) { byte overwrite_dst = 1; ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, overwrite_dst); } public unsafe void AddRemapChar(ushort dst, ushort src, bool overwrite_dst) { byte overwrite_dst2 = (overwrite_dst ? ((byte)1) : ((byte)0)); ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, overwrite_dst2); } public unsafe void BuildLookupTable() { ImGuiNative.ImFont_BuildLookupTable(NativePtr); } public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin) { int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; byte** remaining = null; Vector2 result = default(Vector2); ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining); if (num > 2048) { Util.Free(ptr); } return result; } public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin, ref byte* remaining) { int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; fixed (byte** remaining2 = &remaining) { Vector2 result = default(Vector2); ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining2); if (num > 2048) { Util.Free(ptr); } return result; } } public unsafe string CalcWordWrapPositionA(float scale, string text, float wrap_width) { int num = 0; byte* ptr; if (text != null) { num = Encoding.UTF8.GetByteCount(text); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte* ptr2 = ImGuiNative.ImFont_CalcWordWrapPositionA(NativePtr, scale, ptr, ptr + num, wrap_width); if (num > 2048) { Util.Free(ptr); } return Util.StringFromPtr(ptr2); } public unsafe void ClearOutputData() { ImGuiNative.ImFont_ClearOutputData(NativePtr); } public unsafe void Destroy() { ImGuiNative.ImFont_destroy(NativePtr); } public unsafe ImFontGlyphPtr FindGlyph(ushort c) { return new ImFontGlyphPtr(ImGuiNative.ImFont_FindGlyph(NativePtr, c)); } public unsafe ImFontGlyphPtr FindGlyphNoFallback(ushort c) { return new ImFontGlyphPtr(ImGuiNative.ImFont_FindGlyphNoFallback(NativePtr, c)); } public unsafe float GetCharAdvance(ushort c) { return ImGuiNative.ImFont_GetCharAdvance(NativePtr, c); } public unsafe string GetDebugName() { return Util.StringFromPtr(ImGuiNative.ImFont_GetDebugName(NativePtr)); } public unsafe void GrowIndex(int new_size) { ImGuiNative.ImFont_GrowIndex(NativePtr, new_size); } public unsafe bool IsLoaded() { return ImGuiNative.ImFont_IsLoaded(NativePtr) != 0; } public unsafe void RenderChar(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, ushort c) { ImDrawList* nativePtr = draw_list.NativePtr; ImGuiNative.ImFont_RenderChar(NativePtr, nativePtr, size, pos, col, c); } public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin) { ImDrawList* nativePtr = draw_list.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; float wrap_width = 0f; byte cpu_fine_clip = 0; ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip); if (num > 2048) { Util.Free(ptr); } } public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width) { ImDrawList* nativePtr = draw_list.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; byte cpu_fine_clip = 0; ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip); if (num > 2048) { Util.Free(ptr); } } public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width, bool cpu_fine_clip) { ImDrawList* nativePtr = draw_list.NativePtr; int num = 0; num = Encoding.UTF8.GetByteCount(text_begin); byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text_begin, ptr, num); ptr[utf] = 0; byte cpu_fine_clip2 = (cpu_fine_clip ? ((byte)1) : ((byte)0)); ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip2); if (num > 2048) { Util.Free(ptr); } } public unsafe void SetGlyphVisible(ushort c, bool visible) { byte visible2 = (visible ? ((byte)1) : ((byte)0)); ImGuiNative.ImFont_SetGlyphVisible(NativePtr, c, visible2); } } public struct ImFontAtlas { public ImFontAtlasFlags Flags; public IntPtr TexID; public int TexDesiredWidth; public int TexGlyphPadding; public byte Locked; public unsafe void* UserData; public byte TexReady; public byte TexPixelsUseColors; public unsafe byte* TexPixelsAlpha8; public unsafe uint* TexPixelsRGBA32; public int TexWidth; public int TexHeight; public Vector2 TexUvScale; public Vector2 TexUvWhitePixel; public ImVector Fonts; public ImVector CustomRects; public ImVector ConfigData; public Vector4 TexUvLines_0; public Vector4 TexUvLines_1; public Vector4 TexUvLines_2; public Vector4 TexUvLines_3; public Vector4 TexUvLines_4; public Vector4 TexUvLines_5; public Vector4 TexUvLines_6; public Vector4 TexUvLines_7; public Vector4 TexUvLines_8; public Vector4 TexUvLines_9; public Vector4 TexUvLines_10; public Vector4 TexUvLines_11; public Vector4 TexUvLines_12; public Vector4 TexUvLines_13; public Vector4 TexUvLines_14; public Vector4 TexUvLines_15; public Vector4 TexUvLines_16; public Vector4 TexUvLines_17; public Vector4 TexUvLines_18; public Vector4 TexUvLines_19; public Vector4 TexUvLines_20; public Vector4 TexUvLines_21; public Vector4 TexUvLines_22; public Vector4 TexUvLines_23; public Vector4 TexUvLines_24; public Vector4 TexUvLines_25; public Vector4 TexUvLines_26; public Vector4 TexUvLines_27; public Vector4 TexUvLines_28; public Vector4 TexUvLines_29; public Vector4 TexUvLines_30; public Vector4 TexUvLines_31; public Vector4 TexUvLines_32; public Vector4 TexUvLines_33; public Vector4 TexUvLines_34; public Vector4 TexUvLines_35; public Vector4 TexUvLines_36; public Vector4 TexUvLines_37; public Vector4 TexUvLines_38; public Vector4 TexUvLines_39; public Vector4 TexUvLines_40; public Vector4 TexUvLines_41; public Vector4 TexUvLines_42; public Vector4 TexUvLines_43; public Vector4 TexUvLines_44; public Vector4 TexUvLines_45; public Vector4 TexUvLines_46; public Vector4 TexUvLines_47; public Vector4 TexUvLines_48; public Vector4 TexUvLines_49; public Vector4 TexUvLines_50; public Vector4 TexUvLines_51; public Vector4 TexUvLines_52; public Vector4 TexUvLines_53; public Vector4 TexUvLines_54; public Vector4 TexUvLines_55; public Vector4 TexUvLines_56; public Vector4 TexUvLines_57; public Vector4 TexUvLines_58; public Vector4 TexUvLines_59; public Vector4 TexUvLines_60; public Vector4 TexUvLines_61; public Vector4 TexUvLines_62; public Vector4 TexUvLines_63; public unsafe IntPtr* FontBuilderIO; public uint FontBuilderFlags; public int PackIdMouseCursors; public int PackIdLines; } public struct ImFontAtlasPtr { public unsafe ImFontAtlas* NativePtr { get; } public unsafe ref ImFontAtlasFlags Flags => ref Unsafe.AsRef<ImFontAtlasFlags>(&NativePtr->Flags); public unsafe ref IntPtr TexID => ref Unsafe.AsRef<IntPtr>(&NativePtr->TexID); public unsafe ref int TexDesiredWidth => ref Unsafe.AsRef<int>(&NativePtr->TexDesiredWidth); public unsafe ref int TexGlyphPadding => ref Unsafe.AsRef<int>(&NativePtr->TexGlyphPadding); public unsafe ref bool Locked => ref Unsafe.AsRef<bool>(&NativePtr->Locked); public unsafe IntPtr UserData { get { return (IntPtr)NativePtr->UserData; } set { NativePtr->UserData = (void*)value; } } public unsafe ref bool TexReady => ref Unsafe.AsRef<bool>(&NativePtr->TexReady); public unsafe ref bool TexPixelsUseColors => ref Unsafe.AsRef<bool>(&NativePtr->TexPixelsUseColors); public unsafe IntPtr TexPixelsAlpha8 { get { return (IntPtr)NativePtr->TexPixelsAlpha8; } set { NativePtr->TexPixelsAlpha8 = (byte*)(void*)value; } } public unsafe IntPtr TexPixelsRGBA32 { get { return (IntPtr)NativePtr->TexPixelsRGBA32; } set { NativePtr->TexPixelsRGBA32 = (uint*)(void*)value; } } public unsafe ref int TexWidth => ref Unsafe.AsRef<int>(&NativePtr->TexWidth); public unsafe ref int TexHeight => ref Unsafe.AsRef<int>(&NativePtr->TexHeight); public unsafe ref Vector2 TexUvScale => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvScale); public unsafe ref Vector2 TexUvWhitePixel => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvWhitePixel); public unsafe ImVector<ImFontPtr> Fonts => new ImVector<ImFontPtr>(NativePtr->Fonts); public unsafe ImPtrVector<ImFontAtlasCustomRectPtr> CustomRects => new ImPtrVector<ImFontAtlasCustomRectPtr>(NativePtr->CustomRects, Unsafe.SizeOf<ImFontAtlasCustomRect>()); public unsafe ImPtrVector<ImFontConfigPtr> ConfigData => new ImPtrVector<ImFontConfigPtr>(NativePtr->ConfigData, Unsafe.SizeOf<ImFontConfig>()); public unsafe RangeAccessor<Vector4> TexUvLines => new RangeAccessor<Vector4>(&NativePtr->TexUvLines_0, 64); public unsafe IntPtr FontBuilderIO { get { return (IntPtr)NativePtr->FontBuilderIO; } set { NativePtr->FontBuilderIO = (IntPtr*)(void*)value; } } public unsafe ref uint FontBuilderFlags => ref Unsafe.AsRef<uint>(&NativePtr->FontBuilderFlags); public unsafe ref int PackIdMouseCursors => ref Unsafe.AsRef<int>(&NativePtr->PackIdMouseCursors); public unsafe ref int PackIdLines => ref Unsafe.AsRef<int>(&NativePtr->PackIdLines); public unsafe ImFontAtlasPtr(ImFontAtlas* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontAtlasPtr(IntPtr nativePtr) { NativePtr = (ImFontAtlas*)(void*)nativePtr; } public unsafe static implicit operator ImFontAtlasPtr(ImFontAtlas* nativePtr) { return new ImFontAtlasPtr(nativePtr); } public unsafe static implicit operator ImFontAtlas*(ImFontAtlasPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontAtlasPtr(IntPtr nativePtr) { return new ImFontAtlasPtr(nativePtr); } public unsafe int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x) { ImFont* nativePtr = font.NativePtr; return ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, nativePtr, id, width, height, advance_x, default(Vector2)); } public unsafe int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x, Vector2 offset) { ImFont* nativePtr = font.NativePtr; return ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, nativePtr, id, width, height, advance_x, offset); } public unsafe int AddCustomRectRegular(int width, int height) { return ImGuiNative.ImFontAtlas_AddCustomRectRegular(NativePtr, width, height); } public unsafe ImFontPtr AddFont(ImFontConfigPtr font_cfg) { ImFontConfig* nativePtr = font_cfg.NativePtr; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFont(NativePtr, nativePtr)); } public unsafe ImFontPtr AddFontDefault() { ImFontConfig* font_cfg = null; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, font_cfg)); } public unsafe ImFontPtr AddFontDefault(ImFontConfigPtr font_cfg) { ImFontConfig* nativePtr = font_cfg.NativePtr; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, nativePtr)); } public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels) { int num = 0; byte* ptr; if (filename != null) { num = Encoding.UTF8.GetByteCount(filename); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(filename, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* font_cfg = null; ushort* glyph_ranges = null; ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr); } public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg) { int num = 0; byte* ptr; if (filename != null) { num = Encoding.UTF8.GetByteCount(filename); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(filename, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges = null; ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr2); } public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) { int num = 0; byte* ptr; if (filename != null) { num = Encoding.UTF8.GetByteCount(filename); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(filename, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges2 = (ushort*)glyph_ranges.ToPointer(); ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr2); } public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels) { int num = 0; byte* ptr; if (compressed_font_data_base85 != null) { num = Encoding.UTF8.GetByteCount(compressed_font_data_base85); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* font_cfg = null; ushort* glyph_ranges = null; ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr); } public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg) { int num = 0; byte* ptr; if (compressed_font_data_base85 != null) { num = Encoding.UTF8.GetByteCount(compressed_font_data_base85); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges = null; ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr2); } public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) { int num = 0; byte* ptr; if (compressed_font_data_base85 != null) { num = Encoding.UTF8.GetByteCount(compressed_font_data_base85); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges2 = (ushort*)glyph_ranges.ToPointer(); ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2); if (num > 2048) { Util.Free(ptr); } return new ImFontPtr(nativePtr2); } public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels) { void* compressed_font_data2 = compressed_font_data.ToPointer(); ImFontConfig* font_cfg = null; ushort* glyph_ranges = null; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges)); } public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg) { void* compressed_font_data2 = compressed_font_data.ToPointer(); ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges = null; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, nativePtr, glyph_ranges)); } public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) { void* compressed_font_data2 = compressed_font_data.ToPointer(); ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges2 = (ushort*)glyph_ranges.ToPointer(); return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, nativePtr, glyph_ranges2)); } public unsafe ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels) { void* font_data2 = font_data.ToPointer(); ImFontConfig* font_cfg = null; ushort* glyph_ranges = null; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, font_cfg, glyph_ranges)); } public unsafe ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg) { void* font_data2 = font_data.ToPointer(); ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges = null; return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, nativePtr, glyph_ranges)); } public unsafe ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) { void* font_data2 = font_data.ToPointer(); ImFontConfig* nativePtr = font_cfg.NativePtr; ushort* glyph_ranges2 = (ushort*)glyph_ranges.ToPointer(); return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, nativePtr, glyph_ranges2)); } public unsafe bool Build() { return ImGuiNative.ImFontAtlas_Build(NativePtr) != 0; } public unsafe void CalcCustomRectUV(ImFontAtlasCustomRectPtr rect, out Vector2 out_uv_min, out Vector2 out_uv_max) { ImFontAtlasCustomRect* nativePtr = rect.NativePtr; fixed (Vector2* out_uv_min2 = &out_uv_min) { fixed (Vector2* out_uv_max2 = &out_uv_max) { ImGuiNative.ImFontAtlas_CalcCustomRectUV(NativePtr, nativePtr, out_uv_min2, out_uv_max2); } } } public unsafe void Clear() { ImGuiNative.ImFontAtlas_Clear(NativePtr); } public unsafe void ClearFonts() { ImGuiNative.ImFontAtlas_ClearFonts(NativePtr); } public unsafe void ClearInputData() { ImGuiNative.ImFontAtlas_ClearInputData(NativePtr); } public unsafe void ClearTexData() { ImGuiNative.ImFontAtlas_ClearTexData(NativePtr); } public unsafe void Destroy() { ImGuiNative.ImFontAtlas_destroy(NativePtr); } public unsafe ImFontAtlasCustomRectPtr GetCustomRectByIndex(int index) { return new ImFontAtlasCustomRectPtr(ImGuiNative.ImFontAtlas_GetCustomRectByIndex(NativePtr, index)); } public unsafe IntPtr GetGlyphRangesChineseFull() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesChineseFull(NativePtr); } public unsafe IntPtr GetGlyphRangesChineseSimplifiedCommon() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(NativePtr); } public unsafe IntPtr GetGlyphRangesCyrillic() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesCyrillic(NativePtr); } public unsafe IntPtr GetGlyphRangesDefault() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesDefault(NativePtr); } public unsafe IntPtr GetGlyphRangesGreek() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesGreek(NativePtr); } public unsafe IntPtr GetGlyphRangesJapanese() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesJapanese(NativePtr); } public unsafe IntPtr GetGlyphRangesKorean() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesKorean(NativePtr); } public unsafe IntPtr GetGlyphRangesThai() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesThai(NativePtr); } public unsafe IntPtr GetGlyphRangesVietnamese() { return (IntPtr)ImGuiNative.ImFontAtlas_GetGlyphRangesVietnamese(NativePtr); } public unsafe bool GetMouseCursorTexData(ImGuiMouseCursor cursor, out Vector2 out_offset, out Vector2 out_size, out Vector2 out_uv_border, out Vector2 out_uv_fill) { fixed (Vector2* out_offset2 = &out_offset) { fixed (Vector2* out_size2 = &out_size) { fixed (Vector2* out_uv_border2 = &out_uv_border) { fixed (Vector2* out_uv_fill2 = &out_uv_fill) { return ImGuiNative.ImFontAtlas_GetMouseCursorTexData(NativePtr, cursor, out_offset2, out_size2, out_uv_border2, out_uv_fill2) != 0; } } } } } public unsafe void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height) { int* out_bytes_per_pixel = null; fixed (byte** out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel); } } } } public unsafe void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) { fixed (byte** out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel) { ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2); } } } } } public unsafe void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height) { int* out_bytes_per_pixel = null; fixed (IntPtr* out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel); } } } } public unsafe void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) { fixed (IntPtr* out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel) { ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2); } } } } } public unsafe void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height) { int* out_bytes_per_pixel = null; fixed (byte** out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel); } } } } public unsafe void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) { fixed (byte** out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel) { ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2); } } } } } public unsafe void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height) { int* out_bytes_per_pixel = null; fixed (IntPtr* out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel); } } } } public unsafe void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) { fixed (IntPtr* out_pixels2 = &out_pixels) { fixed (int* out_width2 = &out_width) { fixed (int* out_height2 = &out_height) { fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel) { ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2); } } } } } public unsafe bool IsBuilt() { return ImGuiNative.ImFontAtlas_IsBuilt(NativePtr) != 0; } public unsafe void SetTexID(IntPtr id) { ImGuiNative.ImFontAtlas_SetTexID(NativePtr, id); } } public struct ImFontAtlasCustomRect { public ushort Width; public ushort Height; public ushort X; public ushort Y; public uint GlyphID; public float GlyphAdvanceX; public Vector2 GlyphOffset; public unsafe ImFont* Font; } public struct ImFontAtlasCustomRectPtr { public unsafe ImFontAtlasCustomRect* NativePtr { get; } public unsafe ref ushort Width => ref Unsafe.AsRef<ushort>(&NativePtr->Width); public unsafe ref ushort Height => ref Unsafe.AsRef<ushort>(&NativePtr->Height); public unsafe ref ushort X => ref Unsafe.AsRef<ushort>(&NativePtr->X); public unsafe ref ushort Y => ref Unsafe.AsRef<ushort>(&NativePtr->Y); public unsafe ref uint GlyphID => ref Unsafe.AsRef<uint>(&NativePtr->GlyphID); public unsafe ref float GlyphAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphAdvanceX); public unsafe ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset); public unsafe ImFontPtr Font => new ImFontPtr(NativePtr->Font); public unsafe ImFontAtlasCustomRectPtr(ImFontAtlasCustomRect* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontAtlasCustomRectPtr(IntPtr nativePtr) { NativePtr = (ImFontAtlasCustomRect*)(void*)nativePtr; } public unsafe static implicit operator ImFontAtlasCustomRectPtr(ImFontAtlasCustomRect* nativePtr) { return new ImFontAtlasCustomRectPtr(nativePtr); } public unsafe static implicit operator ImFontAtlasCustomRect*(ImFontAtlasCustomRectPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontAtlasCustomRectPtr(IntPtr nativePtr) { return new ImFontAtlasCustomRectPtr(nativePtr); } public unsafe void Destroy() { ImGuiNative.ImFontAtlasCustomRect_destroy(NativePtr); } public unsafe bool IsPacked() { return ImGuiNative.ImFontAtlasCustomRect_IsPacked(NativePtr) != 0; } } [Flags] public enum ImFontAtlasFlags { None = 0, NoPowerOfTwoHeight = 1, NoMouseCursors = 2, NoBakedLines = 4 } public struct ImFontConfig { public unsafe void* FontData; public int FontDataSize; public byte FontDataOwnedByAtlas; public int FontNo; public float SizePixels; public int OversampleH; public int OversampleV; public byte PixelSnapH; public Vector2 GlyphExtraSpacing; public Vector2 GlyphOffset; public unsafe ushort* GlyphRanges; public float GlyphMinAdvanceX; public float GlyphMaxAdvanceX; public byte MergeMode; public uint FontBuilderFlags; public float RasterizerMultiply; public float RasterizerDensity; public ushort EllipsisChar; public unsafe fixed byte Name[40]; public unsafe ImFont* DstFont; } public struct ImFontConfigPtr { public unsafe ImFontConfig* NativePtr { get; } public unsafe IntPtr FontData { get { return (IntPtr)NativePtr->FontData; } set { NativePtr->FontData = (void*)value; } } public unsafe ref int FontDataSize => ref Unsafe.AsRef<int>(&NativePtr->FontDataSize); public unsafe ref bool FontDataOwnedByAtlas => ref Unsafe.AsRef<bool>(&NativePtr->FontDataOwnedByAtlas); public unsafe ref int FontNo => ref Unsafe.AsRef<int>(&NativePtr->FontNo); public unsafe ref float SizePixels => ref Unsafe.AsRef<float>(&NativePtr->SizePixels); public unsafe ref int OversampleH => ref Unsafe.AsRef<int>(&NativePtr->OversampleH); public unsafe ref int OversampleV => ref Unsafe.AsRef<int>(&NativePtr->OversampleV); public unsafe ref bool PixelSnapH => ref Unsafe.AsRef<bool>(&NativePtr->PixelSnapH); public unsafe ref Vector2 GlyphExtraSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphExtraSpacing); public unsafe ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset); public unsafe IntPtr GlyphRanges { get { return (IntPtr)NativePtr->GlyphRanges; } set { NativePtr->GlyphRanges = (ushort*)(void*)value; } } public unsafe ref float GlyphMinAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMinAdvanceX); public unsafe ref float GlyphMaxAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMaxAdvanceX); public unsafe ref bool MergeMode => ref Unsafe.AsRef<bool>(&NativePtr->MergeMode); public unsafe ref uint FontBuilderFlags => ref Unsafe.AsRef<uint>(&NativePtr->FontBuilderFlags); public unsafe ref float RasterizerMultiply => ref Unsafe.AsRef<float>(&NativePtr->RasterizerMultiply); public unsafe ref float RasterizerDensity => ref Unsafe.AsRef<float>(&NativePtr->RasterizerDensity); public unsafe ref ushort EllipsisChar => ref Unsafe.AsRef<ushort>(&NativePtr->EllipsisChar); public unsafe RangeAccessor<byte> Name => new RangeAccessor<byte>(NativePtr->Name, 40); public unsafe ImFontPtr DstFont => new ImFontPtr(NativePtr->DstFont); public unsafe ImFontConfigPtr(ImFontConfig* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontConfigPtr(IntPtr nativePtr) { NativePtr = (ImFontConfig*)(void*)nativePtr; } public unsafe static implicit operator ImFontConfigPtr(ImFontConfig* nativePtr) { return new ImFontConfigPtr(nativePtr); } public unsafe static implicit operator ImFontConfig*(ImFontConfigPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontConfigPtr(IntPtr nativePtr) { return new ImFontConfigPtr(nativePtr); } public unsafe void Destroy() { ImGuiNative.ImFontConfig_destroy(NativePtr); } } public struct ImFontGlyph { public uint Colored; public uint Visible; public uint Codepoint; public float AdvanceX; public float X0; public float Y0; public float X1; public float Y1; public float U0; public float V0; public float U1; public float V1; } public struct ImFontGlyphPtr { public unsafe ImFontGlyph* NativePtr { get; } public unsafe ref uint Colored => ref Unsafe.AsRef<uint>(&NativePtr->Colored); public unsafe ref uint Visible => ref Unsafe.AsRef<uint>(&NativePtr->Visible); public unsafe ref uint Codepoint => ref Unsafe.AsRef<uint>(&NativePtr->Codepoint); public unsafe ref float AdvanceX => ref Unsafe.AsRef<float>(&NativePtr->AdvanceX); public unsafe ref float X0 => ref Unsafe.AsRef<float>(&NativePtr->X0); public unsafe ref float Y0 => ref Unsafe.AsRef<float>(&NativePtr->Y0); public unsafe ref float X1 => ref Unsafe.AsRef<float>(&NativePtr->X1); public unsafe ref float Y1 => ref Unsafe.AsRef<float>(&NativePtr->Y1); public unsafe ref float U0 => ref Unsafe.AsRef<float>(&NativePtr->U0); public unsafe ref float V0 => ref Unsafe.AsRef<float>(&NativePtr->V0); public unsafe ref float U1 => ref Unsafe.AsRef<float>(&NativePtr->U1); public unsafe ref float V1 => ref Unsafe.AsRef<float>(&NativePtr->V1); public unsafe ImFontGlyphPtr(ImFontGlyph* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontGlyphPtr(IntPtr nativePtr) { NativePtr = (ImFontGlyph*)(void*)nativePtr; } public unsafe static implicit operator ImFontGlyphPtr(ImFontGlyph* nativePtr) { return new ImFontGlyphPtr(nativePtr); } public unsafe static implicit operator ImFontGlyph*(ImFontGlyphPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontGlyphPtr(IntPtr nativePtr) { return new ImFontGlyphPtr(nativePtr); } } public struct ImFontGlyphRangesBuilder { public ImVector UsedChars; } public struct ImFontGlyphRangesBuilderPtr { public unsafe ImFontGlyphRangesBuilder* NativePtr { get; } public unsafe ImVector<uint> UsedChars => new ImVector<uint>(NativePtr->UsedChars); public unsafe ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) { NativePtr = nativePtr; } public unsafe ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) { NativePtr = (ImFontGlyphRangesBuilder*)(void*)nativePtr; } public unsafe static implicit operator ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) { return new ImFontGlyphRangesBuilderPtr(nativePtr); } public unsafe static implicit operator ImFontGlyphRangesBuilder*(ImFontGlyphRangesBuilderPtr wrappedPtr) { return wrappedPtr.NativePtr; } public static implicit operator ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) { return new ImFontGlyphRangesBuilderPtr(nativePtr); } public unsafe void AddChar(ushort c) { ImGuiNative.ImFontGlyphRangesBuilder_AddChar(NativePtr, c); } public unsafe void AddRanges(IntPtr ranges) { ushort* ranges2 = (ushort*)ranges.ToPointer(); ImGuiNative.ImFontGlyphRangesBuilder_AddRanges(NativePtr, ranges2); } public unsafe void AddText(string text) { int num = 0; byte* ptr; if (text != null) { num = Encoding.UTF8.GetByteCount(text); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiNative.ImFontGlyphRangesBuilder_AddText(NativePtr, ptr, ptr + num); if (num > 2048) { Util.Free(ptr); } } public unsafe void BuildRanges(out ImVector out_ranges) { fixed (ImVector* out_ranges2 = &out_ranges) { ImGuiNative.ImFontGlyphRangesBuilder_BuildRanges(NativePtr, out_ranges2); } } public unsafe void Clear() { ImGuiNative.ImFontGlyphRangesBuilder_Clear(NativePtr); } public unsafe void Destroy() { ImGuiNative.ImFontGlyphRangesBuilder_destroy(NativePtr); } public unsafe bool GetBit(uint n) { return ImGuiNative.ImFontGlyphRangesBuilder_GetBit(NativePtr, n) != 0; } public unsafe void SetBit(uint n) { ImGuiNative.ImFontGlyphRangesBuilder_SetBit(NativePtr, n); } } public static class ImGui { public unsafe static ImGuiPayloadPtr AcceptDragDropPayload(string type) { int num = 0; byte* ptr; if (type != null) { num = Encoding.UTF8.GetByteCount(type); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(type, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiDragDropFlags flags = ImGuiDragDropFlags.None; ImGuiPayload* nativePtr = ImGuiNative.igAcceptDragDropPayload(ptr, flags); if (num > 2048) { Util.Free(ptr); } return new ImGuiPayloadPtr(nativePtr); } public unsafe static ImGuiPayloadPtr AcceptDragDropPayload(string type, ImGuiDragDropFlags flags) { int num = 0; byte* ptr; if (type != null) { num = Encoding.UTF8.GetByteCount(type); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(type, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiPayload* nativePtr = ImGuiNative.igAcceptDragDropPayload(ptr, flags); if (num > 2048) { Util.Free(ptr); } return new ImGuiPayloadPtr(nativePtr); } public static void AlignTextToFramePadding() { ImGuiNative.igAlignTextToFramePadding(); } public unsafe static bool ArrowButton(string str_id, ImGuiDir dir) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igArrowButton(ptr, dir); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool Begin(string name) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte* p_open = null; ImGuiWindowFlags flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBegin(ptr, p_open, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool Begin(string name, ref bool p_open) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; ImGuiWindowFlags flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBegin(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool Begin(string name, ref bool p_open, ImGuiWindowFlags flags) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; byte num2 = ImGuiNative.igBegin(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool BeginChild(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } Vector2 size = default(Vector2); ImGuiChildFlags child_flags = ImGuiChildFlags.None; ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginChild_Str(ptr, size, child_flags, window_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginChild(string str_id, Vector2 size) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiChildFlags child_flags = ImGuiChildFlags.None; ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginChild_Str(ptr, size, child_flags, window_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginChild(string str_id, Vector2 size, ImGuiChildFlags child_flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginChild_Str(ptr, size, child_flags, window_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginChild(string str_id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginChild_Str(ptr, size, child_flags, window_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public static bool BeginChild(uint id) { Vector2 size = default(Vector2); ImGuiChildFlags child_flags = ImGuiChildFlags.None; ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; return ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags) != 0; } public static bool BeginChild(uint id, Vector2 size) { ImGuiChildFlags child_flags = ImGuiChildFlags.None; ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; return ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags) != 0; } public static bool BeginChild(uint id, Vector2 size, ImGuiChildFlags child_flags) { ImGuiWindowFlags window_flags = ImGuiWindowFlags.None; return ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags) != 0; } public static bool BeginChild(uint id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) { return ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags) != 0; } public unsafe static bool BeginCombo(string label, string preview_value) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } int num2 = 0; byte* ptr2; if (preview_value != null) { num2 = Encoding.UTF8.GetByteCount(preview_value); ptr2 = ((num2 <= 2048) ? stackalloc byte[(int)(uint)(num2 + 1)] : Util.Allocate(num2 + 1)); int utf2 = Util.GetUtf8(preview_value, ptr2, num2); ptr2[utf2] = 0; } else { ptr2 = null; } ImGuiComboFlags flags = ImGuiComboFlags.None; byte num3 = ImGuiNative.igBeginCombo(ptr, ptr2, flags); if (num > 2048) { Util.Free(ptr); } if (num2 > 2048) { Util.Free(ptr2); } return num3 != 0; } public unsafe static bool BeginCombo(string label, string preview_value, ImGuiComboFlags flags) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } int num2 = 0; byte* ptr2; if (preview_value != null) { num2 = Encoding.UTF8.GetByteCount(preview_value); ptr2 = ((num2 <= 2048) ? stackalloc byte[(int)(uint)(num2 + 1)] : Util.Allocate(num2 + 1)); int utf2 = Util.GetUtf8(preview_value, ptr2, num2); ptr2[utf2] = 0; } else { ptr2 = null; } byte num3 = ImGuiNative.igBeginCombo(ptr, ptr2, flags); if (num > 2048) { Util.Free(ptr); } if (num2 > 2048) { Util.Free(ptr2); } return num3 != 0; } public static void BeginDisabled() { ImGuiNative.igBeginDisabled(1); } public static void BeginDisabled(bool disabled) { ImGuiNative.igBeginDisabled(disabled ? ((byte)1) : ((byte)0)); } public static bool BeginDragDropSource() { return ImGuiNative.igBeginDragDropSource(ImGuiDragDropFlags.None) != 0; } public static bool BeginDragDropSource(ImGuiDragDropFlags flags) { return ImGuiNative.igBeginDragDropSource(flags) != 0; } public static bool BeginDragDropTarget() { return ImGuiNative.igBeginDragDropTarget() != 0; } public static void BeginGroup() { ImGuiNative.igBeginGroup(); } public static bool BeginItemTooltip() { return ImGuiNative.igBeginItemTooltip() != 0; } public unsafe static bool BeginListBox(string label) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginListBox(ptr, default(Vector2)); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginListBox(string label, Vector2 size) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginListBox(ptr, size); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public static bool BeginMainMenuBar() { return ImGuiNative.igBeginMainMenuBar() != 0; } public unsafe static bool BeginMenu(string label) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte enabled = 1; byte num2 = ImGuiNative.igBeginMenu(ptr, enabled); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginMenu(string label, bool enabled) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte enabled2 = (enabled ? ((byte)1) : ((byte)0)); byte num2 = ImGuiNative.igBeginMenu(ptr, enabled2); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public static bool BeginMenuBar() { return ImGuiNative.igBeginMenuBar() != 0; } public unsafe static bool BeginPopup(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiWindowFlags flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginPopup(ptr, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopup(string str_id, ImGuiWindowFlags flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginPopup(ptr, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextItem() { byte* str_id = null; ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; return ImGuiNative.igBeginPopupContextItem(str_id, popup_flags) != 0; } public unsafe static bool BeginPopupContextItem(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; byte num2 = ImGuiNative.igBeginPopupContextItem(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextItem(string str_id, ImGuiPopupFlags popup_flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginPopupContextItem(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextVoid() { byte* str_id = null; ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; return ImGuiNative.igBeginPopupContextVoid(str_id, popup_flags) != 0; } public unsafe static bool BeginPopupContextVoid(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; byte num2 = ImGuiNative.igBeginPopupContextVoid(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextVoid(string str_id, ImGuiPopupFlags popup_flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginPopupContextVoid(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextWindow() { byte* str_id = null; ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; return ImGuiNative.igBeginPopupContextWindow(str_id, popup_flags) != 0; } public unsafe static bool BeginPopupContextWindow(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiPopupFlags popup_flags = ImGuiPopupFlags.MouseButtonRight; byte num2 = ImGuiNative.igBeginPopupContextWindow(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupContextWindow(string str_id, ImGuiPopupFlags popup_flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginPopupContextWindow(ptr, popup_flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupModal(string name) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte* p_open = null; ImGuiWindowFlags flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginPopupModal(ptr, p_open, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginPopupModal(string name, ref bool p_open) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; ImGuiWindowFlags flags = ImGuiWindowFlags.None; byte num2 = ImGuiNative.igBeginPopupModal(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool BeginPopupModal(string name, ref bool p_open, ImGuiWindowFlags flags) { int num = 0; byte* ptr; if (name != null) { num = Encoding.UTF8.GetByteCount(name); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(name, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; byte num2 = ImGuiNative.igBeginPopupModal(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool BeginTabBar(string str_id) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiTabBarFlags flags = ImGuiTabBarFlags.None; byte num2 = ImGuiNative.igBeginTabBar(ptr, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTabBar(string str_id, ImGuiTabBarFlags flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginTabBar(ptr, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTabItem(string label) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte* p_open = null; ImGuiTabItemFlags flags = ImGuiTabItemFlags.None; byte num2 = ImGuiNative.igBeginTabItem(ptr, p_open, flags); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTabItem(string label, ref bool p_open) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; ImGuiTabItemFlags flags = ImGuiTabItemFlags.None; byte num2 = ImGuiNative.igBeginTabItem(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool BeginTabItem(string label, ref bool p_open, ImGuiTabItemFlags flags) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte b = (p_open ? ((byte)1) : ((byte)0)); byte* p_open2 = &b; byte num2 = ImGuiNative.igBeginTabItem(ptr, p_open2, flags); if (num > 2048) { Util.Free(ptr); } p_open = b != 0; return num2 != 0; } public unsafe static bool BeginTable(string str_id, int column) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiTableFlags flags = ImGuiTableFlags.None; Vector2 outer_size = default(Vector2); float inner_width = 0f; byte num2 = ImGuiNative.igBeginTable(ptr, column, flags, outer_size, inner_width); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTable(string str_id, int column, ImGuiTableFlags flags) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } Vector2 outer_size = default(Vector2); float inner_width = 0f; byte num2 = ImGuiNative.igBeginTable(ptr, column, flags, outer_size, inner_width); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTable(string str_id, int column, ImGuiTableFlags flags, Vector2 outer_size) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } float inner_width = 0f; byte num2 = ImGuiNative.igBeginTable(ptr, column, flags, outer_size, inner_width); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool BeginTable(string str_id, int column, ImGuiTableFlags flags, Vector2 outer_size, float inner_width) { int num = 0; byte* ptr; if (str_id != null) { num = Encoding.UTF8.GetByteCount(str_id); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(str_id, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igBeginTable(ptr, column, flags, outer_size, inner_width); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public static bool BeginTooltip() { return ImGuiNative.igBeginTooltip() != 0; } public static void Bullet() { ImGuiNative.igBullet(); } public unsafe static void BulletText(string fmt) { int num = 0; byte* ptr; if (fmt != null) { num = Encoding.UTF8.GetByteCount(fmt); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(fmt, ptr, num); ptr[utf] = 0; } else { ptr = null; } ImGuiNative.igBulletText(ptr); if (num > 2048) { Util.Free(ptr); } } public unsafe static bool Button(string label) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igButton(ptr, default(Vector2)); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public unsafe static bool Button(string label, Vector2 size) { int num = 0; byte* ptr; if (label != null) { num = Encoding.UTF8.GetByteCount(label); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(label, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte num2 = ImGuiNative.igButton(ptr, size); if (num > 2048) { Util.Free(ptr); } return num2 != 0; } public static float CalcItemWidth() { return ImGuiNative.igCalcItemWidth(); } public unsafe static Vector2 CalcTextSize(string text) { int num = 0; byte* ptr; if (text != null) { num = Encoding.UTF8.GetByteCount(text); ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1)); int utf = Util.GetUtf8(text, ptr, num); ptr[utf] = 0; } else { ptr = null; } byte hide_text_after_double_hash = 0; float wrap_width = -1f; Vector2 result = default(Vector2); ImGuiNative.igCalcTextSize(&result, ptr, ptr + num, hide_text_after_double_hash, wrap_wid
plugins/OverlayDearImGui.Shared/SharpDX.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq.Expressions; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using SharpDX; using SharpDX.Collections; using SharpDX.Diagnostics; using SharpDX.Direct3D; using SharpDX.Mathematics.Interop; [assembly: InternalsVisibleTo("SharpDX.DirectSound")] [assembly: InternalsVisibleTo("SharpDX.RawInput")] [assembly: InternalsVisibleTo("SharpDX.DirectInput")] [assembly: InternalsVisibleTo("SharpDX.Direct2D1")] [assembly: InternalsVisibleTo("SharpDX.Direct3D11.Effects")] [assembly: InternalsVisibleTo("SharpDX.Direct3D12")] [assembly: InternalsVisibleTo("SharpDX.XAPO")] [assembly: InternalsVisibleTo("SharpDX.Direct3D11")] [assembly: InternalsVisibleTo("SharpDX.Direct3D9")] [assembly: InternalsVisibleTo("SharpDX.Desktop")] [assembly: InternalsVisibleTo("SharpDX.D3DCompiler")] [assembly: InternalsVisibleTo("SharpDX.DXGI")] [assembly: InternalsVisibleTo("SharpDX.Animation")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("SharpDX.Direct3D10")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: InternalsVisibleTo("SharpDX.XAudio2")] [assembly: InternalsVisibleTo("SharpDX.WIC")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/xiaoxiao921/SharpDX")] [assembly: AssemblyTitle("SharpDX")] [assembly: AssemblyProduct("SharpDX")] [assembly: AssemblyDescription("Core assembly for all SharpDX assemblies.")] [assembly: AssemblyCopyright("Copyright (c) 2010-2016 Alexandre Mutel")] [assembly: AssemblyConfiguration("Release")] [assembly: InternalsVisibleTo("SharpDX.XACT3")] [assembly: AssemblyCompany("Alexandre Mutel")] [assembly: AssemblyInformationalVersion("4.2.1-beta0+7abb72df54")] [assembly: AssemblyFileVersion("4.2.1.34")] [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("SharpDX.DirectManipulation")] [assembly: InternalsVisibleTo("SharpDX.DirectComposition")] [assembly: InternalsVisibleTo("SharpDX.MediaFoundation")] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.2.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { Interop.ModuleInit(); ModuleInit.Setup(); } } internal sealed class ThisAssembly { internal const string AssemblyVersion = "4.2.0.0"; internal const string AssemblyFileVersion = "4.2.1.34"; internal const string AssemblyInformationalVersion = "4.2.1-beta0+7abb72df54"; internal const string AssemblyName = "SharpDX"; internal const string AssemblyTitle = "SharpDX"; internal const string AssemblyConfiguration = "Release"; internal const string GitCommitId = "7abb72df544eaede656c546ee71a8ad1be9dd19b"; internal const string RootNamespace = "SharpDX"; private ThisAssembly() { } } namespace SharpDX { [CompilerGenerated] internal class AssemblyDoc { } public abstract class CallbackBase : DisposeBase, ICallbackable, IDisposable { private int refCount = 1; IDisposable ICallbackable.Shadow { get; set; } protected override void Dispose(bool disposing) { if (disposing) { Release(); } } public int AddReference() { int num = refCount; while (true) { if (num == 0) { throw new ObjectDisposedException("Cannot add a reference to a nonreferenced item"); } int num2 = Interlocked.CompareExchange(ref refCount, num + 1, num); if (num2 == num) { break; } num = num2; } return num + 1; } public int Release() { int num = refCount; while (true) { int num2 = Interlocked.CompareExchange(ref refCount, num - 1, num); if (num2 == num) { break; } num = num2; } if (num == 1) { ((ICallbackable)this).Shadow.Dispose(); ((ICallbackable)this).Shadow = null; } return num - 1; } public Result QueryInterface(ref Guid guid, out IntPtr comObject) { ShadowContainer shadowContainer = (ShadowContainer)((ICallbackable)this).Shadow; comObject = shadowContainer.Find(guid); if (comObject == IntPtr.Zero) { return Result.NoInterface; } return Result.Ok; } } public class ComArray : DisposeBase, IEnumerable { protected ComObject[] values; private IntPtr nativeBuffer; public IntPtr NativePointer => nativeBuffer; public int Length { get { if (values != null) { return values.Length; } return 0; } } public ComArray(params ComObject[] array) { values = array; nativeBuffer = IntPtr.Zero; if (values != null) { int num = array.Length; values = new ComObject[num]; nativeBuffer = Utilities.AllocateMemory(num * Utilities.SizeOf<IntPtr>()); for (int i = 0; i < num; i++) { Set(i, array[i]); } } } public ComArray(int size) { values = new ComObject[size]; nativeBuffer = Utilities.AllocateMemory(size * Utilities.SizeOf<IntPtr>()); } public ComObject Get(int index) { return values[index]; } internal unsafe void SetFromNative(int index, ComObject value) { values[index] = value; value.NativePointer = *(IntPtr*)((byte*)(void*)nativeBuffer + (nint)index * (nint)sizeof(IntPtr)); } public unsafe void Set(int index, ComObject value) { values[index] = value; *(IntPtr*)((byte*)(void*)nativeBuffer + (nint)index * (nint)sizeof(IntPtr)) = value.NativePointer; } protected override void Dispose(bool disposing) { if (disposing) { values = null; } Utilities.FreeMemory(nativeBuffer); nativeBuffer = IntPtr.Zero; } public IEnumerator GetEnumerator() { return values.GetEnumerator(); } } public class ComArray<T> : ComArray, IEnumerable<T>, IEnumerable where T : ComObject { private struct ArrayEnumerator<T1> : IEnumerator<T1>, IEnumerator, IDisposable where T1 : ComObject { private readonly IEnumerator enumerator; public T1 Current => (T1)enumerator.Current; object IEnumerator.Current => Current; public ArrayEnumerator(IEnumerator enumerator) { this.enumerator = enumerator; } public void Dispose() { } public bool MoveNext() { return enumerator.MoveNext(); } public void Reset() { enumerator.Reset(); } } public T this[int i] { get { return (T)Get(i); } set { Set(i, value); } } public ComArray(params T[] array) : base(array) { } public ComArray(int size) : base(size) { } public new IEnumerator<T> GetEnumerator() { return new ArrayEnumerator<T>(values.GetEnumerator()); } } [Guid("00000000-0000-0000-C000-000000000046")] public class ComObject : CppObject, IUnknown, ICallbackable, IDisposable { public static Action<string> LogMemoryLeakWarning = delegate { }; public ComObject(object iunknowObject) { base.NativePointer = Marshal.GetIUnknownForObject(iunknowObject); } protected ComObject() { } public virtual void QueryInterface(Guid guid, out IntPtr outPtr) { ((IUnknown)this).QueryInterface(ref guid, out outPtr).CheckError(); } public virtual IntPtr QueryInterfaceOrNull(Guid guid) { IntPtr comObject = IntPtr.Zero; ((IUnknown)this).QueryInterface(ref guid, out comObject); return comObject; } public static bool EqualsComObject<T>(T left, T right) where T : ComObject { if (object.Equals(left, right)) { return true; } if (left == null || right == null) { return false; } return left.NativePointer == right.NativePointer; } public virtual T QueryInterface<T>() where T : ComObject { QueryInterface(Utilities.GetGuidFromType(typeof(T)), out var outPtr); return CppObject.FromPointer<T>(outPtr); } internal virtual T QueryInterfaceUnsafe<T>() { QueryInterface(Utilities.GetGuidFromType(typeof(T)), out var outPtr); return CppObject.FromPointerUnsafe<T>(outPtr); } public static T As<T>(object comObject) where T : ComObject { using ComObject comObject2 = new ComObject(Marshal.GetIUnknownForObject(comObject)); return comObject2.QueryInterface<T>(); } public static T As<T>(IntPtr iunknownPtr) where T : ComObject { using ComObject comObject = new ComObject(iunknownPtr); return comObject.QueryInterface<T>(); } internal static T AsUnsafe<T>(IntPtr iunknownPtr) { using ComObject comObject = new ComObject(iunknownPtr); return comObject.QueryInterfaceUnsafe<T>(); } public static T QueryInterface<T>(object comObject) where T : ComObject { using ComObject comObject2 = new ComObject(Marshal.GetIUnknownForObject(comObject)); return comObject2.QueryInterface<T>(); } public static T QueryInterfaceOrNull<T>(IntPtr comPointer) where T : ComObject { if (comPointer == IntPtr.Zero) { return null; } Guid iid = Utilities.GetGuidFromType(typeof(T)); if (!((Result)Marshal.QueryInterface(comPointer, ref iid, out var ppv)).Failure) { return CppObject.FromPointerUnsafe<T>(ppv); } return null; } public virtual T QueryInterfaceOrNull<T>() where T : ComObject { return CppObject.FromPointer<T>(QueryInterfaceOrNull(Utilities.GetGuidFromType(typeof(T)))); } protected void QueryInterfaceFrom<T>(T fromObject) where T : ComObject { fromObject.QueryInterface(Utilities.GetGuidFromType(GetType()), out var outPtr); base.NativePointer = outPtr; } Result IUnknown.QueryInterface(ref Guid guid, out IntPtr comObject) { return Marshal.QueryInterface(base.NativePointer, ref guid, out comObject); } int IUnknown.AddReference() { if (base.NativePointer == IntPtr.Zero) { throw new InvalidOperationException("COM Object pointer is null"); } return Marshal.AddRef(base.NativePointer); } int IUnknown.Release() { if (base.NativePointer == IntPtr.Zero) { throw new InvalidOperationException("COM Object pointer is null"); } return Marshal.Release(base.NativePointer); } protected unsafe override void Dispose(bool disposing) { if (base.NativePointer != IntPtr.Zero) { if (!disposing && Configuration.EnableTrackingReleaseOnFinalizer && !Configuration.EnableReleaseOnFinalizer) { ObjectReference arg = ObjectTracker.Find(this); LogMemoryLeakWarning?.Invoke($"Warning: Live ComObject [0x{base.NativePointer.ToInt64():X}], potential memory leak: {arg}"); } if (disposing || Configuration.EnableReleaseOnFinalizer) { ((IUnknown)this).Release(); } if (Configuration.EnableObjectTracking) { ObjectTracker.UnTrack(this); } _nativePointer = null; } base.Dispose(disposing); } protected override void NativePointerUpdating() { if (Configuration.EnableObjectTracking) { ObjectTracker.UnTrack(this); } } protected override void NativePointerUpdated(IntPtr oldNativePointer) { if (Configuration.EnableObjectTracking) { ObjectTracker.Track(this); } } public ComObject(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator ComObject(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new ComObject(nativePtr); } return null; } } internal abstract class ComObjectShadow : CppObjectShadow { internal class ComObjectVtbl : CppObjectVtbl { [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate int QueryInterfaceDelegate(IntPtr thisObject, IntPtr guid, out IntPtr output); [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate int AddRefDelegate(IntPtr thisObject); [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate int ReleaseDelegate(IntPtr thisObject); public ComObjectVtbl(int numberOfCallbackMethods) : base(numberOfCallbackMethods + 3) { AddMethod(new QueryInterfaceDelegate(QueryInterfaceImpl)); AddMethod(new AddRefDelegate(AddRefImpl)); AddMethod(new ReleaseDelegate(ReleaseImpl)); } protected unsafe static int QueryInterfaceImpl(IntPtr thisObject, IntPtr guid, out IntPtr output) { ComObjectShadow comObjectShadow = CppObjectShadow.ToShadow<ComObjectShadow>(thisObject); if (comObjectShadow == null) { output = IntPtr.Zero; return Result.NoInterface.Code; } return comObjectShadow.QueryInterfaceImpl(ref *(Guid*)(void*)guid, out output); } protected static int AddRefImpl(IntPtr thisObject) { return CppObjectShadow.ToShadow<ComObjectShadow>(thisObject)?.AddRefImpl() ?? 0; } protected static int ReleaseImpl(IntPtr thisObject) { return CppObjectShadow.ToShadow<ComObjectShadow>(thisObject)?.ReleaseImpl() ?? 0; } } public static Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046"); protected int QueryInterfaceImpl(ref Guid guid, out IntPtr output) { ComObjectShadow comObjectShadow = (ComObjectShadow)((ShadowContainer)base.Callback.Shadow).FindShadow(guid); if (comObjectShadow != null) { ((IUnknown)base.Callback).AddReference(); output = comObjectShadow.NativePointer; return Result.Ok.Code; } output = IntPtr.Zero; return Result.NoInterface.Code; } protected virtual int AddRefImpl() { return ((IUnknown)base.Callback).AddReference(); } protected virtual int ReleaseImpl() { return ((IUnknown)base.Callback).Release(); } } public static class Configuration { public static bool EnableObjectTracking = false; public static bool EnableReleaseOnFinalizer = false; public static bool EnableTrackingReleaseOnFinalizer = true; public static bool ThrowOnShaderCompileError = true; public static bool UseThreadStaticObjectTracking = false; } public class CppObject : DisposeBase, ICallbackable, IDisposable { protected internal unsafe void* _nativePointer; public object Tag { get; set; } public unsafe IntPtr NativePointer { get { return (IntPtr)_nativePointer; } set { void* ptr = (void*)value; if (_nativePointer != ptr) { NativePointerUpdating(); void* nativePointer = _nativePointer; _nativePointer = ptr; NativePointerUpdated((IntPtr)nativePointer); } } } IDisposable ICallbackable.Shadow { get { throw new InvalidOperationException("Invalid access to Callback. This is used internally."); } set { throw new InvalidOperationException("Invalid access to Callback. This is used internally."); } } public CppObject(IntPtr pointer) { NativePointer = pointer; } protected CppObject() { } public static explicit operator IntPtr(CppObject cppObject) { return cppObject?.NativePointer ?? IntPtr.Zero; } protected void FromTemp(CppObject temp) { NativePointer = temp.NativePointer; temp.NativePointer = IntPtr.Zero; } protected void FromTemp(IntPtr temp) { NativePointer = temp; } protected virtual void NativePointerUpdating() { } protected virtual void NativePointerUpdated(IntPtr oldNativePointer) { } protected override void Dispose(bool disposing) { } public static T FromPointer<T>(IntPtr comObjectPtr) where T : CppObject { if (!(comObjectPtr == IntPtr.Zero)) { return (T)Activator.CreateInstance(typeof(T), comObjectPtr); } return null; } internal static T FromPointerUnsafe<T>(IntPtr comObjectPtr) { if (!(comObjectPtr == IntPtr.Zero)) { return (T)Activator.CreateInstance(typeof(T), comObjectPtr); } return (T)(object)null; } public static IntPtr ToCallbackPtr<TCallback>(ICallbackable callback) where TCallback : ICallbackable { if (callback == null) { return IntPtr.Zero; } if (callback is CppObject) { return ((CppObject)callback).NativePointer; } ShadowContainer shadowContainer = callback.Shadow as ShadowContainer; if (shadowContainer == null) { shadowContainer = new ShadowContainer(); shadowContainer.Initialize(callback); } return shadowContainer.Find(typeof(TCallback)); } } internal abstract class CppObjectShadow : CppObject { public ICallbackable Callback { get; private set; } protected abstract CppObjectVtbl GetVtbl { get; } public unsafe virtual void Initialize(ICallbackable callbackInstance) { Callback = callbackInstance; base.NativePointer = Marshal.AllocHGlobal(IntPtr.Size * 2); GCHandle value = GCHandle.Alloc(this); Marshal.WriteIntPtr(base.NativePointer, GetVtbl.Pointer); *(IntPtr*)((byte*)(void*)base.NativePointer + sizeof(IntPtr)) = GCHandle.ToIntPtr(value); } protected unsafe override void Dispose(bool disposing) { if (base.NativePointer != IntPtr.Zero) { GCHandle.FromIntPtr(*(IntPtr*)((byte*)(void*)base.NativePointer + sizeof(IntPtr))).Free(); Marshal.FreeHGlobal(base.NativePointer); base.NativePointer = IntPtr.Zero; } Callback = null; base.Dispose(disposing); } internal unsafe static T ToShadow<T>(IntPtr thisPtr) where T : CppObjectShadow { return (T)GCHandle.FromIntPtr(*(IntPtr*)((byte*)(void*)thisPtr + sizeof(IntPtr))).Target; } } internal class CppObjectVtbl { private readonly List<Delegate> methods; private readonly IntPtr vtbl; public IntPtr Pointer => vtbl; public CppObjectVtbl(int numberOfCallbackMethods) { vtbl = Marshal.AllocHGlobal(IntPtr.Size * numberOfCallbackMethods); methods = new List<Delegate>(); } public unsafe void AddMethod(Delegate method) { int count = methods.Count; methods.Add(method); *(IntPtr*)((byte*)(void*)vtbl + (nint)count * (nint)sizeof(IntPtr)) = Marshal.GetFunctionPointerForDelegate(method); } } public struct DataBox { public IntPtr DataPointer; public int RowPitch; public int SlicePitch; public bool IsEmpty { get { if (DataPointer == IntPtr.Zero && RowPitch == 0) { return SlicePitch == 0; } return false; } } public DataBox(IntPtr datapointer, int rowPitch, int slicePitch) { DataPointer = datapointer; RowPitch = rowPitch; SlicePitch = slicePitch; } public DataBox(IntPtr dataPointer) { DataPointer = dataPointer; RowPitch = 0; SlicePitch = 0; } } public class DataBuffer : DisposeBase { private unsafe sbyte* _buffer; private GCHandle _gCHandle; private readonly bool _ownsBuffer; private readonly int _size; private Blob _blob; public unsafe IntPtr DataPointer => new IntPtr(_buffer); public int Size => _size; public unsafe static DataBuffer Create<T>(T[] userBuffer, int index = 0, bool pinBuffer = true) where T : struct { if (userBuffer == null) { throw new ArgumentNullException("userBuffer"); } if (index < 0 || index > userBuffer.Length) { throw new ArgumentException("Index is out of range [0, userBuffer.Length-1]", "index"); } int num = Utilities.SizeOf(userBuffer); int num2 = index * Utilities.SizeOf<T>(); if (pinBuffer) { GCHandle handle = GCHandle.Alloc(userBuffer, GCHandleType.Pinned); return new DataBuffer(num2 + (byte*)(void*)handle.AddrOfPinnedObject(), num - num2, handle); } fixed (T* ptr = &userBuffer[0]) { return new DataBuffer(num2 + (byte*)(void*)(IntPtr)ptr, num - num2, makeCopy: true); } } public unsafe DataBuffer(int sizeInBytes) { _buffer = (sbyte*)(void*)Utilities.AllocateMemory(sizeInBytes); _size = sizeInBytes; _ownsBuffer = true; } public DataBuffer(DataPointer dataPointer) : this(dataPointer.Pointer, dataPointer.Size) { } public unsafe DataBuffer(IntPtr userBuffer, int sizeInBytes) : this((void*)userBuffer, sizeInBytes, makeCopy: false) { } internal unsafe DataBuffer(void* buffer, int sizeInBytes, GCHandle handle) { _buffer = (sbyte*)buffer; _size = sizeInBytes; _gCHandle = handle; _ownsBuffer = false; } internal unsafe DataBuffer(void* buffer, int sizeInBytes, bool makeCopy) { if (makeCopy) { _buffer = (sbyte*)(void*)Utilities.AllocateMemory(sizeInBytes); Utilities.CopyMemory((IntPtr)_buffer, (IntPtr)buffer, sizeInBytes); } else { _buffer = (sbyte*)buffer; } _size = sizeInBytes; _ownsBuffer = makeCopy; } internal unsafe DataBuffer(Blob buffer) { _buffer = (sbyte*)(void*)buffer.GetBufferPointer(); _size = buffer.GetBufferSize(); _blob = buffer; } protected unsafe override void Dispose(bool disposing) { if (disposing && _blob != null) { _blob.Dispose(); _blob = null; } if (_gCHandle.IsAllocated) { _gCHandle.Free(); } if (_ownsBuffer && _buffer != null) { Utilities.FreeMemory((IntPtr)_buffer); _buffer = null; } } public unsafe void Clear(byte value = 0) { Utilities.ClearMemory((IntPtr)_buffer, value, Size); } public unsafe T Get<T>(int positionInBytes) where T : struct { T data = default(T); Utilities.Read((IntPtr)(_buffer + positionInBytes), ref data); return data; } public unsafe void Get<T>(int positionInBytes, out T value) where T : struct { Utilities.ReadOut<T>((IntPtr)(_buffer + positionInBytes), out value); } public unsafe T[] GetRange<T>(int positionInBytes, int count) where T : struct { T[] array = new T[count]; Utilities.Read((IntPtr)(_buffer + positionInBytes), array, 0, count); return array; } public unsafe void GetRange<T>(int positionInBytes, T[] buffer, int offset, int count) where T : struct { Utilities.Read((IntPtr)(_buffer + positionInBytes), buffer, offset, count); } public unsafe void Set<T>(int positionInBytes, ref T value) where T : struct { Unsafe.Write(_buffer + positionInBytes, value); } public unsafe void Set<T>(int positionInBytes, T value) where T : struct { Unsafe.Write(_buffer + positionInBytes, value); } public unsafe void Set(int positionInBytes, bool value) { *(int*)(_buffer + positionInBytes) = (value ? 1 : 0); } public void Set<T>(int positionInBytes, T[] data) where T : struct { Set(positionInBytes, data, 0, data.Length); } public unsafe void Set(int positionInBytes, IntPtr source, long count) { Utilities.CopyMemory((IntPtr)(_buffer + positionInBytes), source, (int)count); } public unsafe void Set<T>(int positionInBytes, T[] data, int offset, int count) where T : struct { Utilities.Write((IntPtr)(_buffer + positionInBytes), data, offset, count); } public static implicit operator DataPointer(DataBuffer from) { return new DataPointer(from.DataPointer, from.Size); } } public struct DataPointer : IEquatable<DataPointer> { public static readonly DataPointer Zero = new DataPointer(IntPtr.Zero, 0); public IntPtr Pointer; public int Size; public bool IsEmpty => Equals(Zero); public DataPointer(IntPtr pointer, int size) { Pointer = pointer; Size = size; } public unsafe DataPointer(void* pointer, int size) { Pointer = (IntPtr)pointer; Size = size; } public bool Equals(DataPointer other) { if (Pointer.Equals((object?)(nint)other.Pointer)) { return Size == other.Size; } return false; } public override bool Equals(object obj) { if (obj == null) { return false; } if (obj is DataPointer) { return Equals((DataPointer)obj); } return false; } public override int GetHashCode() { return (Pointer.GetHashCode() * 397) ^ Size; } public DataStream ToDataStream() { if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } return new DataStream(this); } public DataBuffer ToDataBuffer() { if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } return new DataBuffer(this); } public byte[] ToArray() { if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } if (Size < 0) { throw new InvalidOperationException("Size cannot be < 0"); } byte[] array = new byte[Size]; Utilities.Read(Pointer, array, 0, Size); return array; } public T[] ToArray<T>() where T : struct { if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } T[] array = new T[Size / Utilities.SizeOf<T>()]; CopyTo(array, 0, array.Length); return array; } public void CopyTo<T>(T[] buffer, int offset, int count) where T : struct { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } if (offset < 0) { throw new ArgumentOutOfRangeException("offset", "Must be >= 0"); } if (count <= 0) { throw new ArgumentOutOfRangeException("count", "Must be > 0"); } if (count * Utilities.SizeOf<T>() > Size) { throw new ArgumentOutOfRangeException("buffer", "Total buffer size cannot be larger than size of this data pointer"); } Utilities.Read(Pointer, buffer, offset, count); } public void CopyFrom<T>(T[] buffer) where T : struct { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } CopyFrom(buffer, 0, buffer.Length); } public void CopyFrom<T>(T[] buffer, int offset, int count) where T : struct { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (Pointer == IntPtr.Zero) { throw new InvalidOperationException("DataPointer is Zero"); } if (offset < 0) { throw new ArgumentOutOfRangeException("offset", "Must be >= 0"); } if (count <= 0) { throw new ArgumentOutOfRangeException("count", "Must be > 0"); } if (count * Utilities.SizeOf<T>() > Size) { throw new ArgumentOutOfRangeException("buffer", "Total buffer size cannot be larger than size of this data pointer"); } Utilities.Write(Pointer, buffer, offset, count); } public static bool operator ==(DataPointer left, DataPointer right) { return left.Equals(right); } public static bool operator !=(DataPointer left, DataPointer right) { return !left.Equals(right); } } public struct DataRectangle { public IntPtr DataPointer; public int Pitch; public DataRectangle(IntPtr dataPointer, int pitch) { DataPointer = dataPointer; Pitch = pitch; } } public class DataStream : Stream { private unsafe byte* _buffer; private readonly bool _canRead; private readonly bool _canWrite; private GCHandle _gCHandle; private Blob _blob; private readonly bool _ownsBuffer; private long _position; private readonly long _size; public override bool CanRead => _canRead; public override bool CanSeek => true; public override bool CanWrite => _canWrite; public unsafe IntPtr DataPointer => new IntPtr(_buffer); public override long Length => _size; public override long Position { get { return _position; } set { Seek(value, SeekOrigin.Begin); } } public unsafe IntPtr PositionPointer => (IntPtr)(_buffer + _position); public long RemainingLength => _size - _position; public unsafe DataStream(Blob buffer) { _buffer = (byte*)(void*)buffer.GetBufferPointer(); _size = buffer.GetBufferSize(); _canRead = true; _canWrite = true; _blob = buffer; } public unsafe static DataStream Create<T>(T[] userBuffer, bool canRead, bool canWrite, int index = 0, bool pinBuffer = true) where T : struct { if (userBuffer == null) { throw new ArgumentNullException("userBuffer"); } if (index < 0 || index > userBuffer.Length) { throw new ArgumentException("Index is out of range [0, userBuffer.Length-1]", "index"); } int num = Utilities.SizeOf(userBuffer); int num2 = index * Utilities.SizeOf<T>(); if (pinBuffer) { GCHandle handle = GCHandle.Alloc(userBuffer, GCHandleType.Pinned); return new DataStream(num2 + (byte*)(void*)handle.AddrOfPinnedObject(), num - num2, canRead, canWrite, handle); } fixed (T* ptr = &userBuffer[0]) { return new DataStream(num2 + (byte*)(void*)(IntPtr)ptr, num - num2, canRead, canWrite, makeCopy: true); } } public unsafe DataStream(int sizeInBytes, bool canRead, bool canWrite) { _buffer = (byte*)(void*)Utilities.AllocateMemory(sizeInBytes); _size = sizeInBytes; _ownsBuffer = true; _canRead = canRead; _canWrite = canWrite; } public DataStream(DataPointer dataPointer) : this(dataPointer.Pointer, dataPointer.Size, canRead: true, canWrite: true) { } public unsafe DataStream(IntPtr userBuffer, long sizeInBytes, bool canRead, bool canWrite) { _buffer = (byte*)userBuffer.ToPointer(); _size = sizeInBytes; _canRead = canRead; _canWrite = canWrite; } internal unsafe DataStream(void* dataPointer, int sizeInBytes, bool canRead, bool canWrite, GCHandle handle) { _gCHandle = handle; _buffer = (byte*)dataPointer; _size = sizeInBytes; _canRead = canRead; _canWrite = canWrite; _ownsBuffer = false; } internal unsafe DataStream(void* buffer, int sizeInBytes, bool canRead, bool canWrite, bool makeCopy) { if (makeCopy) { _buffer = (byte*)(void*)Utilities.AllocateMemory(sizeInBytes); Utilities.CopyMemory((IntPtr)_buffer, (IntPtr)buffer, sizeInBytes); } else { _buffer = (byte*)buffer; } _size = sizeInBytes; _canRead = canRead; _canWrite = canWrite; _ownsBuffer = makeCopy; } ~DataStream() { Dispose(disposing: false); } protected unsafe override void Dispose(bool disposing) { if (disposing && _blob != null) { _blob.Dispose(); _blob = null; } if (_gCHandle.IsAllocated) { _gCHandle.Free(); } if (_ownsBuffer && _buffer != null) { Utilities.FreeMemory((IntPtr)_buffer); _buffer = null; } } public override void Flush() { throw new NotSupportedException("DataStream objects cannot be flushed."); } public unsafe T Read<T>() where T : struct { if (!_canRead) { throw new NotSupportedException(); } byte* ptr = _buffer + _position; T data = default(T); _position = (byte*)(void*)Utilities.ReadAndPosition((IntPtr)ptr, ref data) - _buffer; return data; } public unsafe override int ReadByte() { if (_position >= Length) { return -1; } return _buffer[_position++]; } public override int Read(byte[] buffer, int offset, int count) { int count2 = (int)Math.Min(RemainingLength, count); return ReadRange(buffer, offset, count2); } public unsafe void Read(IntPtr buffer, int offset, int count) { Utilities.CopyMemory(new IntPtr((byte*)(void*)buffer + offset), (IntPtr)(_buffer + _position), count); _position += count; } public unsafe T[] ReadRange<T>(int count) where T : struct { if (!_canRead) { throw new NotSupportedException(); } byte* ptr = _buffer + _position; T[] array = new T[count]; _position = (byte*)(void*)Utilities.Read((IntPtr)ptr, array, 0, count) - _buffer; return array; } public unsafe int ReadRange<T>(T[] buffer, int offset, int count) where T : struct { if (!_canRead) { throw new NotSupportedException(); } long position = _position; _position = (byte*)(void*)Utilities.Read((IntPtr)(_buffer + _position), buffer, offset, count) - _buffer; return (int)(_position - position); } public override long Seek(long offset, SeekOrigin origin) { long num = 0L; switch (origin) { case SeekOrigin.Begin: num = offset; break; case SeekOrigin.Current: num = _position + offset; break; case SeekOrigin.End: num = _size - offset; break; } if (num < 0) { throw new InvalidOperationException("Cannot seek beyond the beginning of the stream."); } if (num > _size) { throw new InvalidOperationException("Cannot seek beyond the end of the stream."); } _position = num; return _position; } public override void SetLength(long value) { throw new NotSupportedException("DataStream objects cannot be resized."); } public unsafe void Write<T>(T value) where T : struct { if (!_canWrite) { throw new NotSupportedException(); } _position = (byte*)(void*)Utilities.WriteAndPosition((IntPtr)(_buffer + _position), ref value) - _buffer; } public override void Write(byte[] buffer, int offset, int count) { WriteRange(buffer, offset, count); } public unsafe void Write(IntPtr buffer, int offset, int count) { Utilities.CopyMemory((IntPtr)(_buffer + _position), new IntPtr((byte*)(void*)buffer + offset), count); _position += count; } public void WriteRange<T>(T[] data) where T : struct { WriteRange(data, 0, data.Length); } public unsafe void WriteRange(IntPtr source, long count) { if (!_canWrite) { throw new NotSupportedException(); } Utilities.CopyMemory((IntPtr)(_buffer + _position), source, (int)count); _position += count; } public unsafe void WriteRange<T>(T[] data, int offset, int count) where T : struct { if (!_canWrite) { throw new NotSupportedException(); } _position = (byte*)(void*)Utilities.Write((IntPtr)(_buffer + _position), data, offset, count) - _buffer; } public static implicit operator DataPointer(DataStream from) { return new DataPointer(from.PositionPointer, (int)from.RemainingLength); } } public class CompilationException : SharpDXException { public CompilationException(string message) : base(message) { } public CompilationException(Result errorCode, string message) : base(errorCode, message) { } } public abstract class CompilationResultBase<T> : DisposeBase where T : class, IDisposable { public T Bytecode { get; private set; } public Result ResultCode { get; private set; } public bool HasErrors => ResultCode.Failure; public string Message { get; private set; } protected CompilationResultBase(T bytecode, Result resultCode, string message = null) { Bytecode = bytecode; ResultCode = resultCode; Message = message; } protected override void Dispose(bool disposing) { if (disposing && Bytecode != null) { Bytecode.Dispose(); Bytecode = null; } } } public abstract class DisposeBase : IDisposable { public bool IsDisposed { get; private set; } public event EventHandler<EventArgs> Disposing; public event EventHandler<EventArgs> Disposed; ~DisposeBase() { CheckAndDispose(disposing: false); } public void Dispose() { CheckAndDispose(disposing: true); } private void CheckAndDispose(bool disposing) { if (!IsDisposed) { this.Disposing?.Invoke(this, DisposeEventArgs.Get(disposing)); Dispose(disposing); GC.SuppressFinalize(this); IsDisposed = true; this.Disposed?.Invoke(this, DisposeEventArgs.Get(disposing)); } } protected abstract void Dispose(bool disposing); } public class DisposeCollector : DisposeBase { private List<object> disposables; public int Count => disposables.Count; public void DisposeAndClear(bool disposeManagedResources = true) { if (disposables == null) { return; } for (int num = disposables.Count - 1; num >= 0; num--) { object obj = disposables[num]; if (obj is IDisposable disposable) { if (disposeManagedResources) { disposable.Dispose(); } } else { Utilities.FreeMemory((IntPtr)obj); } disposables.RemoveAt(num); } disposables.Clear(); } protected override void Dispose(bool disposeManagedResources) { DisposeAndClear(disposeManagedResources); disposables = null; } public T Collect<T>(T toDispose) { if (!(toDispose is IDisposable) && !(toDispose is IntPtr)) { throw new ArgumentException("Argument must be IDisposable or IntPtr"); } if (toDispose is IntPtr && !Utilities.IsMemoryAligned((IntPtr)(object)toDispose)) { throw new ArgumentException("Memory pointer is invalid. Memory must have been allocated with Utilties.AllocateMemory"); } if (!object.Equals(toDispose, default(T))) { if (disposables == null) { disposables = new List<object>(); } if (!disposables.Contains(toDispose)) { disposables.Add(toDispose); } } return toDispose; } public void RemoveAndDispose<T>(ref T objectToDispose) { if (disposables != null) { Remove(objectToDispose); if ((object)objectToDispose is IDisposable disposable) { disposable.Dispose(); } else { Utilities.FreeMemory((IntPtr)(object)objectToDispose); } objectToDispose = default(T); } } public void Remove<T>(T toDisposeArg) { if (disposables != null && disposables.Contains(toDisposeArg)) { disposables.Remove(toDisposeArg); } } } public class DisposeEventArgs : EventArgs { public static readonly DisposeEventArgs DisposingEventArgs = new DisposeEventArgs(disposing: true); public static readonly DisposeEventArgs NotDisposingEventArgs = new DisposeEventArgs(disposing: false); public readonly bool Disposing; private DisposeEventArgs(bool disposing) { Disposing = disposing; } public static DisposeEventArgs Get(bool disposing) { if (!disposing) { return NotDisposingEventArgs; } return DisposingEventArgs; } } [StructLayout(LayoutKind.Sequential)] internal class FunctionCallback { public IntPtr Pointer; public FunctionCallback(IntPtr pointer) { Pointer = pointer; } public unsafe FunctionCallback(void* pointer) { Pointer = new IntPtr(pointer); } public static explicit operator IntPtr(FunctionCallback value) { return value.Pointer; } public static implicit operator FunctionCallback(IntPtr value) { return new FunctionCallback(value); } public unsafe static implicit operator void*(FunctionCallback value) { return (void*)value.Pointer; } public unsafe static explicit operator FunctionCallback(void* value) { return new FunctionCallback(value); } public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "{0}", Pointer); } public string ToString(string format) { if (format == null) { return ToString(); } return string.Format(CultureInfo.CurrentCulture, "{0}", Pointer.ToString(format)); } public override int GetHashCode() { return Pointer.ToInt32(); } public bool Equals(FunctionCallback other) { return Pointer == other.Pointer; } public override bool Equals(object value) { if (value == null) { return false; } if ((object)value.GetType() != typeof(FunctionCallback)) { return false; } return Equals((FunctionCallback)value); } } public interface ICallbackable : IDisposable { IDisposable Shadow { get; set; } } [Shadow(typeof(InspectableShadow))] [Guid("AF86E2E0-B12D-4c6a-9C5A-D7AA65101E90")] public interface IInspectable : ICallbackable, IDisposable { } internal class InspectableShadow : ComObjectShadow { public class InspectableProviderVtbl : ComObjectVtbl { [UnmanagedFunctionPointer(CallingConvention.StdCall)] private unsafe delegate int GetIidsDelegate(IntPtr thisPtr, int* iidCount, IntPtr* iids); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int GetRuntimeClassNameDelegate(IntPtr thisPtr, IntPtr className); private enum TrustLevel { BaseTrust, PartialTrust, FullTrust } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int GetTrustLevelDelegate(IntPtr thisPtr, IntPtr trustLevel); public InspectableProviderVtbl() : base(3) { AddMethod(new GetIidsDelegate(GetIids)); AddMethod(new GetRuntimeClassNameDelegate(GetRuntimeClassName)); AddMethod(new GetTrustLevelDelegate(GetTrustLevel)); } private unsafe static int GetIids(IntPtr thisPtr, int* iidCount, IntPtr* iids) { try { ShadowContainer shadowContainer = (ShadowContainer)((IInspectable)CppObjectShadow.ToShadow<InspectableShadow>(thisPtr).Callback).Shadow; int num = shadowContainer.Guids.Length; iids = (IntPtr*)(void*)Marshal.AllocCoTaskMem(IntPtr.Size * num); *iidCount = num; for (int i = 0; i < num; i++) { iids[i] = shadowContainer.Guids[i]; } } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } private static int GetRuntimeClassName(IntPtr thisPtr, IntPtr className) { try { _ = (IInspectable)CppObjectShadow.ToShadow<InspectableShadow>(thisPtr).Callback; } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } private static int GetTrustLevel(IntPtr thisPtr, IntPtr trustLevel) { try { _ = (IInspectable)CppObjectShadow.ToShadow<InspectableShadow>(thisPtr).Callback; Marshal.WriteInt32(trustLevel, 2); } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } } private static readonly InspectableProviderVtbl Vtbl = new InspectableProviderVtbl(); protected override CppObjectVtbl GetVtbl => Vtbl; public static IntPtr ToIntPtr(IInspectable callback) { return CppObject.ToCallbackPtr<IInspectable>(callback); } } internal class Interop { public unsafe static void* Fixed<T>(ref T data) { throw new NotImplementedException(); } public unsafe static void* Fixed<T>(T[] data) { throw new NotImplementedException(); } public unsafe static void* Cast<T>(ref T data) where T : struct { return Unsafe.AsPointer(ref data); } public unsafe static void* CastOut<T>(out T data) where T : struct { return Unsafe.AsPointer(ref data); } public static TCAST[] CastArray<TCAST, T>(T[] arrayData) where TCAST : struct where T : struct { return (TCAST[])(object)arrayData; } public unsafe static void memcpy(void* pDest, void* pSrc, int count) { // IL cpblk instruction Unsafe.CopyBlockUnaligned(pDest, pSrc, count); } public unsafe static void memset(void* pDest, byte value, int count) { // IL initblk instruction Unsafe.InitBlockUnaligned(pDest, value, count); } public unsafe static void* Read<T>(void* pSrc, ref T data) where T : struct { fixed (T* ptr = &data) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>(); // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref reference, pSrc, num); return num + (byte*)pSrc; } } public unsafe static T ReadInline<T>(void* pSrc) where T : struct { throw new NotImplementedException(); } public unsafe static void WriteInline<T>(void* pDest, ref T data) where T : struct { throw new NotImplementedException(); } public unsafe static void CopyInline<T>(ref T data, void* pSrc) where T : struct { throw new NotImplementedException(); } public unsafe static void CopyInline<T>(void* pDest, ref T srcData) where T : struct { throw new NotImplementedException(); } public unsafe static void CopyInlineOut<T>(out T data, void* pSrc) where T : struct { throw new NotImplementedException(); } public unsafe static void* ReadOut<T>(void* pSrc, out T data) where T : struct { fixed (T* ptr = &data) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>(); // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref reference, pSrc, num); return num + (byte*)pSrc; } } public unsafe static void* Read<T>(void* pSrc, T[] data, int offset, int count) where T : struct { fixed (T* ptr = &data[offset]) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>() * count; // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref reference, pSrc, num); return num + (byte*)pSrc; } } public unsafe static void* Read2D<T>(void* pSrc, T[,] data, int offset, int count) where T : struct { fixed (T* ptr = &data[offset]) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>() * count; // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref reference, pSrc, num); return num + (byte*)pSrc; } } public static int SizeOf<T>() { throw new NotImplementedException(); } public unsafe static void* Write<T>(void* pDest, ref T data) where T : struct { fixed (T* ptr = &data) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>(); // IL cpblk instruction Unsafe.CopyBlockUnaligned(pDest, ref reference, num); return num + (byte*)pDest; } } public unsafe static void* Write<T>(void* pDest, T[] data, int offset, int count) where T : struct { fixed (T* ptr = &data[offset]) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>() * count; // IL cpblk instruction Unsafe.CopyBlockUnaligned(pDest, ref reference, num); return num + (byte*)pDest; } } public unsafe static void* Write2D<T>(void* pDest, T[,] data, int offset, int count) where T : struct { fixed (T* ptr = &data[offset]) { ref ? reference = ref *(?*)ptr; int num = Unsafe.SizeOf<T>() * count; // IL cpblk instruction Unsafe.CopyBlockUnaligned(pDest, ref reference, num); return num + (byte*)pDest; } } [Tag("SharpDX.ModuleInit")] public static void ModuleInit() { } } [Guid("00000000-0000-0000-C000-000000000046")] public interface IUnknown : ICallbackable, IDisposable { Result QueryInterface(ref Guid guid, out IntPtr comObject); int AddReference(); int Release(); } internal class ModuleInit { [Tag("SharpDX.ModuleInit")] internal static void Setup() { ResultDescriptor.RegisterProvider(typeof(Result)); } } [CompilerGenerated] internal class NamespaceDoc { } public struct PointerSize : IEquatable<PointerSize> { private IntPtr _size; public static readonly PointerSize Zero = new PointerSize(0); public PointerSize(IntPtr size) { _size = size; } private unsafe PointerSize(void* size) { _size = new IntPtr(size); } public PointerSize(int size) { _size = new IntPtr(size); } public PointerSize(long size) { _size = new IntPtr(size); } public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "{0}", _size); } public string ToString(string format) { if (format == null) { return ToString(); } return string.Format(CultureInfo.CurrentCulture, "{0}", _size.ToString(format)); } public override int GetHashCode() { return _size.GetHashCode(); } public bool Equals(PointerSize other) { return _size.Equals((object?)(nint)other._size); } public override bool Equals(object value) { if (value == null) { return false; } if (value is PointerSize) { return Equals((PointerSize)value); } return false; } public static PointerSize operator +(PointerSize left, PointerSize right) { return new PointerSize(left._size.ToInt64() + right._size.ToInt64()); } public static PointerSize operator +(PointerSize value) { return value; } public static PointerSize operator -(PointerSize left, PointerSize right) { return new PointerSize(left._size.ToInt64() - right._size.ToInt64()); } public static PointerSize operator -(PointerSize value) { return new PointerSize(-value._size.ToInt64()); } public static PointerSize operator *(int scale, PointerSize value) { return new PointerSize(scale * value._size.ToInt64()); } public static PointerSize operator *(PointerSize value, int scale) { return new PointerSize(scale * value._size.ToInt64()); } public static PointerSize operator /(PointerSize value, int scale) { return new PointerSize(value._size.ToInt64() / scale); } public static bool operator ==(PointerSize left, PointerSize right) { return left.Equals(right); } public static bool operator !=(PointerSize left, PointerSize right) { return !left.Equals(right); } public static implicit operator int(PointerSize value) { return value._size.ToInt32(); } public static implicit operator long(PointerSize value) { return value._size.ToInt64(); } public static implicit operator PointerSize(int value) { return new PointerSize(value); } public static implicit operator PointerSize(long value) { return new PointerSize(value); } public static implicit operator PointerSize(IntPtr value) { return new PointerSize(value); } public static implicit operator IntPtr(PointerSize value) { return value._size; } public unsafe static implicit operator PointerSize(void* value) { return new PointerSize(value); } public unsafe static implicit operator void*(PointerSize value) { return (void*)value._size; } } public struct Result : IEquatable<Result> { private int _code; public static readonly Result Ok = new Result(0); public static readonly Result False = new Result(1); public static readonly ResultDescriptor Abort = new ResultDescriptor(-2147467260, "General", "E_ABORT", "Operation aborted"); public static readonly ResultDescriptor AccessDenied = new ResultDescriptor(-2147024891, "General", "E_ACCESSDENIED", "General access denied error"); public static readonly ResultDescriptor Fail = new ResultDescriptor(-2147467259, "General", "E_FAIL", "Unspecified error"); public static readonly ResultDescriptor Handle = new ResultDescriptor(-2147024890, "General", "E_HANDLE", "Invalid handle"); public static readonly ResultDescriptor InvalidArg = new ResultDescriptor(-2147024809, "General", "E_INVALIDARG", "Invalid Arguments"); public static readonly ResultDescriptor NoInterface = new ResultDescriptor(-2147467262, "General", "E_NOINTERFACE", "No such interface supported"); public static readonly ResultDescriptor NotImplemented = new ResultDescriptor(-2147467263, "General", "E_NOTIMPL", "Not implemented"); public static readonly ResultDescriptor OutOfMemory = new ResultDescriptor(-2147024882, "General", "E_OUTOFMEMORY", "Out of memory"); public static readonly ResultDescriptor InvalidPointer = new ResultDescriptor(-2147467261, "General", "E_POINTER", "Invalid pointer"); public static readonly ResultDescriptor UnexpectedFailure = new ResultDescriptor(-2147418113, "General", "E_UNEXPECTED", "Catastrophic failure"); public static readonly ResultDescriptor WaitAbandoned = new ResultDescriptor(128, "General", "WAIT_ABANDONED", "WaitAbandoned"); public static readonly ResultDescriptor WaitTimeout = new ResultDescriptor(258, "General", "WAIT_TIMEOUT", "WaitTimeout"); public static readonly ResultDescriptor Pending = new ResultDescriptor(-2147483638, "General", "E_PENDING", "Pending"); public int Code => _code; public bool Success => Code >= 0; public bool Failure => Code < 0; public Result(int code) { _code = code; } public Result(uint code) { _code = (int)code; } public static explicit operator int(Result result) { return result.Code; } public static explicit operator uint(Result result) { return (uint)result.Code; } public static implicit operator Result(int result) { return new Result(result); } public static implicit operator Result(uint result) { return new Result(result); } public bool Equals(Result other) { return Code == other.Code; } public override bool Equals(object obj) { if (!(obj is Result)) { return false; } return Equals((Result)obj); } public override int GetHashCode() { return Code; } public static bool operator ==(Result left, Result right) { return left.Code == right.Code; } public static bool operator !=(Result left, Result right) { return left.Code != right.Code; } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "HRESULT = 0x{0:X}", _code); } public void CheckError() { if (_code < 0) { throw new SharpDXException(this); } } public static Result GetResultFromException(Exception ex) { return new Result(Marshal.GetHRForException(ex)); } public static Result GetResultFromWin32Error(int win32Error) { return (int)((win32Error <= 0) ? win32Error : ((win32Error & 0xFFFF) | 0x70000 | 0x80000000u)); } } public sealed class ResultDescriptor { private static readonly object LockDescriptor = new object(); private static readonly List<Type> RegisteredDescriptorProvider = new List<Type>(); private static readonly Dictionary<Result, ResultDescriptor> Descriptors = new Dictionary<Result, ResultDescriptor>(); private const string UnknownText = "Unknown"; public Result Result { get; private set; } public int Code => Result.Code; public string Module { get; private set; } public string NativeApiCode { get; private set; } public string ApiCode { get; private set; } public string Description { get; set; } public ResultDescriptor(Result code, string module, string nativeApiCode, string apiCode, string description = null) { Result = code; Module = module; NativeApiCode = nativeApiCode; ApiCode = apiCode; Description = description; } public bool Equals(ResultDescriptor other) { if (other == null) { return false; } if ((object)this == other) { return true; } return other.Result.Equals(Result); } public override bool Equals(object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (obj.GetType() != typeof(ResultDescriptor)) { return false; } return Equals((ResultDescriptor)obj); } public override int GetHashCode() { return Result.GetHashCode(); } public override string ToString() { return $"HRESULT: [0x{Result.Code:X}], Module: [{Module}], ApiCode: [{NativeApiCode}/{ApiCode}], Message: {Description}"; } public static implicit operator Result(ResultDescriptor result) { return result.Result; } public static explicit operator int(ResultDescriptor result) { return result.Result.Code; } public static explicit operator uint(ResultDescriptor result) { return (uint)result.Result.Code; } public static bool operator ==(ResultDescriptor left, Result right) { if (left == null) { return false; } return left.Result.Code == right.Code; } public static bool operator !=(ResultDescriptor left, Result right) { if (left == null) { return false; } return left.Result.Code != right.Code; } public static void RegisterProvider(Type descriptorsProviderType) { lock (LockDescriptor) { if (!RegisteredDescriptorProvider.Contains(descriptorsProviderType)) { RegisteredDescriptorProvider.Add(descriptorsProviderType); } } } public static ResultDescriptor Find(Result result) { ResultDescriptor value; lock (LockDescriptor) { if (RegisteredDescriptorProvider.Count > 0) { foreach (Type item in RegisteredDescriptorProvider) { AddDescriptorsFromType(item); } RegisteredDescriptorProvider.Clear(); } if (!Descriptors.TryGetValue(result, out value)) { value = new ResultDescriptor(result, "Unknown", "Unknown", "Unknown"); } if (value.Description == null) { string descriptionFromResultCode = GetDescriptionFromResultCode(result.Code); value.Description = descriptionFromResultCode ?? "Unknown"; } } return value; } private static void AddDescriptorsFromType(Type type) { foreach (FieldInfo declaredField in type.GetTypeInfo().DeclaredFields) { if (declaredField.FieldType == typeof(ResultDescriptor) && declaredField.IsPublic && declaredField.IsStatic) { ResultDescriptor resultDescriptor = (ResultDescriptor)declaredField.GetValue(null); if (!Descriptors.ContainsKey(resultDescriptor.Result)) { Descriptors.Add(resultDescriptor.Result, resultDescriptor); } } } } private static string GetDescriptionFromResultCode(int resultCode) { IntPtr lpBuffer = IntPtr.Zero; FormatMessageW(4864, IntPtr.Zero, resultCode, 0, ref lpBuffer, 0, IntPtr.Zero); string? result = Marshal.PtrToStringUni(lpBuffer); Marshal.FreeHGlobal(lpBuffer); return result; } [DllImport("kernel32.dll")] private static extern uint FormatMessageW(int dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, ref IntPtr lpBuffer, int nSize, IntPtr Arguments); } public class ServiceEventArgs : EventArgs { public Type ServiceType { get; private set; } public object Instance { get; private set; } public ServiceEventArgs(Type serviceType, object serviceInstance) { ServiceType = serviceType; Instance = serviceInstance; } } [AttributeUsage(AttributeTargets.Interface)] internal class ShadowAttribute : Attribute { private Type type; public Type Type => type; public ShadowAttribute(Type typeOfTheAssociatedShadow) { type = typeOfTheAssociatedShadow; } public static ShadowAttribute Get(Type type) { return type.GetTypeInfo().GetCustomAttribute<ShadowAttribute>(); } } internal class ShadowContainer : DisposeBase { private readonly Dictionary<Guid, CppObjectShadow> guidToShadow = new Dictionary<Guid, CppObjectShadow>(); private static readonly Dictionary<Type, List<Type>> typeToShadowTypes = new Dictionary<Type, List<Type>>(); private IntPtr guidPtr; public IntPtr[] Guids { get; private set; } public unsafe void Initialize(ICallbackable callbackable) { callbackable.Shadow = this; Type type = callbackable.GetType(); List<Type> value; lock (typeToShadowTypes) { if (!typeToShadowTypes.TryGetValue(type, out value)) { IEnumerable<Type> implementedInterfaces = type.GetTypeInfo().ImplementedInterfaces; value = new List<Type>(); value.AddRange(implementedInterfaces); typeToShadowTypes.Add(type, value); foreach (Type item in implementedInterfaces) { if (ShadowAttribute.Get(item) == null) { value.Remove(item); continue; } foreach (Type implementedInterface in item.GetTypeInfo().ImplementedInterfaces) { value.Remove(implementedInterface); } } } } CppObjectShadow cppObjectShadow = null; foreach (Type item2 in value) { CppObjectShadow cppObjectShadow2 = (CppObjectShadow)Activator.CreateInstance(ShadowAttribute.Get(item2).Type); cppObjectShadow2.Initialize(callbackable); if (cppObjectShadow == null) { cppObjectShadow = cppObjectShadow2; guidToShadow.Add(ComObjectShadow.IID_IUnknown, cppObjectShadow); } guidToShadow.Add(Utilities.GetGuidFromType(item2), cppObjectShadow2); foreach (Type implementedInterface2 in item2.GetTypeInfo().ImplementedInterfaces) { if (ShadowAttribute.Get(implementedInterface2) != null) { guidToShadow.Add(Utilities.GetGuidFromType(implementedInterface2), cppObjectShadow2); } } } int num = 0; foreach (Guid key in guidToShadow.Keys) { if (key != Utilities.GetGuidFromType(typeof(IInspectable)) && key != Utilities.GetGuidFromType(typeof(IUnknown))) { num++; } } guidPtr = Marshal.AllocHGlobal(Utilities.SizeOf<Guid>() * num); Guids = new IntPtr[num]; int num2 = 0; Guid* ptr = (Guid*)(void*)guidPtr; foreach (Guid key2 in guidToShadow.Keys) { if (!(key2 == Utilities.GetGuidFromType(typeof(IInspectable))) && !(key2 == Utilities.GetGuidFromType(typeof(IUnknown)))) { ptr[num2] = key2; Guids[num2] = new IntPtr(ptr + num2); num2++; } } } internal IntPtr Find(Type type) { return Find(Utilities.GetGuidFromType(type)); } internal IntPtr Find(Guid guidType) { return FindShadow(guidType)?.NativePointer ?? IntPtr.Zero; } internal CppObjectShadow FindShadow(Guid guidType) { guidToShadow.TryGetValue(guidType, out var value); return value; } protected override void Dispose(bool disposing) { if (!disposing) { return; } foreach (CppObjectShadow value in guidToShadow.Values) { value.Dispose(); } guidToShadow.Clear(); if (guidPtr != IntPtr.Zero) { Marshal.FreeHGlobal(guidPtr); guidPtr = IntPtr.Zero; } } } public class SharpDXException : Exception { private ResultDescriptor descriptor; public Result ResultCode => descriptor.Result; public ResultDescriptor Descriptor => descriptor; public SharpDXException() : base("A SharpDX exception occurred.") { descriptor = ResultDescriptor.Find(Result.Fail); base.HResult = (int)Result.Fail; } public SharpDXException(Result result) : this(ResultDescriptor.Find(result)) { base.HResult = (int)result; } public SharpDXException(ResultDescriptor descriptor) : base(descriptor.ToString()) { this.descriptor = descriptor; base.HResult = (int)descriptor.Result; } public SharpDXException(Result result, string message) : base(message) { descriptor = ResultDescriptor.Find(result); base.HResult = (int)result; } public SharpDXException(Result result, string message, params object[] args) : base(string.Format(CultureInfo.InvariantCulture, message, args)) { descriptor = ResultDescriptor.Find(result); base.HResult = (int)result; } public SharpDXException(string message, params object[] args) : this(Result.Fail, message, args) { } public SharpDXException(string message, Exception innerException, params object[] args) : base(string.Format(CultureInfo.InvariantCulture, message, args), innerException) { descriptor = ResultDescriptor.Find(Result.Fail); base.HResult = (int)Result.Fail; } } public struct Size2 : IEquatable<Size2> { public static readonly Size2 Zero = new Size2(0, 0); public static readonly Size2 Empty = Zero; public int Width; public int Height; public Size2(int width, int height) { Width = width; Height = height; } public bool Equals(Size2 other) { if (other.Width == Width) { return other.Height == Height; } return false; } public override bool Equals(object obj) { if (!(obj is Size2)) { return false; } return Equals((Size2)obj); } public override int GetHashCode() { return (Width * 397) ^ Height; } public static bool operator ==(Size2 left, Size2 right) { return left.Equals(right); } public static bool operator !=(Size2 left, Size2 right) { return !left.Equals(right); } public override string ToString() { return $"({Width},{Height})"; } } public struct Size2F : IEquatable<Size2F> { public static readonly Size2F Zero = new Size2F(0f, 0f); public static readonly Size2F Empty = Zero; public float Width; public float Height; public Size2F(float width, float height) { Width = width; Height = height; } public bool Equals(Size2F other) { if (other.Width == Width) { return other.Height == Height; } return false; } public override bool Equals(object obj) { if (!(obj is Size2F)) { return false; } return Equals((Size2F)obj); } public override int GetHashCode() { return (Width.GetHashCode() * 397) ^ Height.GetHashCode(); } public static bool operator ==(Size2F left, Size2F right) { return left.Equals(right); } public static bool operator !=(Size2F left, Size2F right) { return !left.Equals(right); } public override string ToString() { return $"({Width},{Height})"; } } [AttributeUsage(AttributeTargets.All)] public class TagAttribute : Attribute { public string Value { get; private set; } public TagAttribute(string value) { Value = value; } } public delegate void GetValueFastDelegate<T>(object obj, out T value); public delegate void SetValueFastDelegate<T>(object obj, ref T value); public static class Utilities { [Flags] public enum CLSCTX : uint { ClsctxInprocServer = 1u, ClsctxInprocHandler = 2u, ClsctxLocalServer = 4u, ClsctxInprocServer16 = 8u, ClsctxRemoteServer = 0x10u, ClsctxInprocHandler16 = 0x20u, ClsctxReserved1 = 0x40u, ClsctxReserved2 = 0x80u, ClsctxReserved3 = 0x100u, ClsctxReserved4 = 0x200u, ClsctxNoCodeDownload = 0x400u, ClsctxReserved5 = 0x800u, ClsctxNoCustomMarshal = 0x1000u, ClsctxEnableCodeDownload = 0x2000u, ClsctxNoFailureLog = 0x4000u, ClsctxDisableAaa = 0x8000u, ClsctxEnableAaa = 0x10000u, ClsctxFromDefaultContext = 0x20000u, ClsctxInproc = 3u, ClsctxServer = 0x15u, ClsctxAll = 0x17u } public enum CoInit { MultiThreaded = 0, ApartmentThreaded = 2, DisableOle1Dde = 4, SpeedOverMemory = 8 } internal struct Buffer<TElement> { internal TElement[] items; internal int count; internal Buffer(IEnumerable<TElement> source) { TElement[] array = null; int num = 0; if (source is ICollection<TElement> collection) { num = collection.Count; if (num > 0) { array = new TElement[num]; collection.CopyTo(array, 0); } } else { foreach (TElement item in source) { if (array == null) { array = new TElement[4]; } else if (array.Length == num) { TElement[] array2 = new TElement[checked(num * 2)]; Array.Copy(array, 0, array2, 0, num); array = array2; } array[num] = item; num++; } } items = array; count = num; } internal TElement[] ToArray() { if (count == 0) { return new TElement[0]; } if (items.Length == count) { return items; } TElement[] array = new TElement[count]; Array.Copy(items, 0, array, 0, count); return array; } } public unsafe static void CopyMemory(IntPtr dest, IntPtr src, int sizeInBytesToCopy) { Interop.memcpy((void*)dest, (void*)src, sizeInBytesToCopy); } public unsafe static bool CompareMemory(IntPtr from, IntPtr against, int sizeToCompare) { byte* ptr = (byte*)(void*)from; byte* ptr2 = (byte*)(void*)against; for (int num = sizeToCompare >> 3; num > 0; num--) { if (*(long*)ptr != *(long*)ptr2) { return false; } ptr += 8; ptr2 += 8; } for (int num = sizeToCompare & 7; num > 0; num--) { if (*ptr != *ptr2) { return false; } ptr++; ptr2++; } return true; } public unsafe static void ClearMemory(IntPtr dest, byte value, int sizeInBytesToClear) { Interop.memset((void*)dest, value, sizeInBytesToClear); } public static int SizeOf<T>() where T : struct { return Unsafe.SizeOf<T>(); } public static int SizeOf<T>(T[] array) where T : struct { if (array != null) { return array.Length * Unsafe.SizeOf<T>(); } return 0; } public unsafe static void Pin<T>(ref T source, Action<IntPtr> pinAction) where T : struct { fixed (T* ptr = &source) { pinAction((IntPtr)ptr); } } public unsafe static void Pin<T>(T[] source, Action<IntPtr> pinAction) where T : struct { //The blocks IL_0019 are reachable both inside and outside the pinned region starting at IL_000b. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement. IntPtr obj; if (source != null) { fixed (T* ptr = &source[0]) { obj = (IntPtr)ptr; pinAction(obj); return; } } obj = IntPtr.Zero; pinAction(obj); } public unsafe static byte[] ToByteArray<T>(T[] source) where T : struct { if (source == null) { return null; } byte[] array = new byte[SizeOf<T>() * source.Length]; if (source.Length == 0) { return array; } fixed (byte* ptr = array) { void* pDest = ptr; Interop.Write(pDest, source, 0, source.Length); } return array; } public static void Swap<T>(ref T left, ref T right) { T val = left; left = right; right = val; } public unsafe static T Read<T>(IntPtr source) where T : struct { return Unsafe.Read<T>((void*)source); } public unsafe static void Read<T>(IntPtr source, ref T data) where T : struct { data = Unsafe.Read<T>((void*)source); } public unsafe static void ReadOut<T>(IntPtr source, out T data) where T : struct { data = Unsafe.Read<T>((void*)source); } public unsafe static IntPtr ReadAndPosition<T>(IntPtr source, ref T data) where T : struct { return (IntPtr)Interop.Read((void*)source, ref data); } public unsafe static IntPtr Read<T>(IntPtr source, T[] data, int offset, int count) where T : struct { return (IntPtr)Interop.Read((void*)source, data, offset, count); } public unsafe static void Write<T>(IntPtr destination, ref T data) where T : struct { Unsafe.Write((void*)destination, data); } public unsafe static IntPtr WriteAndPosition<T>(IntPtr destination, ref T data) where T : struct { return (IntPtr)Interop.Write((void*)destination, ref data); } public unsafe static IntPtr Write<T>(IntPtr destination, T[] data, int offset, int count) where T : struct { return (IntPtr)Interop.Write((void*)destination, data, offset, count); } public unsafe static void ConvertToIntArray(bool[] array, int* dest) { for (int i = 0; i < array.Length; i++) { dest[i] = (array[i] ? 1 : 0); } } public static RawBool[] ConvertToIntArray(bool[] array) { RawBool[] array2 = new RawBool[array.Length]; for (int i = 0; i < array2.Length; i++) { array2[i] = array[i]; } return array2; } public unsafe static bool[] ConvertToBoolArray(int* array, int length) { bool[] array2 = new bool[length]; for (int i = 0; i < array2.Length; i++) { array2[i] = array[i] != 0; } return array2; } public static bool[] ConvertToBoolArray(RawBool[] array) { bool[] array2 = new bool[array.Length]; for (int i = 0; i < array2.Length; i++) { array2[i] = array[i]; } return array2; } public static Guid GetGuidFromType(Type type) { return type.GetTypeInfo().GUID; } public static bool IsAssignableToGenericType(Type givenType, Type genericType) { foreach (Type implementedInterface in givenType.GetTypeInfo().ImplementedInterfaces) { if (implementedInterface.GetTypeInfo().IsGenericType && implementedInterface.GetGenericTypeDefinition() == genericType) { return true; } } if (givenType.GetTypeInfo().IsGenericType && givenType.GetGenericTypeDefinition() == genericType) { return true; } Type baseType = givenType.GetTypeInfo().BaseType; if (baseType == null) { return false; } return IsAssignableToGenericType(baseType, genericType); } public unsafe static IntPtr AllocateMemory(int sizeInBytes, int align = 16) { int num = align - 1; IntPtr intPtr = Marshal.AllocHGlobal(sizeInBytes + num + IntPtr.Size); long num2 = (long)((byte*)(void*)intPtr + sizeof(void*) + num) & (long)(~num); *(IntPtr*)((nint)num2 + (nint)(-1) * (nint)sizeof(IntPtr)) = intPtr; return new IntPtr((void*)num2); } public static IntPtr AllocateClearedMemory(int sizeInBytes, byte clearValue = 0, int align = 16) { IntPtr intPtr = AllocateMemory(sizeInBytes, align); ClearMemory(intPtr, clearValue, sizeInBytes); return intPtr; } public static bool IsMemoryAligned(IntPtr memoryPtr, int align = 16) { return (memoryPtr.ToInt64() & (align - 1)) == 0; } public unsafe static void FreeMemory(IntPtr alignedBuffer) { if (!(alignedBuffer == IntPtr.Zero)) { Marshal.FreeHGlobal(*(IntPtr*)((byte*)(void*)alignedBuffer + (nint)(-1) * (nint)sizeof(IntPtr))); } } public static string PtrToStringAnsi(IntPtr pointer, int maxLength) { string text = Marshal.PtrToStringAnsi(pointer); if (text != null && text.Length > maxLength) { text = text.Substring(0, maxLength); } return text; } public static string PtrToStringUni(IntPtr pointer, int maxLength) { string text = Marshal.PtrToStringUni(pointer); if (text != null && text.Length > maxLength) { text = text.Substring(0, maxLength); } return text; } public static IntPtr StringToHGlobalAnsi(string s) { return Marshal.StringToHGlobalAnsi(s); } public static IntPtr StringToHGlobalUni(string s) { return Marshal.StringToHGlobalUni(s); } public static IntPtr StringToCoTaskMemUni(string s) { if (s == null) { return IntPtr.Zero; } int num = (s.Length + 1) * 2; if (num < s.Length) { throw new ArgumentOutOfRangeException("s"); } IntPtr intPtr = Marshal.AllocCoTaskMem(num); if (intPtr == IntPtr.Zero) { throw new OutOfMemoryException(); } CopyStringToUnmanaged(intPtr, s); return intPtr; } private unsafe static void CopyStringToUnmanaged(IntPtr ptr, string str) { fixed (char* value = str) { CopyMemory(ptr, new IntPtr(value), (str.Length + 1) * 2); } } public static IntPtr GetIUnknownForObject(object obj) { if (obj != null) { return Marshal.GetIUnknownForObject(obj); } return IntPtr.Zero; } public static object GetObjectForIUnknown(IntPtr iunknownPtr) { if (!(iunknownPtr == IntPtr.Zero)) { return Marshal.GetObjectForIUnknown(iunknownPtr); } return null; } public static string Join<T>(string separator, T[] array) { StringBuilder stringBuilder = new StringBuilder(); if (array != null) { for (int i = 0; i < array.Length; i++) { if (i > 0) { stringBuilder.Append(separator); } stringBuilder.Append(array[i]); } } return stringBuilder.ToString(); } public static string Join(string separator, IEnumerable elements) { List<string> list = new List<string>(); foreach (object element in elements) { list.Add(element.ToString()); } StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < list.Count; i++) { string value = list[i]; if (i > 0) { stringBuilder.Append(separator); } stringBuilder.Append(value); } return stringBuilder.ToString(); } public static string Join(string separator, IEnumerator elements) { List<string> list = new List<string>(); while (elements.MoveNext()) { list.Add(elements.Current.ToString()); } StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < list.Count; i++) { string value = list[i]; if (i > 0) { stringBuilder.Append(separator); } stringBuilder.Append(value); } return stringBuilder.ToString(); } public static string BlobToString(Blob blob) { if (blob == null) { return null; } string? result = Marshal.PtrToStringAnsi(blob.BufferPointer); blob.Dispose(); return result; } public unsafe static IntPtr IntPtrAdd(IntPtr ptr, int offset) { return new IntPtr((byte*)(void*)ptr + offset); } public static byte[] ReadStream(Stream stream) { int readLength = 0; return ReadStream(stream, ref readLength); } public static byte[] ReadStream(Stream stream, ref int readLength) { if (readLength == 0) { readLength = (int)(stream.Length - stream.Position); } int num = readLength; if (num == 0) { return new byte[0]; } byte[] array = new byte[num]; int num2 = 0; if (num > 0) { do { num2 += stream.Read(array, num2, readLength - num2); } while (num2 < readLength); } return array; } public static bool Compare(IEnumerable left, IEnumerable right) { if (left == right) { return true; } if (left == null || right == null) { return false; } return Compare(left.GetEnumerator(), right.GetEnumerator()); } public static bool Compare(IEnumerator leftIt, IEnumerator rightIt) { if (leftIt == rightIt) { return true; } if (leftIt == null || rightIt == null) { return false; } bool flag; bool flag2; while (true) { flag = leftIt.MoveNext(); flag2 = rightIt.MoveNext(); if (!flag || !flag2) { break; } if (!object.Equals(leftIt.Current, rightIt.Current)) { return false; } } if (flag != flag2) { return false; } return true; } public static bool Compare(ICollection left, ICollection right) { if (left == right) { return true; } if (left == null || right == null) { return false; } if (left.Count != right.Count) { return false; } int num = 0; IEnumerator enumerator = left.GetEnumerator(); IEnumerator enumerator2 = right.GetEnumerator(); while (enumerator.MoveNext() && enumerator2.MoveNext()) { if (!object.Equals(enumerator.Current, enumerator2.Current)) { return false; } num++; } if (num != left.Count) { return false; } return true; } public static T GetCustomAttribute<T>(MemberInfo memberInfo, bool inherited = false) where T : Attribute { return memberInfo.GetCustomAttribute<T>(inherited); } public static IEnumerable<T> GetCustomAttributes<T>(MemberInfo memberInfo, bool inherited = false) where T : Attribute { return memberInfo.GetCustomAttributes<T>(inherited); } public static bool IsAssignableFrom(Type toType, Type fromType) { return toType.GetTypeInfo().IsAssignableFrom(fromType.GetTypeInfo()); } public static bool IsEnum(Type typeToTest) { return typeToTest.GetTypeInfo().IsEnum; } public static bool IsValueType(Type typeToTest) { return typeToTest.GetTypeInfo().IsValueType; } private static MethodInfo GetMethod(Type type, string name, Type[] typeArgs) { foreach (MethodInfo declaredMethod in type.GetTypeInfo().GetDeclaredMethods(name)) { if (declaredMethod.GetParameters().Length != typeArgs.Length) { continue; } ParameterInfo[] parameters = declaredMethod.GetParameters(); bool flag = true; for (int i = 0; i < typeArgs.Length; i++) { if (parameters[i].ParameterType != typeArgs[i]) { flag = false; break; } } if (flag) { return declaredMethod; } } return null; } public static GetValueFastDelegate<T> BuildPropertyGetter<T>(Type customEffectType, PropertyInfo propertyInfo) { ParameterExpression parameterExpression = Expression.Parameter(typeof(T).MakeByRefType()); ParameterExpression parameterExpression2 = Expression.Parameter(typeof(object)); MemberExpression memberExpression = Expression.Property(Expression.Convert(parameterExpression2, customEffectType), propertyInfo); Expression right = ((!(propertyInfo.PropertyType == typeof(bool))) ? ((Expression)Expression.Convert(memberExpression, typeof(T))) : ((Expression)Expression.Condition(memberExpression, Expression.Constant(1), Expression.Constant(0)))); return Expression.Lambda<GetValueFastDelegate<T>>(Expression.Assign(parameterExpression, right), new ParameterExpression[2] { parameterExpression2, parameterExpression }).Compile(); } public static SetValueFastDelegate<T> BuildPropertySetter<T>(Type customEffectType, PropertyInfo propertyInfo) { ParameterExpression parameterExpression = Expression.Parameter(typeof(T).MakeByRefType()); ParameterExpression parameterExpression2 = Expression.Parameter(typeof(object)); MemberExpression left = Expression.Property(Expression.Convert(parameterExpression2, customEffectType), propertyInfo); Expression right = ((!(propertyInfo.PropertyType == typeof(bool))) ? ((Expression)Expression.Convert(parameterExpression, propertyInfo.PropertyType)) : ((Expression)Expression.NotEqual(parameterExpression, Expression.Constant(0)))); return Expression.Lambda<SetValueFastDelegate<T>>(Expression.Assign(left, right), new ParameterExpression[2] { parameterExpression2, parameterExpression }).Compile(); } private static MethodInfo FindExplicitConverstion(Type sourceType, Type targetType) { if (sourceType == targetType) { return null; } List<MethodInfo> list = new List<MethodInfo>(); Type type = sourceType; while (type != null) { list.AddRange(type.GetTypeInfo().DeclaredMethods); type = type.GetTypeInfo().BaseType; } type = targetType; while (type != null) { list.AddRange(type.GetTypeInfo().DeclaredMethods); type = type.GetTypeInfo().BaseType; } foreach (MethodInfo item in list) { if (item.Name == "op_Explicit" && item.ReturnType == targetType && IsAssignableFrom(item.GetParameters()[0].ParameterType, sourceType)) { return item; } } return null; } [DllImport("ole32.dll", ExactSpelling = true)] private static extern Result CoCreateInstance([In][MarshalAs(UnmanagedType.LPStruct)] Guid rclsid, IntPtr pUnkOuter, CLSCTX dwClsContext, [In][MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IntPtr comObject); internal static void CreateComInstance(Guid clsid, CLSCTX clsctx, Guid riid, ComObject comObject) { CoCreateInstance(clsid, IntPtr.Zero, clsctx, riid, out var comObject2).CheckError(); comObject.NativePointer = comObject2; } internal static bool TryCreateComInstance(Guid clsid, CLSCTX clsctx, Guid riid, ComObject comObject) { IntPtr comObject2; Result result = CoCreateInstance(clsid, IntPtr.Zero, clsctx, riid, out comObject2); comObject.NativePointer = comObject2; return result.Success; } [DllImport("kernel32.dll", SetLastError = true)] internal static extern bool CloseHandle(IntPtr handle); public static IntPtr GetProcAddress(IntPtr handle, string dllFunctionToImport) { IntPtr procAddress_ = GetProcAddress_(handle, dllFunctionToImport); if (procAddress_ == IntPtr.Zero) { throw new SharpDXException(dllFunctionToImport); } return procAddress_; } [DllImport("kernel32", CharSet = CharSet.Ansi, EntryPoint = "GetProcAddress", ExactSpelling = true, SetLastError = true)] private static extern IntPtr GetProcAddress_(IntPtr hModule, string procName); public static int ComputeHashFNVModified(byte[] data) { uint num = 2166136261u; foreach (byte b in data) { num = (num ^ b) * 16777619; } num += num << 13; num ^= num >> 7; num += num << 3; num ^= num >> 17; return (int)(num + (num << 5)); } public static void Dispose<T>(ref T comObject) where T : class, IDisposable { if (comObject != null) { comObject.Dispose(); comObject = null; } } public static T[] ToArray<T>(IEnumerable<T> source) { return new Buffer<T>(source).ToArray(); } public static bool Any<T>(IEnumerable<T> source) { return source.GetEnumerator().MoveNext(); } public static IEnumerable<TResult> SelectMany<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector) { foreach (TSource item in source) { foreach (TResult item2 in selector(item)) { yield return item2; } } } public static IEnumerable<TSource> Distinct<TSource>(IEnumerable<TSource> source, IEqualityComparer<TSource> comparer = null) { if (comparer == null) { comparer = EqualityComparer<TSource>.Default; } Dictionary<TSource, object> values = new Dictionary<TSource, object>(comparer); foreach (TSource item in source) { if (!values.ContainsKey(item)) { values.Add(item, null); yield return item; } } } public static bool IsTypeInheritFrom(Type type, string parentType) { while (type != null) { if (type.FullName == parentType) { return true; } type = type.GetTypeInfo().BaseType; } return false; } } } namespace SharpDX.Win32 { public struct BitmapInfoHeader { public int SizeInBytes; public int Width; public int Height; public short PlaneCount; public short BitCount; public int Compression; public int SizeImage; public int XPixelsPerMeter; public int YPixelsPerMeter; public int ColorUsedCount; public int ColorImportantCount; } public class ComBaseStreamNative { public IDisposable Callback { get; set; } } internal class ComStreamBaseShadow : ComObjectShadow { internal class ComStreamBaseVtbl : ComObjectVtbl { [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int ReadDelegate(IntPtr thisPtr, IntPtr buffer, int sizeOfBytes, out int bytesRead); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int WriteDelegate(IntPtr thisPtr, IntPtr buffer, int sizeOfBytes, out int bytesWrite); public ComStreamBaseVtbl(int numberOfMethods) : base(numberOfMethods + 2) { AddMethod(new ReadDelegate(ReadImpl)); AddMethod(new WriteDelegate(WriteImpl)); } private static int ReadImpl(IntPtr thisPtr, IntPtr buffer, int sizeOfBytes, out int bytesRead) { bytesRead = 0; try { IStream stream = (IStream)CppObjectShadow.ToShadow<ComStreamBaseShadow>(thisPtr).Callback; bytesRead = stream.Read(buffer, sizeOfBytes); } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } private static int WriteImpl(IntPtr thisPtr, IntPtr buffer, int sizeOfBytes, out int bytesWrite) { bytesWrite = 0; try { IStream stream = (IStream)CppObjectShadow.ToShadow<ComStreamBaseShadow>(thisPtr).Callback; bytesWrite = stream.Write(buffer, sizeOfBytes); } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } } private static readonly ComStreamBaseVtbl Vtbl = new ComStreamBaseVtbl(0); protected override CppObjectVtbl GetVtbl => Vtbl; } [Guid("0000000c-0000-0000-C000-000000000046")] internal class ComStreamProxy : CallbackBase, IStream, IStreamBase, IUnknown, ICallbackable, IDisposable { private Stream sourceStream; private byte[] tempBuffer = new byte[4096]; public ComStreamProxy(Stream sourceStream) { this.sourceStream = sourceStream; } public unsafe int Read(IntPtr buffer, int numberOfBytesToRead) { int num = 0; while (numberOfBytesToRead > 0) { int count = Math.Min(numberOfBytesToRead, tempBuffer.Length); int num2 = sourceStream.Read(tempBuffer, 0, count); if (num2 == 0) { return num; } Utilities.Write(new IntPtr(num + (byte*)(void*)buffer), tempBuffer, 0, num2); numberOfBytesToRead -= num2; num += num2; } return num; } public unsafe int Write(IntPtr buffer, int numberOfBytesToWrite) { int num = 0; while (numberOfBytesToWrite > 0) { int num2 = Math.Min(numberOfBytesToWrite, tempBuffer.Length); Utilities.Read(new IntPtr(num + (byte*)(void*)buffer), tempBuffer, 0, num2); sourceStream.Write(tempBuffer, 0, num2); numberOfBytesToWrite -= num2; num += num2; } return num; } public long Seek(long offset, SeekOrigin origin) { return sourceStream.Seek(offset, origin); } public void SetSize(long newSize) { } public unsafe long CopyTo(IStream streamDest, long numberOfBytesToCopy, out long bytesWritten) { bytesWritten = 0L; fixed (byte* ptr = tempBuffer) { void* ptr2 = ptr; while (numberOfBytesToCopy > 0) { int count = (int)Math.Min(numberOfBytesToCopy, tempBuffer.Length); int num = sourceStream.Read(tempBuffer, 0, count); if (num == 0) { break; } streamDest.Write((IntPtr)ptr2, num); numberOfBytesToCopy -= num; bytesWritten += num; } } return bytesWritten; } public void Commit(CommitFlags commitFlags) { sourceStream.Flush(); } public void Revert() { throw new NotImplementedException(); } public void LockRegion(long offset, long numberOfBytesToLock, LockType dwLockType) { throw new NotImplementedException(); } public void UnlockRegion(long offset, long numberOfBytesToLock, LockType dwLockType) { throw new NotImplementedException(); } public StorageStatistics GetStatistics(StorageStatisticsFlags storageStatisticsFlags) { long num = sourceStream.Length; if (num == 0L) { num = 2147483647L; } StorageStatistics result = default(StorageStatistics); result.Type = 2; result.CbSize = num; result.GrfLocksSupported = 2; result.GrfMode = 2; return result; } public IStream Clone() { return new ComStreamProxy(sourceStream); } protected override void Dispose(bool disposing) { sourceStream = null; base.Dispose(disposing); } } internal class ComStreamShadow : ComStreamBaseShadow { private class ComStreamVtbl : ComStreamBaseVtbl { [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int SeekDelegate(IntPtr thisPtr, long offset, SeekOrigin origin, IntPtr newPosition); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result SetSizeDelegate(IntPtr thisPtr, long newSize); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate int CopyToDelegate(IntPtr thisPtr, IntPtr streamPointer, long numberOfBytes, out long numberOfBytesRead, out long numberOfBytesWritten); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result CommitDelegate(IntPtr thisPtr, CommitFlags flags); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result RevertDelegate(IntPtr thisPtr); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result LockRegionDelegate(IntPtr thisPtr, long offset, long numberOfBytes, LockType lockType); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result UnlockRegionDelegate(IntPtr thisPtr, long offset, long numberOfBytes, LockType lockType); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result StatDelegate(IntPtr thisPtr, ref StorageStatistics.__Native statisticsPtr, StorageStatisticsFlags flags); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate Result CloneDelegate(IntPtr thisPtr, out IntPtr streamPointer); public ComStreamVtbl() : base(9) { AddMethod(new SeekDelegate(SeekImpl)); AddMethod(new SetSizeDelegate(SetSizeImpl)); AddMethod(new CopyToDelegate(CopyToImpl)); AddMethod(new CommitDelegate(CommitImpl)); AddMethod(new RevertDelegate(RevertImpl)); AddMethod(new LockRegionDelegate(LockRegionImpl)); AddMethod(new UnlockRegionDelegate(UnlockRegionImpl)); AddMethod(new StatDelegate(StatImpl)); AddMethod(new CloneDelegate(CloneImpl)); } private unsafe static int SeekImpl(IntPtr thisPtr, long offset, SeekOrigin origin, IntPtr newPosition) { try { long num = ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).Seek(offset, origin); if (newPosition != IntPtr.Zero) { *(long*)(void*)newPosition = num; } } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } private static Result SetSizeImpl(IntPtr thisPtr, long newSize) { Result result = Result.Ok; try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).SetSize(newSize); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } private static int CopyToImpl(IntPtr thisPtr, IntPtr streamPointer, long numberOfBytes, out long numberOfBytesRead, out long numberOfBytesWritten) { numberOfBytesRead = 0L; numberOfBytesWritten = 0L; try { IStream stream = (IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback; numberOfBytesRead = stream.CopyTo(new ComStream(streamPointer), numberOfBytes, out numberOfBytesWritten); } catch (Exception ex) { return (int)Result.GetResultFromException(ex); } return Result.Ok.Code; } private static Result CommitImpl(IntPtr thisPtr, CommitFlags flags) { Result result = Result.Ok; try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).Commit(flags); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } private static Result RevertImpl(IntPtr thisPtr) { Result result = Result.Ok; try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).Revert(); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } private static Result LockRegionImpl(IntPtr thisPtr, long offset, long numberOfBytes, LockType lockType) { Result result = Result.Ok; try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).LockRegion(offset, numberOfBytes, lockType); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } private static Result UnlockRegionImpl(IntPtr thisPtr, long offset, long numberOfBytes, LockType lockType) { Result result = Result.Ok; try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).UnlockRegion(offset, numberOfBytes, lockType); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } private static Result StatImpl(IntPtr thisPtr, ref StorageStatistics.__Native statisticsPtr, StorageStatisticsFlags flags) { try { ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).GetStatistics(flags).__MarshalTo(ref statisticsPtr); } catch (SharpDXException ex) { return ex.ResultCode; } catch (Exception) { return Result.Fail.Code; } return Result.Ok; } private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer) { streamPointer = IntPtr.Zero; Result result = Result.Ok; try { IStream stream = ((IStream)CppObjectShadow.ToShadow<ComStreamShadow>(thisPtr).Callback).Clone(); streamPointer = ToIntPtr(stream); } catch (SharpDXException ex) { result = ex.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return result; } } private static readonly ComStreamVtbl Vtbl = new ComStreamVtbl(); protected override CppObjectVtbl GetVtbl => Vtbl; public static IntPtr ToIntPtr(IStream stream) { return CppObject.ToCallbackPtr<IStream>(stream); } } internal class ComStringEnumerator : IEnumerator<string>, IEnumerator, IDisposable, IEnumerable<string>, IEnumerable { private readonly IEnumString enumString; private string current; public string Current => current; object IEnumerator.Current => Current; public ComStringEnumerator(IntPtr ptrToIEnumString) { enumString = (IEnumString)Marshal.GetObjectForIUnknown(ptrToIEnumString); } public void Dispose() { } public unsafe bool MoveNext() { string[] array = new string[1]; int num = 0; bool flag = enumString.Next(1, array, new IntPtr(&num)) == Result.Ok.Code; current = (flag ? array[0] : null); return flag; } public void Reset() { enumString.Reset(); } public IEnumerator<string> GetEnumerator() { return this; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class ErrorCodeHelper { public static Result ToResult(ErrorCode errorCode) { return ToResult((int)errorCode); } public static Result ToResult(int errorCode) { return new Result((errorCode <= 0) ? ((uint)errorCode) : (((uint)errorCode & 0xFFFFu) | 0x80070000u)); } } [Shadow(typeof(ComStreamShadow))] [Guid("0000000c-0000-0000-C000-000000000046")] public interface IStream : IStreamBase, IUnknown, ICallbackable, IDisposable { long Seek(long offset, SeekOrigin origin); void SetSize(long newSize); long CopyTo(IStream streamDest, long numberOfBytesToCopy, out long bytesWritten); void Commit(CommitFlags commitFlags); void Revert(); void LockRegion(long offset, long numberOfBytesToLock, LockType dwLockType); void UnlockRegion(long offset, long numberOfBytesToLock, LockType dwLockType); StorageStatistics GetStatistics(StorageStatisticsFlags storageStatisticsFlags); IStream Clone(); } [Shadow(typeof(ComStreamBaseShadow))] [Guid("0c733a30-2a1c-11ce-ade5-00aa0044773d")] public interface IStreamBase : IUnknown, ICallbackable, IDisposable { int Read(IntPtr buffer, int numberOfBytesToRead); int Write(IntPtr buffer, int numberOfBytesToRead); } [CompilerGenerated] internal class NamespaceDoc { } public struct NativeMessage { public IntPtr handle; public uint msg; public IntPtr wParam; public IntPtr lParam; public uint time; public RawPoint p; } public class PropertyBag : ComObject { [StructLayout(LayoutKind.Sequential, Pack = 1)] private struct PROPBAG2 : IDisposable { internal uint type; internal ushort vt; internal ushort cfType; internal IntPtr dwHint; internal IntPtr pstrName; internal Guid clsid; public string Name { get { return Marshal.PtrToStringUni(pstrName); } set { pstrName = Marshal.StringToCoTaskMemUni(value); } } public void Dispose() { if (pstrName != IntPtr.Zero) { Marshal.FreeCoTaskMem(pstrName); pstrName = IntPtr.Zero; } } } [ComImport] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("22F55882-280B-11D0-A8A9-00A0C90C2004")] private interface IPropertyBag2 { [PreserveSig] Result Read([In] int cProperties, [In] ref PROPBAG2 pPropBag, IntPtr pErrLog, out object pvarValue, out Result phrError); [PreserveSig] Result Write([In] int cProperties, [In] ref PROPBAG2 pPropBag, ref object value); [PreserveSig] Result CountProperties(out int pcProperties); [PreserveSig] Result GetPropertyInfo([In] int iProperty, [In] int cProperties, out PROPBAG2 pPropBag, out int pcProperties); [PreserveSig] Result LoadObject([In][MarshalAs(UnmanagedType.LPWStr)] string pstrName, [In] uint dwHint, [In][MarshalAs(UnmanagedType.IUnknown)] object pUnkObject, IntPtr pErrLog); } private IPropertyBag2 nativePropertyBag; public int Count { get { CheckIfInitialized(); nativePropertyBag.CountProperties(out var pcProperties); return pcProperties; } } public string[] Keys { get { CheckIfInitialized(); List<string> list = new List<string>(); for (int i = 0; i < Count; i++) { nativePropertyBag.GetPropertyInfo(i, 1, out var pPropBag, out var _); list.Add(pPropBag.Name); } return list.ToArray(); } } public PropertyBag(IntPtr propertyBagPointer) : base(propertyBagPointer) { } protected override void NativePointerUpdated(IntPtr oldNativePointer) { base.NativePointerUpdated(oldNativePointer); if (base.NativePointer != IntPtr.Zero) { nativePropertyBag = (IPropertyBag2)Marshal.GetObjectForIUnknown(base.NativePointer); } else { nativePropertyBag = null; } } private void CheckIfInitialized() { if (nativePropertyBag == null) { throw new InvalidOperationException("This instance is not bound to an unmanaged IPropertyBag2"); } } public object Get(string name) { CheckIfInitialized(); PROPBAG2 pROPBAG = default(PROPBAG2); pROPBAG.Name = name; PROPBAG2 pPropBag = pROPBAG; if (nativePropertyBag.Read(1, ref pPropBag, IntPtr.Zero, out var pvarValue, out var phrError).Failure || phrError.Failure) { throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Property with name [{0}] is not valid for this instance", name)); } pPropBag.Dispose(); return pvarValue; } public T1 Get<T1, T2>(PropertyBagKey<T1, T2> propertyKey) { return (T1)Convert.ChangeType(Get(propertyKey.Name), typeof(T1)); } public void Set(string name, object value) { CheckIfInitialized(); object obj = Get(name); value = Convert.ChangeType(value, (obj == null) ? value.GetType() : obj.GetType()); PROPBAG2 pROPBAG = default(PROPBAG2); pROPBAG.Name = name; PROPBAG2 pPropBag = pROPBAG; IPropertyBag2 propertyBag = nativePropertyBag; object value2 = value; propertyBag.Write(1, ref pPropBag, ref value2).CheckError(); pPropBag.Dispose(); } public void Set<T1, T2>(PropertyBagKey<T1, T2> propertyKey, T1 value) { Set(propertyKey.Name, value); } } public class PropertyBagKey<T1, T2> { public string Name { get; private set; } public PropertyBagKey(string name) { Name = name; } } public struct SecurityAttributes { public int Length; public IntPtr Descriptor; private int inheritHandle; public bool InheritHandle { get { return inheritHandle != 0; } set { inheritHandle = (value ? 1 : 0); } } } public struct Variant { [StructLayout(LayoutKind.Explicit)] private struct VariantValue { public struct CurrencyLowHigh { public uint LowValue; public int HighValue; } [StructLayout(LayoutKind.Explicit)] public struct CurrencyValue { [FieldOffset(0)] public CurrencyLowHigh LowHigh; [FieldOffset(0)] public long longValue; } public struct RecordValue
plugins/OverlayDearImGui.Shared/System.Runtime.CompilerServices.Unsafe.dll
Decompiled 11 months agousing System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyInformationalVersion("4.0.0.0")] [assembly: AssemblyTitle("System.Runtime.CompilerServices.Unsafe")] [assembly: AssemblyDescription("System.Runtime.CompilerServices.Unsafe")] [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyProduct("Microsoft® .NET Framework")] [assembly: CLSCompliant(false)] [assembly: AssemblyVersion("4.0.3.0")] namespace System.Runtime.CompilerServices { public static class Unsafe : Object { [MethodImpl(256)] [NonVersionable] public unsafe static T Read<T>(void* source) { return Unsafe.Read<T>(source); } [MethodImpl(256)] [NonVersionable] public unsafe static T ReadUnaligned<T>(void* source) { return Unsafe.ReadUnaligned<T>(source); } [MethodImpl(256)] [NonVersionable] public static T ReadUnaligned<T>(ref byte source) { return Unsafe.ReadUnaligned<T>(ref source); } [MethodImpl(256)] [NonVersionable] public unsafe static void Write<T>(void* destination, T value) { Unsafe.Write(destination, value); } [MethodImpl(256)] [NonVersionable] public unsafe static void WriteUnaligned<T>(void* destination, T value) { Unsafe.WriteUnaligned(destination, value); } [MethodImpl(256)] [NonVersionable] public static void WriteUnaligned<T>(ref byte destination, T value) { Unsafe.WriteUnaligned(ref destination, value); } [MethodImpl(256)] [NonVersionable] public unsafe static void Copy<T>(void* destination, ref T source) { Unsafe.Write(destination, source); } [MethodImpl(256)] [NonVersionable] public unsafe static void Copy<T>(ref T destination, void* source) { destination = Unsafe.Read<T>(source); } [MethodImpl(256)] [NonVersionable] public unsafe static void* AsPointer<T>(ref T value) { return Unsafe.AsPointer(ref value); } [MethodImpl(256)] [NonVersionable] public static int SizeOf<T>() { return Unsafe.SizeOf<T>(); } [MethodImpl(256)] [NonVersionable] public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlock(destination, source, byteCount); } [MethodImpl(256)] [NonVersionable] public static void CopyBlock(ref byte destination, ref byte source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlock(ref destination, ref source, byteCount); } [MethodImpl(256)] [NonVersionable] public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlockUnaligned(destination, source, byteCount); } [MethodImpl(256)] [NonVersionable] public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref destination, ref source, byteCount); } [MethodImpl(256)] [NonVersionable] public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlock(startAddress, value, byteCount); } [MethodImpl(256)] [NonVersionable] public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlock(ref startAddress, value, byteCount); } [MethodImpl(256)] [NonVersionable] public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlockUnaligned(startAddress, value, byteCount); } [MethodImpl(256)] [NonVersionable] public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlockUnaligned(ref startAddress, value, byteCount); } [MethodImpl(256)] [NonVersionable] public static T As<T>(object o) where T : class { return (T)o; } [MethodImpl(256)] [NonVersionable] public unsafe static ref T AsRef<T>(void* source) { return ref *(T*)source; } [MethodImpl(256)] [NonVersionable] public static ref TTo As<TFrom, TTo>(ref TFrom source) { return ref Unsafe.As<TFrom, TTo>(ref source); } [MethodImpl(256)] [NonVersionable] public static ref T Add<T>(ref T source, int elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(256)] [NonVersionable] public static ref T Add<T>(ref T source, System.IntPtr elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(256)] [NonVersionable] public static ref T AddByteOffset<T>(ref T source, System.IntPtr byteOffset) { return ref Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(256)] [NonVersionable] public static ref T Subtract<T>(ref T source, int elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(256)] [NonVersionable] public static ref T Subtract<T>(ref T source, System.IntPtr elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(256)] [NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, System.IntPtr byteOffset) { return ref Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(256)] [NonVersionable] public static System.IntPtr ByteOffset<T>(ref T origin, ref T target) { return Unsafe.ByteOffset(target: ref target, origin: ref origin); } [MethodImpl(256)] [NonVersionable] public static bool AreSame<T>(ref T left, ref T right) { return Unsafe.AreSame(ref left, ref right); } } } namespace System.Runtime.Versioning { [AttributeUsage(/*Could not decode attribute arguments.*/)] internal sealed class NonVersionableAttribute : Attribute { } }
plugins/OverlayDearImGui.Shared/SharpDX.Direct3D11.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using SharpDX.DXGI; using SharpDX.Direct3D; using SharpDX.Direct3D11; using SharpDX.Mathematics.Interop; using SharpDX.Win32; [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/xiaoxiao921/SharpDX")] [assembly: AssemblyTitle("SharpDX.Direct3D11")] [assembly: AssemblyProduct("SharpDX.Direct3D11")] [assembly: AssemblyDescription("Assembly providing DirectX - Direct3D11, Direct3D11.1 and Effects11 managed API.")] [assembly: AssemblyCopyright("Copyright (c) 2010-2016 Alexandre Mutel")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("Alexandre Mutel")] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyInformationalVersion("4.2.1-beta0+7abb72df54")] [assembly: AssemblyFileVersion("4.2.1.34")] [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("SharpDX.Direct3D11.Effects")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.2.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { ModuleInit.Setup(); } } internal sealed class ThisAssembly { internal const string AssemblyVersion = "4.2.0.0"; internal const string AssemblyFileVersion = "4.2.1.34"; internal const string AssemblyInformationalVersion = "4.2.1-beta0+7abb72df54"; internal const string AssemblyName = "SharpDX.Direct3D11"; internal const string AssemblyTitle = "SharpDX.Direct3D11"; internal const string AssemblyConfiguration = "Release"; internal const string GitCommitId = "7abb72df544eaede656c546ee71a8ad1be9dd19b"; internal const string RootNamespace = "SharpDX.Direct3D11"; private ThisAssembly() { } } namespace SharpDX.Direct3D11; [CompilerGenerated] internal class AssemblyDoc { } [Guid("75b68faa-347d-4159-8f45-a0640f01cd9a")] public class BlendState : DeviceChild { public BlendStateDescription Description { get { GetDescription(out var descRef); return descRef; } } public BlendState(Device device, BlendStateDescription description) : base(IntPtr.Zero) { device.CreateBlendState(ref description, this); } public BlendState(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator BlendState(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new BlendState(nativePtr); } return null; } internal unsafe void GetDescription(out BlendStateDescription descRef) { BlendStateDescription.__Native @ref = default(BlendStateDescription.__Native); descRef = default(BlendStateDescription); ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref); descRef.__MarshalFrom(ref @ref); } } [Guid("cc86fabe-da55-401d-85e7-e3c9de2877e9")] public class BlendState1 : BlendState { public BlendStateDescription1 Description1 { get { GetDescription1(out var descRef); return descRef; } } public BlendState1(Device1 device, BlendStateDescription1 description) : base(IntPtr.Zero) { device.CreateBlendState1(ref description, this); } public BlendState1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator BlendState1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new BlendState1(nativePtr); } return null; } internal unsafe void GetDescription1(out BlendStateDescription1 descRef) { BlendStateDescription1.__Native @ref = default(BlendStateDescription1.__Native); descRef = default(BlendStateDescription1); ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref); descRef.__MarshalFrom(ref @ref); } } public struct BlendStateDescription { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct __Native { public RawBool AlphaToCoverageEnable; public RawBool IndependentBlendEnable; public RenderTargetBlendDescription RenderTarget; public RenderTargetBlendDescription __RenderTarget1; public RenderTargetBlendDescription __RenderTarget2; public RenderTargetBlendDescription __RenderTarget3; public RenderTargetBlendDescription __RenderTarget4; public RenderTargetBlendDescription __RenderTarget5; public RenderTargetBlendDescription __RenderTarget6; public RenderTargetBlendDescription __RenderTarget7; } public RawBool AlphaToCoverageEnable; public RawBool IndependentBlendEnable; internal RenderTargetBlendDescription[] _RenderTarget; public RenderTargetBlendDescription[] RenderTarget { get { return _RenderTarget ?? (_RenderTarget = new RenderTargetBlendDescription[8]); } private set { _RenderTarget = value; } } public static BlendStateDescription Default() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription blendStateDescription = default(BlendStateDescription); blendStateDescription.AlphaToCoverageEnable = RawBool.op_Implicit(false); blendStateDescription.IndependentBlendEnable = RawBool.op_Implicit(false); BlendStateDescription result = blendStateDescription; RenderTargetBlendDescription[] renderTarget = result.RenderTarget; for (int i = 0; i < renderTarget.Length; i++) { renderTarget[i].IsBlendEnabled = RawBool.op_Implicit(false); renderTarget[i].SourceBlend = BlendOption.One; renderTarget[i].DestinationBlend = BlendOption.Zero; renderTarget[i].BlendOperation = BlendOperation.Add; renderTarget[i].SourceAlphaBlend = BlendOption.One; renderTarget[i].DestinationAlphaBlend = BlendOption.Zero; renderTarget[i].AlphaBlendOperation = BlendOperation.Add; renderTarget[i].RenderTargetWriteMask = ColorWriteMaskFlags.All; } return result; } public BlendStateDescription Clone() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription blendStateDescription = default(BlendStateDescription); blendStateDescription.AlphaToCoverageEnable = AlphaToCoverageEnable; blendStateDescription.IndependentBlendEnable = IndependentBlendEnable; BlendStateDescription result = blendStateDescription; RenderTargetBlendDescription[] renderTarget = RenderTarget; RenderTargetBlendDescription[] renderTarget2 = result.RenderTarget; for (int i = 0; i < renderTarget.Length; i++) { renderTarget2[i] = renderTarget[i]; } return result; } internal void __MarshalFree(ref __Native @ref) { } internal unsafe void __MarshalFrom(ref __Native @ref) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) AlphaToCoverageEnable = @ref.AlphaToCoverageEnable; IndependentBlendEnable = @ref.IndependentBlendEnable; fixed (RenderTargetBlendDescription* ptr = &RenderTarget[0]) { void* ptr2 = ptr; fixed (RenderTargetBlendDescription* ptr3 = &@ref.RenderTarget) { void* ptr4 = ptr3; Utilities.CopyMemory((IntPtr)ptr2, (IntPtr)ptr4, 8 * Unsafe.SizeOf<RenderTargetBlendDescription>()); } } } internal unsafe void __MarshalTo(ref __Native @ref) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) @ref.AlphaToCoverageEnable = AlphaToCoverageEnable; @ref.IndependentBlendEnable = IndependentBlendEnable; fixed (RenderTargetBlendDescription* ptr = &RenderTarget[0]) { void* ptr2 = ptr; fixed (RenderTargetBlendDescription* ptr3 = &@ref.RenderTarget) { void* ptr4 = ptr3; Utilities.CopyMemory((IntPtr)ptr4, (IntPtr)ptr2, 8 * Unsafe.SizeOf<RenderTargetBlendDescription>()); } } } } public struct BlendStateDescription1 { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct __Native { public RawBool AlphaToCoverageEnable; public RawBool IndependentBlendEnable; public RenderTargetBlendDescription1 RenderTarget; public RenderTargetBlendDescription1 __RenderTarget1; public RenderTargetBlendDescription1 __RenderTarget2; public RenderTargetBlendDescription1 __RenderTarget3; public RenderTargetBlendDescription1 __RenderTarget4; public RenderTargetBlendDescription1 __RenderTarget5; public RenderTargetBlendDescription1 __RenderTarget6; public RenderTargetBlendDescription1 __RenderTarget7; } public RawBool AlphaToCoverageEnable; public RawBool IndependentBlendEnable; internal RenderTargetBlendDescription1[] _RenderTarget; public RenderTargetBlendDescription1[] RenderTarget { get { return _RenderTarget ?? (_RenderTarget = new RenderTargetBlendDescription1[8]); } private set { _RenderTarget = value; } } public static BlendStateDescription1 Default() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription1 blendStateDescription = default(BlendStateDescription1); blendStateDescription.AlphaToCoverageEnable = RawBool.op_Implicit(false); blendStateDescription.IndependentBlendEnable = RawBool.op_Implicit(false); BlendStateDescription1 result = blendStateDescription; RenderTargetBlendDescription1[] renderTarget = result.RenderTarget; for (int i = 0; i < renderTarget.Length; i++) { renderTarget[i].IsBlendEnabled = RawBool.op_Implicit(false); renderTarget[i].IsLogicOperationEnabled = RawBool.op_Implicit(false); renderTarget[i].SourceBlend = BlendOption.One; renderTarget[i].DestinationBlend = BlendOption.Zero; renderTarget[i].BlendOperation = BlendOperation.Add; renderTarget[i].SourceAlphaBlend = BlendOption.One; renderTarget[i].DestinationAlphaBlend = BlendOption.Zero; renderTarget[i].AlphaBlendOperation = BlendOperation.Add; renderTarget[i].RenderTargetWriteMask = ColorWriteMaskFlags.All; renderTarget[i].LogicOperation = LogicOperation.Noop; } return result; } public BlendStateDescription1 Clone() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription1 blendStateDescription = default(BlendStateDescription1); blendStateDescription.AlphaToCoverageEnable = AlphaToCoverageEnable; blendStateDescription.IndependentBlendEnable = IndependentBlendEnable; BlendStateDescription1 result = blendStateDescription; RenderTargetBlendDescription1[] renderTarget = RenderTarget; RenderTargetBlendDescription1[] renderTarget2 = result.RenderTarget; for (int i = 0; i < renderTarget.Length; i++) { renderTarget2[i] = renderTarget[i]; } return result; } internal void __MarshalFree(ref __Native @ref) { } internal unsafe void __MarshalFrom(ref __Native @ref) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) AlphaToCoverageEnable = @ref.AlphaToCoverageEnable; IndependentBlendEnable = @ref.IndependentBlendEnable; fixed (RenderTargetBlendDescription1* ptr = &RenderTarget[0]) { void* ptr2 = ptr; fixed (RenderTargetBlendDescription1* ptr3 = &@ref.RenderTarget) { void* ptr4 = ptr3; Utilities.CopyMemory((IntPtr)ptr2, (IntPtr)ptr4, 8 * Unsafe.SizeOf<RenderTargetBlendDescription1>()); } } } internal unsafe void __MarshalTo(ref __Native @ref) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) @ref.AlphaToCoverageEnable = AlphaToCoverageEnable; @ref.IndependentBlendEnable = IndependentBlendEnable; fixed (RenderTargetBlendDescription1* ptr = &RenderTarget[0]) { void* ptr2 = ptr; fixed (RenderTargetBlendDescription1* ptr3 = &@ref.RenderTarget) { void* ptr4 = ptr3; Utilities.CopyMemory((IntPtr)ptr4, (IntPtr)ptr2, 8 * Unsafe.SizeOf<RenderTargetBlendDescription1>()); } } } } [Guid("48570b85-d1ee-4fcd-a250-eb350722b037")] public class Buffer : Resource { public BufferDescription Description { get { GetDescription(out var descRef); return descRef; } } public Buffer(Device device, BufferDescription description) : base(IntPtr.Zero) { device.CreateBuffer(ref description, null, this); } public Buffer(Device device, DataStream data, BufferDescription description) : base(IntPtr.Zero) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) device.CreateBuffer(ref description, (DataBox?)new DataBox(data.PositionPointer, 0, 0), this); } public Buffer(Device device, IntPtr dataPointer, BufferDescription description) : base(IntPtr.Zero) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) device.CreateBuffer(ref description, (dataPointer != IntPtr.Zero) ? new DataBox?(new DataBox(dataPointer, 0, 0)) : null, this); } public Buffer(Device device, int sizeInBytes, ResourceUsage usage, BindFlags bindFlags, CpuAccessFlags accessFlags, ResourceOptionFlags optionFlags, int structureByteStride) : base(IntPtr.Zero) { BufferDescription descRef = new BufferDescription { BindFlags = bindFlags, CpuAccessFlags = accessFlags, OptionFlags = optionFlags, SizeInBytes = sizeInBytes, Usage = usage, StructureByteStride = structureByteStride }; device.CreateBuffer(ref descRef, null, this); } public Buffer(Device device, DataStream data, int sizeInBytes, ResourceUsage usage, BindFlags bindFlags, CpuAccessFlags accessFlags, ResourceOptionFlags optionFlags, int structureByteStride) : base(IntPtr.Zero) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) BufferDescription descRef = new BufferDescription { BindFlags = bindFlags, CpuAccessFlags = accessFlags, OptionFlags = optionFlags, SizeInBytes = sizeInBytes, Usage = usage, StructureByteStride = structureByteStride }; device.CreateBuffer(ref descRef, (DataBox?)new DataBox(data.PositionPointer, 0, 0), this); } public unsafe static Buffer Create<T>(Device device, BindFlags bindFlags, ref T data, int sizeInBytes = 0, ResourceUsage usage = ResourceUsage.Default, CpuAccessFlags accessFlags = CpuAccessFlags.None, ResourceOptionFlags optionFlags = ResourceOptionFlags.None, int structureByteStride = 0) where T : struct { //IL_005e: Unknown result type (might be due to invalid IL or missing references) Buffer buffer = new Buffer(IntPtr.Zero); BufferDescription bufferDescription = default(BufferDescription); bufferDescription.BindFlags = bindFlags; bufferDescription.CpuAccessFlags = accessFlags; bufferDescription.OptionFlags = optionFlags; bufferDescription.SizeInBytes = ((sizeInBytes == 0) ? Utilities.SizeOf<T>() : sizeInBytes); bufferDescription.Usage = usage; bufferDescription.StructureByteStride = structureByteStride; BufferDescription descRef = bufferDescription; fixed (T* ptr = &data) { device.CreateBuffer(ref descRef, (DataBox?)new DataBox((IntPtr)ptr), buffer); return buffer; } } public unsafe static Buffer Create<T>(Device device, BindFlags bindFlags, T[] data, int sizeInBytes = 0, ResourceUsage usage = ResourceUsage.Default, CpuAccessFlags accessFlags = CpuAccessFlags.None, ResourceOptionFlags optionFlags = ResourceOptionFlags.None, int structureByteStride = 0) where T : struct { //IL_0068: Unknown result type (might be due to invalid IL or missing references) Buffer buffer = new Buffer(IntPtr.Zero); BufferDescription bufferDescription = default(BufferDescription); bufferDescription.BindFlags = bindFlags; bufferDescription.CpuAccessFlags = accessFlags; bufferDescription.OptionFlags = optionFlags; bufferDescription.SizeInBytes = ((sizeInBytes == 0) ? (Utilities.SizeOf<T>() * data.Length) : sizeInBytes); bufferDescription.Usage = usage; bufferDescription.StructureByteStride = structureByteStride; BufferDescription descRef = bufferDescription; fixed (T* ptr = &data[0]) { device.CreateBuffer(ref descRef, (DataBox?)new DataBox((IntPtr)ptr), buffer); return buffer; } } public unsafe static Buffer Create<T>(Device device, ref T data, BufferDescription description) where T : struct { //IL_002a: Unknown result type (might be due to invalid IL or missing references) Buffer buffer = new Buffer(IntPtr.Zero); if (description.SizeInBytes == 0) { description.SizeInBytes = Utilities.SizeOf<T>(); } fixed (T* ptr = &data) { device.CreateBuffer(ref description, (DataBox?)new DataBox((IntPtr)ptr), buffer); return buffer; } } public unsafe static Buffer Create<T>(Device device, T[] data, BufferDescription description) where T : struct { //IL_0034: Unknown result type (might be due to invalid IL or missing references) Buffer buffer = new Buffer(IntPtr.Zero); if (description.SizeInBytes == 0) { description.SizeInBytes = Utilities.SizeOf<T>() * data.Length; } fixed (T* ptr = &data[0]) { device.CreateBuffer(ref description, (DataBox?)new DataBox((IntPtr)ptr), buffer); return buffer; } } public Buffer(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Buffer(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Buffer(nativePtr); } return null; } internal unsafe void GetDescription(out BufferDescription descRef) { descRef = default(BufferDescription); fixed (BufferDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct BufferDescription { public int SizeInBytes; public ResourceUsage Usage; public BindFlags BindFlags; public CpuAccessFlags CpuAccessFlags; public ResourceOptionFlags OptionFlags; public int StructureByteStride; public BufferDescription(int sizeInBytes, ResourceUsage usage, BindFlags bindFlags, CpuAccessFlags cpuAccessFlags, ResourceOptionFlags optionFlags, int structureByteStride) { SizeInBytes = sizeInBytes; Usage = usage; BindFlags = bindFlags; CpuAccessFlags = cpuAccessFlags; OptionFlags = optionFlags; StructureByteStride = structureByteStride; } public BufferDescription(int sizeInBytes, BindFlags bindFlags, ResourceUsage usage) { this = default(BufferDescription); SizeInBytes = sizeInBytes; BindFlags = bindFlags; Usage = usage; } } [Guid("a6cd7faa-b0b7-4a2f-9436-8662a65797cb")] public class ClassInstance : DeviceChild { public unsafe string InstanceName { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) PointerSize bufferLengthRef = default(PointerSize); GetInstanceName(IntPtr.Zero, ref bufferLengthRef); sbyte* ptr = stackalloc sbyte[(int)(uint)PointerSize.op_Implicit(bufferLengthRef)]; GetInstanceName((IntPtr)ptr, ref bufferLengthRef); return Marshal.PtrToStringAnsi((IntPtr)ptr); } } public unsafe string TypeName { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) PointerSize bufferLengthRef = default(PointerSize); GetInstanceName(IntPtr.Zero, ref bufferLengthRef); sbyte* ptr = stackalloc sbyte[(int)(uint)PointerSize.op_Implicit(bufferLengthRef)]; GetTypeName((IntPtr)ptr, ref bufferLengthRef); return Marshal.PtrToStringAnsi((IntPtr)ptr); } } public ClassLinkage ClassLinkage { get { GetClassLinkage(out var linkageOut); return linkageOut; } } public ClassInstanceDescription Description { get { GetDescription(out var descRef); return descRef; } } public ClassInstance(ClassLinkage linkage, string classTypeName, int constantBufferOffset, int constantVectorOffset, int textureOffset, int samplerOffset) : base(IntPtr.Zero) { linkage.CreateClassInstance(classTypeName, constantBufferOffset, constantVectorOffset, textureOffset, samplerOffset, this); } public ClassInstance(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator ClassInstance(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new ClassInstance(nativePtr); } return null; } internal unsafe void GetClassLinkage(out ClassLinkage linkageOut) { IntPtr zero = IntPtr.Zero; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero); if (zero != IntPtr.Zero) { linkageOut = new ClassLinkage(zero); } else { linkageOut = null; } } internal unsafe void GetDescription(out ClassInstanceDescription descRef) { descRef = default(ClassInstanceDescription); fixed (ClassInstanceDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } internal unsafe void GetInstanceName(IntPtr instanceNameRef, ref PointerSize bufferLengthRef) { fixed (PointerSize* ptr = &bufferLengthRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)instanceNameRef, ptr2); } } internal unsafe void GetTypeName(IntPtr typeNameRef, ref PointerSize bufferLengthRef) { fixed (PointerSize* ptr = &bufferLengthRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)typeNameRef, ptr2); } } } [Guid("ddf57cba-9543-46e4-a12b-f207a0fe7fed")] public class ClassLinkage : DeviceChild { public ClassLinkage(Device device) : base(IntPtr.Zero) { device.CreateClassLinkage(this); } public ClassLinkage(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator ClassLinkage(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new ClassLinkage(nativePtr); } return null; } public unsafe ClassInstance GetClassInstance(string classInstanceNameRef, int instanceIndex) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr intPtr = Marshal.StringToHGlobalAnsi(classInstanceNameRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)intPtr, instanceIndex, &zero)); ClassInstance result = ((!(zero != IntPtr.Zero)) ? null : new ClassInstance(zero)); Marshal.FreeHGlobal(intPtr); ((Result)(ref val)).CheckError(); return result; } internal unsafe void CreateClassInstance(string classTypeNameRef, int constantBufferOffset, int constantVectorOffset, int textureOffset, int samplerOffset, ClassInstance instanceOut) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr intPtr = Marshal.StringToHGlobalAnsi(classTypeNameRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, int, int, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)intPtr, constantBufferOffset, constantVectorOffset, textureOffset, samplerOffset, &zero)); ((CppObject)instanceOut).NativePointer = zero; Marshal.FreeHGlobal(intPtr); ((Result)(ref val)).CheckError(); } } [Guid("4f5b196e-c2bd-495e-bd01-1fded38e4969")] public class ComputeShader : DeviceChild { public unsafe ComputeShader(Device device, byte[] shaderBytecode, ClassLinkage linkage = null) : base(IntPtr.Zero) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (shaderBytecode == null) { throw new ArgumentNullException("shaderBytecode", "ShaderBytecode cannot be null"); } fixed (byte* ptr = shaderBytecode) { void* ptr2 = ptr; device.CreateComputeShader((IntPtr)ptr2, PointerSize.op_Implicit(shaderBytecode.Length), linkage, this); } } public ComputeShader(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator ComputeShader(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new ComputeShader(nativePtr); } return null; } } [Guid("6e8c49fb-a371-4770-b440-29086022b741")] public class Counter : Asynchronous { public CounterDescription Description { get { GetDescription(out var descRef); return descRef; } } public Counter(Device device, CounterDescription description) : base(IntPtr.Zero) { device.CreateCounter(description, this); } public Counter(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Counter(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Counter(nativePtr); } return null; } internal unsafe void GetDescription(out CounterDescription descRef) { descRef = default(CounterDescription); fixed (CounterDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } } public class CounterMetadata { public CounterType Type { get; internal set; } public int HardwareCounterCount { get; internal set; } public string Name { get; internal set; } public string Units { get; internal set; } public string Description { get; internal set; } } [Guid("03823efb-8d8f-4e1c-9aa2-f64bb2cbfdf1")] public class DepthStencilState : DeviceChild { public DepthStencilStateDescription Description { get { GetDescription(out var descRef); return descRef; } } public DepthStencilState(Device device, DepthStencilStateDescription description) : base(IntPtr.Zero) { device.CreateDepthStencilState(ref description, this); } public DepthStencilState(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DepthStencilState(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DepthStencilState(nativePtr); } return null; } internal unsafe void GetDescription(out DepthStencilStateDescription descRef) { descRef = default(DepthStencilStateDescription); fixed (DepthStencilStateDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct DepthStencilStateDescription { public RawBool IsDepthEnabled; public DepthWriteMask DepthWriteMask; public Comparison DepthComparison; public RawBool IsStencilEnabled; public byte StencilReadMask; public byte StencilWriteMask; public DepthStencilOperationDescription FrontFace; public DepthStencilOperationDescription BackFace; public static DepthStencilStateDescription Default() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) DepthStencilStateDescription result = default(DepthStencilStateDescription); result.IsDepthEnabled = RawBool.op_Implicit(true); result.DepthWriteMask = DepthWriteMask.All; result.DepthComparison = Comparison.Less; result.IsStencilEnabled = RawBool.op_Implicit(false); result.StencilReadMask = byte.MaxValue; result.StencilWriteMask = byte.MaxValue; result.FrontFace.Comparison = Comparison.Always; result.FrontFace.DepthFailOperation = StencilOperation.Keep; result.FrontFace.FailOperation = StencilOperation.Keep; result.FrontFace.PassOperation = StencilOperation.Keep; result.BackFace.Comparison = Comparison.Always; result.BackFace.DepthFailOperation = StencilOperation.Keep; result.BackFace.FailOperation = StencilOperation.Keep; result.BackFace.PassOperation = StencilOperation.Keep; return result; } } [Guid("9fdac92a-1876-48c3-afad-25b94f84a9b6")] public class DepthStencilView : ResourceView { public DepthStencilViewDescription Description { get { GetDescription(out var descRef); return descRef; } } public DepthStencilView(Device device, Resource resource) : base(IntPtr.Zero) { device.CreateDepthStencilView(resource, null, this); } public DepthStencilView(Device device, Resource resource, DepthStencilViewDescription description) : base(IntPtr.Zero) { device.CreateDepthStencilView(resource, description, this); } public DepthStencilView(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DepthStencilView(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DepthStencilView(nativePtr); } return null; } internal unsafe void GetDescription(out DepthStencilViewDescription descRef) { descRef = default(DepthStencilViewDescription); fixed (DepthStencilViewDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } } [Guid("db6f6ddb-ac77-4e88-8253-819df9bbf140")] public class Device : ComObject { public const int MultisampleCountMaximum = 32; protected internal DeviceContext ImmediateContext__; public unsafe string DebugName { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) byte* ptr = stackalloc byte[1024]; int dataSizeRef = 1023; Result privateData = GetPrivateData(CommonGuid.DebugObjectName, ref dataSizeRef, new IntPtr(ptr)); if (((Result)(ref privateData)).Failure) { return string.Empty; } ptr[dataSizeRef] = 0; return Marshal.PtrToStringAnsi(new IntPtr(ptr)); } set { if (string.IsNullOrEmpty(value)) { SetPrivateData(CommonGuid.DebugObjectName, 0, IntPtr.Zero); return; } IntPtr dataRef = Utilities.StringToHGlobalAnsi(value); SetPrivateData(CommonGuid.DebugObjectName, value.Length, dataRef); } } public FeatureLevel FeatureLevel => GetFeatureLevel(); public DeviceCreationFlags CreationFlags => GetCreationFlags(); public Result DeviceRemovedReason => GetDeviceRemovedReason(); public DeviceContext ImmediateContext { get { if (ImmediateContext__ == null) { GetImmediateContext(out ImmediateContext__); } return ImmediateContext__; } } public int ExceptionMode { get { return GetExceptionMode(); } set { SetExceptionMode(value); } } public Device(DriverType driverType) : this(driverType, DeviceCreationFlags.None) { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) public Device(Adapter adapter) : this(adapter, DeviceCreationFlags.None) { } public Device(DriverType driverType, DeviceCreationFlags flags) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) CreateDevice(null, driverType, flags, null); } public Device(Adapter adapter, DeviceCreationFlags flags) { CreateDevice(adapter, (DriverType)0, flags, null); } public Device(DriverType driverType, DeviceCreationFlags flags, params FeatureLevel[] featureLevels) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) CreateDevice(null, driverType, flags, featureLevels); } public Device(Adapter adapter, DeviceCreationFlags flags, params FeatureLevel[] featureLevels) { CreateDevice(adapter, (DriverType)0, flags, featureLevels); } public static void CreateWithSwapChain(DriverType driverType, DeviceCreationFlags flags, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) CreateWithSwapChain(null, driverType, flags, null, swapChainDescription, out device, out swapChain); } public static void CreateWithSwapChain(Adapter adapter, DeviceCreationFlags flags, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) CreateWithSwapChain(adapter, (DriverType)0, flags, null, swapChainDescription, out device, out swapChain); } public static void CreateWithSwapChain(DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) CreateWithSwapChain(null, driverType, flags, featureLevels, swapChainDescription, out device, out swapChain); } public static void CreateWithSwapChain(Adapter adapter, DeviceCreationFlags flags, FeatureLevel[] featureLevels, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) CreateWithSwapChain(adapter, (DriverType)0, flags, featureLevels, swapChainDescription, out device, out swapChain); } private static void CreateWithSwapChain(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown device = ((adapter == null) ? new Device(driverType, flags, featureLevels) : new Device(adapter, flags, featureLevels)); Factory1 val = new Factory1(); try { swapChain = new SwapChain((Factory)(object)val, (ComObject)(object)device, swapChainDescription); } finally { ((IDisposable)val)?.Dispose(); } } public unsafe CounterMetadata GetCounterMetadata(CounterDescription counterDescription) { CounterMetadata counterMetadata = new CounterMetadata(); int num = 0; int num2 = 0; int num3 = 0; CheckCounter(counterDescription, out var typeRef, out var activeCountersRef, IntPtr.Zero, new IntPtr(&num), IntPtr.Zero, new IntPtr(&num2), IntPtr.Zero, new IntPtr(&num3)); sbyte* ptr = stackalloc sbyte[(int)(uint)num]; sbyte* ptr2 = stackalloc sbyte[(int)(uint)num2]; sbyte* ptr3 = stackalloc sbyte[(int)(uint)num3]; CheckCounter(counterDescription, out typeRef, out activeCountersRef, new IntPtr(ptr), new IntPtr(&num), new IntPtr(ptr2), new IntPtr(&num2), new IntPtr(ptr3), new IntPtr(&num3)); counterMetadata.Type = typeRef; counterMetadata.HardwareCounterCount = activeCountersRef; counterMetadata.Name = Marshal.PtrToStringAnsi((IntPtr)ptr, num); counterMetadata.Units = Marshal.PtrToStringAnsi((IntPtr)ptr2, num2); counterMetadata.Description = Marshal.PtrToStringAnsi((IntPtr)ptr3, num3); return counterMetadata; } public T OpenSharedResource<T>(IntPtr resourceHandle) where T : ComObject { OpenSharedResource(resourceHandle, Utilities.GetGuidFromType(typeof(T)), out var resourceOut); return CppObject.FromPointer<T>(resourceOut); } public unsafe ComputeShaderFormatSupport CheckComputeShaderFormatSupport(Format format) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) FeatureDataFormatSupport2 featureDataFormatSupport = default(FeatureDataFormatSupport2); featureDataFormatSupport.InFormat = format; Result val = CheckFeatureSupport(Feature.ComputeShaders, new IntPtr(&featureDataFormatSupport), Utilities.SizeOf<FeatureDataFormatSupport2>()); if (((Result)(ref val)).Failure) { return ComputeShaderFormatSupport.None; } return featureDataFormatSupport.OutFormatSupport2; } public unsafe FeatureDataD3D11Options CheckD3D11Feature() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options result = default(FeatureDataD3D11Options); Result val = CheckFeatureSupport(Feature.D3D11Options, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options); } return result; } public unsafe FeatureDataShaderMinimumPrecisionSupport CheckShaderMinimumPrecisionSupport() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) FeatureDataShaderMinimumPrecisionSupport result = default(FeatureDataShaderMinimumPrecisionSupport); Result val = CheckFeatureSupport(Feature.ShaderMinimumPrecisionSupport, new IntPtr(&result), Utilities.SizeOf<FeatureDataShaderMinimumPrecisionSupport>()); if (((Result)(ref val)).Failure) { return default(FeatureDataShaderMinimumPrecisionSupport); } return result; } public unsafe bool CheckFullNonPow2TextureSupport() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D9Options featureDataD3D9Options = default(FeatureDataD3D9Options); Result val = CheckFeatureSupport(Feature.D3D9Options, new IntPtr(&featureDataD3D9Options), Utilities.SizeOf<FeatureDataD3D9Options>()); if ((int)FeatureLevel <= 37632) { return ((Result)(ref val)).Failure; } if (((Result)(ref val)).Failure) { return false; } return RawBool.op_Implicit(featureDataD3D9Options.FullNonPow2TextureSupport); } public unsafe bool CheckTileBasedDeferredRendererSupport() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) FeatureDataArchitectureInformation featureDataArchitectureInformation = default(FeatureDataArchitectureInformation); Result val = CheckFeatureSupport(Feature.ArchitectureInformation, new IntPtr(&featureDataArchitectureInformation), Utilities.SizeOf<FeatureDataArchitectureInformation>()); if (((Result)(ref val)).Failure) { return false; } return RawBool.op_Implicit(featureDataArchitectureInformation.TileBasedDeferredRenderer); } public unsafe FeatureDataD3D11Options1 CheckD3D112Feature() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options1 result = default(FeatureDataD3D11Options1); Result val = CheckFeatureSupport(Feature.D3D11Options1, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options1>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options1); } return result; } public unsafe FeatureDataD3D11Options2 CheckD3D113Features2() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options2 result = default(FeatureDataD3D11Options2); Result val = CheckFeatureSupport(Feature.D3D11Options2, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options2>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options2); } return result; } public unsafe FeatureDataD3D11Options3 CheckD3D113Features3() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options3 result = default(FeatureDataD3D11Options3); Result val = CheckFeatureSupport(Feature.D3D11Options3, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options3>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options3); } return result; } public unsafe FeatureDataD3D11Options4 CheckD3D113Features4() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options4 result = default(FeatureDataD3D11Options4); Result val = CheckFeatureSupport(Feature.D3D11Options4, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options4>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options4); } return result; } public unsafe FeatureDataD3D11Options5 CheckD3D113Feature5() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) FeatureDataD3D11Options5 result = default(FeatureDataD3D11Options5); Result val = CheckFeatureSupport(Feature.D3D11Options5, new IntPtr(&result), Utilities.SizeOf<FeatureDataD3D11Options5>()); if (((Result)(ref val)).Failure) { return default(FeatureDataD3D11Options5); } return result; } public unsafe bool CheckFeatureSupport(Feature feature) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) Result val; switch (feature) { case Feature.ShaderDoubles: { FeatureDataDoubles featureDataDoubles = default(FeatureDataDoubles); val = CheckFeatureSupport(Feature.ShaderDoubles, new IntPtr(&featureDataDoubles), Utilities.SizeOf<FeatureDataDoubles>()); if (((Result)(ref val)).Failure) { return false; } return RawBool.op_Implicit(featureDataDoubles.DoublePrecisionFloatShaderOps); } case Feature.ComputeShaders: case Feature.D3D10XHardwareOptions: { FeatureDataD3D10XHardwareOptions featureDataD3D10XHardwareOptions = default(FeatureDataD3D10XHardwareOptions); val = CheckFeatureSupport(Feature.D3D10XHardwareOptions, new IntPtr(&featureDataD3D10XHardwareOptions), Utilities.SizeOf<FeatureDataD3D10XHardwareOptions>()); if (((Result)(ref val)).Failure) { return false; } return RawBool.op_Implicit(featureDataD3D10XHardwareOptions.ComputeShadersPlusRawAndStructuredBuffersViaShader4X); } default: throw new SharpDXException("Unsupported Feature. Use specialized CheckXXX methods", Array.Empty<object>()); } } public unsafe Result CheckThreadingSupport(out bool supportsConcurrentResources, out bool supportsCommandLists) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) FeatureDataThreading featureDataThreading = default(FeatureDataThreading); Result result = CheckFeatureSupport(Feature.Threading, new IntPtr(&featureDataThreading), Utilities.SizeOf<FeatureDataThreading>()); if (((Result)(ref result)).Failure) { supportsConcurrentResources = false; supportsCommandLists = false; } else { supportsConcurrentResources = RawBool.op_Implicit(featureDataThreading.DriverConcurrentCreates); supportsCommandLists = RawBool.op_Implicit(featureDataThreading.DriverCommandLists); } return result; } public static bool IsSupportedFeatureLevel(FeatureLevel featureLevel) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Device device = new Device(IntPtr.Zero); DeviceContext immediateContextOut = null; try { FeatureLevel featureLevelRef; Result val = D3D11.CreateDevice(null, (DriverType)1, IntPtr.Zero, DeviceCreationFlags.None, (FeatureLevel[])(object)new FeatureLevel[1] { (FeatureLevel)(int)featureLevel }, 1, 7, device, out featureLevelRef, out immediateContextOut); return ((Result)(ref val)).Success && featureLevelRef == featureLevel; } finally { if (immediateContextOut != null) { ((DisposeBase)immediateContextOut).Dispose(); } if (((CppObject)device).NativePointer != IntPtr.Zero) { ((DisposeBase)device).Dispose(); } } } public static bool IsSupportedFeatureLevel(Adapter adapter, FeatureLevel featureLevel) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Device device = new Device(IntPtr.Zero); DeviceContext immediateContextOut = null; try { FeatureLevel featureLevelRef; Result val = D3D11.CreateDevice(adapter, (DriverType)0, IntPtr.Zero, DeviceCreationFlags.None, (FeatureLevel[])(object)new FeatureLevel[1] { (FeatureLevel)(int)featureLevel }, 1, 7, device, out featureLevelRef, out immediateContextOut); return ((Result)(ref val)).Success && featureLevelRef == featureLevel; } finally { if (immediateContextOut != null) { ((DisposeBase)immediateContextOut).Dispose(); } if (((CppObject)device).NativePointer != IntPtr.Zero) { ((DisposeBase)device).Dispose(); } } } public static FeatureLevel GetSupportedFeatureLevel() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Device device = new Device(IntPtr.Zero); FeatureLevel featureLevelRef; DeviceContext immediateContextOut; Result val = D3D11.CreateDevice(null, (DriverType)1, IntPtr.Zero, DeviceCreationFlags.None, null, 0, 7, device, out featureLevelRef, out immediateContextOut); ((Result)(ref val)).CheckError(); ((DisposeBase)immediateContextOut).Dispose(); ((DisposeBase)device).Dispose(); return featureLevelRef; } public static FeatureLevel GetSupportedFeatureLevel(Adapter adapter) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Device device = new Device(IntPtr.Zero); FeatureLevel featureLevelRef; DeviceContext immediateContextOut; Result val = D3D11.CreateDevice(adapter, (DriverType)0, IntPtr.Zero, DeviceCreationFlags.None, null, 0, 7, device, out featureLevelRef, out immediateContextOut); ((Result)(ref val)).CheckError(); ((DisposeBase)immediateContextOut).Dispose(); ((DisposeBase)device).Dispose(); return featureLevelRef; } protected override void Dispose(bool disposing) { if (disposing && ImmediateContext__ != null) { ((DisposeBase)ImmediateContext__).Dispose(); ImmediateContext__ = null; } ((ComObject)this).Dispose(disposing); } private void CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) FeatureLevel featureLevelRef; Result val = D3D11.CreateDevice(adapter, driverType, IntPtr.Zero, flags, featureLevels, (featureLevels != null) ? featureLevels.Length : 0, 7, this, out featureLevelRef, out ImmediateContext__); ((Result)(ref val)).CheckError(); if (ImmediateContext__ != null) { ((IUnknown)this).AddReference(); ImmediateContext__.Device__ = this; } } public static Device CreateFromDirect3D12(ComObject d3D12Device, DeviceCreationFlags flags, FeatureLevel[] featureLevels, Adapter adapter, params ComObject[] commandQueues) { if (d3D12Device == null) { throw new ArgumentNullException("d3D12Device"); } D3D11.On12CreateDevice((IUnknown)(object)d3D12Device, flags, featureLevels, (featureLevels != null) ? featureLevels.Length : 0, (IUnknown[])(object)commandQueues, commandQueues.Length, 0, out var deviceOut, out var immediateContextOut, out var _); ((DisposeBase)immediateContextOut).Dispose(); return deviceOut; } public Device(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Device(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Device(nativePtr); } return null; } internal unsafe void CreateBuffer(ref BufferDescription descRef, DataBox? initialDataRef, Buffer bufferOut) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; DataBox value = default(DataBox); if (initialDataRef.HasValue) { value = initialDataRef.Value; } Result val; fixed (BufferDescription* ptr = &descRef) { void* ptr2 = ptr; void* nativePointer = ((CppObject)this)._nativePointer; DataBox* intPtr = ((!initialDataRef.HasValue) ? null : (&value)); val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)3 * (nint)sizeof(void*))))(nativePointer, ptr2, intPtr, &zero)); } ((CppObject)bufferOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateTexture1D(ref Texture1DDescription descRef, DataBox[] initialDataRef, Texture1D texture1DOut) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DataBox* ptr = initialDataRef) { void* ptr2 = ptr; fixed (Texture1DDescription* ptr3 = &descRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)4 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, &zero)); } } ((CppObject)texture1DOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateTexture2D(ref Texture2DDescription descRef, DataBox[] initialDataRef, Texture2D texture2DOut) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DataBox* ptr = initialDataRef) { void* ptr2 = ptr; fixed (Texture2DDescription* ptr3 = &descRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)5 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, &zero)); } } ((CppObject)texture2DOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateTexture3D(ref Texture3DDescription descRef, DataBox[] initialDataRef, Texture3D texture3DOut) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DataBox* ptr = initialDataRef) { void* ptr2 = ptr; fixed (Texture3DDescription* ptr3 = &descRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)6 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, &zero)); } } ((CppObject)texture3DOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateShaderResourceView(Resource resourceRef, ShaderResourceViewDescription? descRef, ShaderResourceView sRViewOut) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); ShaderResourceViewDescription value = default(ShaderResourceViewDescription); if (descRef.HasValue) { value = descRef.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; ShaderResourceViewDescription* intPtr2 = ((!descRef.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)sRViewOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateUnorderedAccessView(Resource resourceRef, UnorderedAccessViewDescription? descRef, UnorderedAccessView uAViewOut) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); UnorderedAccessViewDescription value = default(UnorderedAccessViewDescription); if (descRef.HasValue) { value = descRef.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; UnorderedAccessViewDescription* intPtr2 = ((!descRef.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)uAViewOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateRenderTargetView(Resource resourceRef, RenderTargetViewDescription? descRef, RenderTargetView rTViewOut) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); RenderTargetViewDescription value = default(RenderTargetViewDescription); if (descRef.HasValue) { value = descRef.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; RenderTargetViewDescription* intPtr2 = ((!descRef.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)rTViewOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateDepthStencilView(Resource resourceRef, DepthStencilViewDescription? descRef, DepthStencilView depthStencilViewOut) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); DepthStencilViewDescription value = default(DepthStencilViewDescription); if (descRef.HasValue) { value = descRef.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; DepthStencilViewDescription* intPtr2 = ((!descRef.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)depthStencilViewOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateInputLayout(InputElement[] inputElementDescsRef, int numElements, IntPtr shaderBytecodeWithInputSignatureRef, PointerSize bytecodeLength, InputLayout inputLayoutOut) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) InputElement.__Native[] array = new InputElement.__Native[inputElementDescsRef.Length]; IntPtr zero = IntPtr.Zero; for (int i = 0; i < inputElementDescsRef.Length; i++) { inputElementDescsRef[i].__MarshalTo(ref array[i]); } Result val; fixed (InputElement.__Native* ptr = array) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, numElements, (void*)shaderBytecodeWithInputSignatureRef, PointerSize.op_Implicit(bytecodeLength), &zero)); } ((CppObject)inputLayoutOut).NativePointer = zero; for (int j = 0; j < inputElementDescsRef.Length; j++) { inputElementDescsRef[j].__MarshalFree(ref array[j]); } ((Result)(ref val)).CheckError(); } internal unsafe void CreateVertexShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, VertexShader vertexShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)vertexShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateGeometryShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, GeometryShader geometryShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)geometryShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateGeometryShaderWithStreamOutput(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, StreamOutputElement[] sODeclarationRef, int numEntries, int[] bufferStridesRef, int numStrides, int rasterizedStream, ClassLinkage classLinkageRef, GeometryShader geometryShaderOut) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) StreamOutputElement.__Native[] array = ((sODeclarationRef == null) ? null : new StreamOutputElement.__Native[sODeclarationRef.Length]); IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; if (sODeclarationRef != null) { for (int i = 0; i < sODeclarationRef.Length; i++) { sODeclarationRef?[i].__MarshalTo(ref array[i]); } } zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val; fixed (int* ptr = bufferStridesRef) { void* ptr2 = ptr; fixed (StreamOutputElement.__Native* ptr3 = array) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int, void*, int, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)14 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), ptr4, numEntries, ptr2, numStrides, rasterizedStream, (void*)zero, &zero2)); } } ((CppObject)geometryShaderOut).NativePointer = zero2; if (sODeclarationRef != null) { for (int j = 0; j < sODeclarationRef.Length; j++) { sODeclarationRef?[j].__MarshalFree(ref array[j]); } } ((Result)(ref val)).CheckError(); } internal unsafe void CreatePixelShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, PixelShader pixelShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)15 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)pixelShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateHullShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, HullShader hullShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)16 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)hullShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateDomainShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, DomainShader domainShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)17 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)domainShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateComputeShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, ComputeShader computeShaderOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<ClassLinkage>((ICallbackable)(object)classLinkageRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)18 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)shaderBytecodeRef, PointerSize.op_Implicit(bytecodeLength), (void*)zero, &zero2)); ((CppObject)computeShaderOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateClassLinkage(ClassLinkage linkageOut) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)19 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero)); ((CppObject)linkageOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateBlendState(ref BlendStateDescription blendStateDescRef, BlendState blendStateOut) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription.__Native @ref = default(BlendStateDescription.__Native); IntPtr zero = IntPtr.Zero; blendStateDescRef.__MarshalTo(ref @ref); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)20 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref, &zero)); ((CppObject)blendStateOut).NativePointer = zero; blendStateDescRef.__MarshalFree(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe void CreateDepthStencilState(ref DepthStencilStateDescription depthStencilDescRef, DepthStencilState depthStencilStateOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DepthStencilStateDescription* ptr = &depthStencilDescRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)21 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, &zero)); } ((CppObject)depthStencilStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateRasterizerState(ref RasterizerStateDescription rasterizerDescRef, RasterizerState rasterizerStateOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (RasterizerStateDescription* ptr = &rasterizerDescRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)22 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, &zero)); } ((CppObject)rasterizerStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateSamplerState(ref SamplerStateDescription samplerDescRef, SamplerState samplerStateOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (SamplerStateDescription* ptr = &samplerDescRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)23 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, &zero)); } ((CppObject)samplerStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateQuery(QueryDescription queryDescRef, Query queryOut) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)24 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &queryDescRef, &zero)); ((CppObject)queryOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreatePredicate(QueryDescription predicateDescRef, Predicate predicateOut) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)25 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &predicateDescRef, &zero)); ((CppObject)predicateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateCounter(CounterDescription counterDescRef, Counter counterOut) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)26 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &counterDescRef, &zero)); ((CppObject)counterOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateDeferredContext(int contextFlags, DeviceContext deferredContextOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)27 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, contextFlags, &zero)); ((CppObject)deferredContextOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void OpenSharedResource(IntPtr hResource, Guid returnedInterface, out IntPtr resourceOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &resourceOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)28 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)hResource, &returnedInterface, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe FormatSupport CheckFormatSupport(Format format) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) FormatSupport result = default(FormatSupport); Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)29 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)format, &result)); return result; } public unsafe int CheckMultisampleQualityLevels(Format format, int sampleCount) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected I4, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) int result = default(int); Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)30 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)format, sampleCount, &result)); return result; } public unsafe CounterCapabilities GetCounterCapabilities() { CounterCapabilities result = default(CounterCapabilities); ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)31 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &result); return result; } internal unsafe void CheckCounter(CounterDescription descRef, out CounterType typeRef, out int activeCountersRef, IntPtr szName, IntPtr nameLengthRef, IntPtr szUnits, IntPtr unitsLengthRef, IntPtr szDescription, IntPtr descriptionLengthRef) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &activeCountersRef) { void* ptr2 = ptr; fixed (CounterType* ptr3 = &typeRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)32 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &descRef, ptr4, ptr2, (void*)szName, (void*)nameLengthRef, (void*)szUnits, (void*)unitsLengthRef, (void*)szDescription, (void*)descriptionLengthRef)); } } ((Result)(ref val)).CheckError(); } internal unsafe Result CheckFeatureSupport(Feature feature, IntPtr featureSupportDataRef, int featureSupportDataSize) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) return Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)33 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)feature, (void*)featureSupportDataRef, featureSupportDataSize)); } public unsafe Result GetPrivateData(Guid guid, ref int dataSizeRef, IntPtr dataRef) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Result result; fixed (int* ptr = &dataSizeRef) { void* ptr2 = ptr; result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)34 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &guid, ptr2, (void*)dataRef)); } return result; } public unsafe void SetPrivateData(Guid guid, int dataSize, IntPtr dataRef) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)35 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &guid, dataSize, (void*)dataRef)); ((Result)(ref val)).CheckError(); } public unsafe void SetPrivateDataInterface(Guid guid, IUnknown dataRef) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)dataRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)36 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &guid, (void*)zero)); ((Result)(ref val)).CheckError(); } internal unsafe FeatureLevel GetFeatureLevel() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, FeatureLevel>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)37 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } internal unsafe DeviceCreationFlags GetCreationFlags() { return ((delegate* unmanaged[Stdcall]<void*, DeviceCreationFlags>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)38 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } internal unsafe Result GetDeviceRemovedReason() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) return Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)39 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); } internal unsafe void GetImmediateContext(out DeviceContext immediateContextOut) { IntPtr zero = IntPtr.Zero; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)40 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero); if (zero != IntPtr.Zero) { immediateContextOut = new DeviceContext(zero); } else { immediateContextOut = null; } } internal unsafe void SetExceptionMode(int raiseFlags) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)41 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, raiseFlags)); ((Result)(ref val)).CheckError(); } internal unsafe int GetExceptionMode() { return ((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)42 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } } [Guid("a04bfb29-08ef-43d6-a49c-a9bdbdcbe686")] public class Device1 : Device { protected internal DeviceContext1 ImmediateContext1__; public DeviceContext1 ImmediateContext1 { get { if (ImmediateContext1__ == null) { GetImmediateContext1(out ImmediateContext1__); } return ImmediateContext1__; } } public DeviceContextState CreateDeviceContextState<T>(CreateDeviceContextStateFlags flags, FeatureLevel[] featureLevelsRef, out FeatureLevel chosenFeatureLevelRef) where T : ComObject { DeviceContextState deviceContextState = new DeviceContextState(IntPtr.Zero); CreateDeviceContextState(flags, featureLevelsRef, featureLevelsRef.Length, 7, Utilities.GetGuidFromType(typeof(T)), out chosenFeatureLevelRef, deviceContextState); return deviceContextState; } public T OpenSharedResource1<T>(IntPtr resourceHandle) where T : ComObject { OpenSharedResource1(resourceHandle, Utilities.GetGuidFromType(typeof(T)), out var resourceOut); return CppObject.FromPointer<T>(resourceOut); } public T OpenSharedResource1<T>(string name, SharedResourceFlags desiredAccess) where T : ComObject { //IL_0002: Unknown result type (might be due to invalid IL or missing references) OpenSharedResourceByName(name, desiredAccess, Utilities.GetGuidFromType(typeof(T)), out var resourceOut); return CppObject.FromPointer<T>(resourceOut); } protected override void Dispose(bool disposing) { if (disposing && ImmediateContext1__ != null) { ((DisposeBase)ImmediateContext1__).Dispose(); ImmediateContext1__ = null; } base.Dispose(disposing); } public Device1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Device1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Device1(nativePtr); } return null; } internal unsafe void GetImmediateContext1(out DeviceContext1 immediateContextOut) { IntPtr zero = IntPtr.Zero; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)43 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero); if (zero != IntPtr.Zero) { immediateContextOut = new DeviceContext1(zero); } else { immediateContextOut = null; } } internal unsafe void CreateDeferredContext1(int contextFlags, DeviceContext1 deferredContextOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)44 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, contextFlags, &zero)); ((CppObject)deferredContextOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateBlendState1(ref BlendStateDescription1 blendStateDescRef, BlendState1 blendStateOut) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) BlendStateDescription1.__Native @ref = default(BlendStateDescription1.__Native); IntPtr zero = IntPtr.Zero; blendStateDescRef.__MarshalTo(ref @ref); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)45 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref, &zero)); ((CppObject)blendStateOut).NativePointer = zero; blendStateDescRef.__MarshalFree(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe void CreateRasterizerState1(ref RasterizerStateDescription1 rasterizerDescRef, RasterizerState1 rasterizerStateOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (RasterizerStateDescription1* ptr = &rasterizerDescRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)46 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, &zero)); } ((CppObject)rasterizerStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateDeviceContextState(CreateDeviceContextStateFlags flags, FeatureLevel[] featureLevelsRef, int featureLevels, int sDKVersion, Guid emulatedInterface, out FeatureLevel chosenFeatureLevelRef, DeviceContextState contextStateOut) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (FeatureLevel* ptr = &chosenFeatureLevelRef) { void* ptr2 = ptr; fixed (FeatureLevel* ptr3 = featureLevelsRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int, int, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)47 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)flags, ptr4, featureLevels, sDKVersion, &emulatedInterface, ptr2, &zero)); } } ((CppObject)contextStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void OpenSharedResource1(IntPtr hResource, Guid returnedInterface, out IntPtr resourceOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &resourceOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)48 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)hResource, &returnedInterface, ptr2)); } ((Result)(ref val)).CheckError(); } internal unsafe void OpenSharedResourceByName(string lpName, SharedResourceFlags dwDesiredAccess, Guid returnedInterface, out IntPtr resourceOut) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected I4, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &resourceOut) { void* ptr2 = ptr; fixed (char* ptr3 = lpName) { val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)49 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr3, (int)dwDesiredAccess, &returnedInterface, ptr2)); } } ((Result)(ref val)).CheckError(); } } [Guid("9d06dffa-d1e5-4d07-83a8-1bb123f2f841")] public class Device2 : Device1 { protected internal DeviceContext2 ImmediateContext2__; public DeviceContext2 ImmediateContext2 { get { if (ImmediateContext2__ == null) { GetImmediateContext2(out ImmediateContext2__); } return ImmediateContext2__; } } protected override void Dispose(bool disposing) { if (disposing && ImmediateContext2__ != null) { ((DisposeBase)ImmediateContext2__).Dispose(); ImmediateContext2__ = null; } base.Dispose(disposing); } public Device2(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Device2(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Device2(nativePtr); } return null; } internal unsafe void GetImmediateContext2(out DeviceContext2 immediateContextOut) { IntPtr zero = IntPtr.Zero; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)50 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero); if (zero != IntPtr.Zero) { immediateContextOut = new DeviceContext2(zero); } else { immediateContextOut = null; } } internal unsafe void CreateDeferredContext2(int contextFlags, DeviceContext2 deferredContextOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)51 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, contextFlags, &zero)); ((CppObject)deferredContextOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } public unsafe void GetResourceTiling(Resource tiledResourceRef, out int numTilesForEntireResourceRef, out PackedMipDescription packedMipDescRef, out TileShape standardTileShapeForNonPackedMipsRef, ref int numSubresourceTilingsRef, int firstSubresourceTilingToGet, SubResourceTiling[] subresourceTilingsForNonPackedMipsRef) { IntPtr zero = IntPtr.Zero; packedMipDescRef = default(PackedMipDescription); standardTileShapeForNonPackedMipsRef = default(TileShape); zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)tiledResourceRef); fixed (SubResourceTiling* ptr = subresourceTilingsForNonPackedMipsRef) { void* ptr2 = ptr; fixed (int* ptr3 = &numSubresourceTilingsRef) { void* ptr4 = ptr3; fixed (TileShape* ptr5 = &standardTileShapeForNonPackedMipsRef) { void* ptr6 = ptr5; fixed (PackedMipDescription* ptr7 = &packedMipDescRef) { void* ptr8 = ptr7; fixed (int* ptr9 = &numTilesForEntireResourceRef) { void* ptr10 = ptr9; ((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, void*, int, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)52 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, ptr10, ptr8, ptr6, ptr4, firstSubresourceTilingToGet, ptr2); } } } } } } public unsafe int CheckMultisampleQualityLevels1(Format format, int sampleCount, CheckMultisampleQualityLevelsFlags flags) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected I4, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) int result = default(int); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)53 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)format, sampleCount, (int)flags, &result)); ((Result)(ref val)).CheckError(); return result; } } [Guid("A05C8C37-D2C6-4732-B3A0-9CE0B0DC9AE6")] public class Device3 : Device2 { protected internal DeviceContext3 ImmediateContext3__; public DeviceContext3 ImmediateContext3 { get { if (ImmediateContext3__ == null) { GetImmediateContext3(out ImmediateContext3__); } return ImmediateContext3__; } } protected override void Dispose(bool disposing) { if (disposing && ImmediateContext3__ != null) { ((DisposeBase)ImmediateContext3__).Dispose(); ImmediateContext3__ = null; } base.Dispose(disposing); } public Device3(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Device3(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Device3(nativePtr); } return null; } internal unsafe void CreateTexture2D1(ref Texture2DDescription1 desc1Ref, DataBox[] initialDataRef, Texture2D1 texture2DOut) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DataBox* ptr = initialDataRef) { void* ptr2 = ptr; fixed (Texture2DDescription1* ptr3 = &desc1Ref) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)54 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, &zero)); } } ((CppObject)texture2DOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateTexture3D1(ref Texture3DDescription1 desc1Ref, DataBox[] initialDataRef, Texture3D1 texture3DOut) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (DataBox* ptr = initialDataRef) { void* ptr2 = ptr; fixed (Texture3DDescription1* ptr3 = &desc1Ref) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)55 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, &zero)); } } ((CppObject)texture3DOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateRasterizerState2(ref RasterizerStateDescription2 rasterizerDescRef, RasterizerState2 rasterizerStateOut) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val; fixed (RasterizerStateDescription2* ptr = &rasterizerDescRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)56 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, &zero)); } ((CppObject)rasterizerStateOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe void CreateShaderResourceView1(Resource resourceRef, ShaderResourceViewDescription1? desc1Ref, ShaderResourceView1 sRView1Out) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); ShaderResourceViewDescription1 value = default(ShaderResourceViewDescription1); if (desc1Ref.HasValue) { value = desc1Ref.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; ShaderResourceViewDescription1* intPtr2 = ((!desc1Ref.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)57 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)sRView1Out).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateUnorderedAccessView1(Resource resourceRef, UnorderedAccessViewDescription1? desc1Ref, UnorderedAccessView1 uAView1Out) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); UnorderedAccessViewDescription1 value = default(UnorderedAccessViewDescription1); if (desc1Ref.HasValue) { value = desc1Ref.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; UnorderedAccessViewDescription1* intPtr2 = ((!desc1Ref.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)58 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, &zero2)); ((CppObject)uAView1Out).NativePointer = zero2; ((Result)(ref val)).CheckError(); } internal unsafe void CreateRenderTargetView1(Resource resourceRef, RenderTargetViewDescription1? desc1Ref, RenderTargetView1 rTView1Out) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)resourceRef); RenderTargetViewDescription1 value = default(RenderTargetViewDescription1); if (desc1Ref.HasValue) { value = desc1Ref.Value; } void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; RenderTargetViewDescription1* intPtr2 = ((!desc1Ref.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePoi
plugins/OverlayDearImGui.Shared/OverlayDearImGui.Shared.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ImGuiNET; using Microsoft.CodeAnalysis; using OverlayDearImGui.Windows; using SharpDX; using SharpDX.DXGI; using SharpDX.Direct3D; using SharpDX.Direct3D11; using SharpDX.Mathematics.Interop; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("OverlayDearImGui.BepInEx5")] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("OverlayDearImGui.Shared")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0+56b0830b20d078c5218c3627d661348962d8145d")] [assembly: AssemblyProduct("OverlayDearImGui.Shared")] [assembly: AssemblyTitle("OverlayDearImGui.Shared")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace AutoThunderstoreVersion { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] internal class AutoVersionAttribute : Attribute { } } namespace OverlayDearImGui { internal sealed class ClonedDrawData : IDisposable { public unsafe ImDrawData* Data { get; private set; } public unsafe ClonedDrawData(ImDrawDataPtr inp) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) long num = Marshal.SizeOf<ImDrawData>(); Data = (ImDrawData*)(void*)ImGui.MemAlloc((uint)num); Buffer.MemoryCopy(ImDrawDataPtr.op_Implicit(inp), Data, num, num); int size = ((ImDrawDataPtr)(ref inp)).CmdLists.Size; IntPtr intPtr = ImGui.MemAlloc((uint)(Marshal.SizeOf<IntPtr>() * size)); Unsafe.Write(&((ImDrawData)Data).CmdLists, new ImVector(size, size, intPtr)); for (int i = 0; i < ((ImDrawDataPtr)(ref inp)).CmdLists.Size; i++) { ((ImVector)(&((ImDrawData)Data).CmdLists)).Ref<ImDrawListPtr>(i) = ((ImDrawListPtr)(ref ((ImDrawDataPtr)(ref inp)).CmdLists[i])).CloneOutput(); } } public unsafe void Dispose() { if (Data != null) { for (int i = 0; i < ((ImDrawData)Data).CmdListsCount; i++) { ((ImDrawListPtr)(ref ((ImVector)(&((ImDrawData)Data).CmdLists)).Ref<ImDrawListPtr>(i))).Destroy(); } ImGuiNative.ImDrawData_destroy(Data); Data = null; } } } internal sealed class DisposableList<U> : List<U>, IDisposable where U : IDisposable { public DisposableList() { } public DisposableList(int capacity) : base(capacity) { } public void Dispose() { using (Enumerator enumerator = GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.Dispose(); } } Clear(); } } public interface IConfigEntry<T> { T Get(); void Set(T value); } public static class ImGuiDX11Impl { public struct VERTEX_CONSTANT_BUFFER_DX11 { public unsafe fixed float mvp[16]; } private unsafe delegate void ImDrawUserCallBack(ImDrawList* a, ImDrawCmd* b); private class StateBackup { public InputLayout InputLayout; public PrimitiveTopology PrimitiveTopology; public Buffer IndexBuffer; public Format IndexBufferFormat; public int IndexBufferOffset; public Buffer[] VertexBuffers; public int[] VertexBufferStrides; public int[] VertexBufferOffsets; public RasterizerState RS; public Rectangle[] ScissorRects; public RawViewportF[] Viewports; public BlendState BlendState; public RawColor4 BlendFactor; public int SampleMask; public DepthStencilState DepthStencilState; public int DepthStencilRef; public DepthStencilView DepthStencilView; public RenderTargetView[] RenderTargetViews; public VertexShader VS; public Buffer[] VSConstantBuffers; public SamplerState[] VSSamplers; public ShaderResourceView[] VSResourceViews; public HullShader HS; public Buffer[] HSConstantBuffers; public SamplerState[] HSSamplers; public ShaderResourceView[] HSResourceViews; public DomainShader DS; public Buffer[] DSConstantBuffers; public SamplerState[] DSSamplers; public ShaderResourceView[] DSResourceViews; public GeometryShader GS; public Buffer[] GSConstantBuffers; public SamplerState[] GSSamplers; public ShaderResourceView[] GSResourceViews; public PixelShader PS; public Buffer[] PSConstantBuffers; public SamplerState[] PSSamplers; public ShaderResourceView[] PSResourceViews; public ComputeShader CS; public Buffer[] CSConstantBuffers; public SamplerState[] CSSamplers; public ShaderResourceView[] CSResourceViews; public UnorderedAccessView[] CSUAVs; } private static IntPtr _renderNamePtr; private static Device _device; private static DeviceContext _deviceContext; private static ShaderResourceView _fontResourceView; private static SamplerState _fontSampler; private static VertexShader _vertexShader; private static PixelShader _pixelShader; private static InputLayout _inputLayout; private static Buffer _vertexConstantBuffer; private static BlendState _blendState; private static RasterizerState _rasterizerState; private static DepthStencilState _depthStencilState; private static Buffer _vertexBuffer; private static Buffer _indexBuffer; private static int _vertexBufferSize; private static int _indexBufferSize; private static VertexBufferBinding _vertexBinding; private static RawColor4 _blendColor = new RawColor4(0f, 0f, 0f, 0f); private unsafe static void ImGui_ImplDX11_SetupRenderState(ImDrawData* draw_data, IntPtr ID3D11DeviceContextPtr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) DeviceContext val = new DeviceContext(ID3D11DeviceContextPtr); val.Rasterizer.SetViewport(0f, 0f, ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).x, ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).y, 0f, 1f); val.InputAssembler.InputLayout = _inputLayout; InputAssemblerStage inputAssembler = val.InputAssembler; VertexBufferBinding val2 = default(VertexBufferBinding); ((VertexBufferBinding)(ref val2)).Stride = Unsafe.SizeOf<ImDrawVert>(); ((VertexBufferBinding)(ref val2)).Offset = 0; ((VertexBufferBinding)(ref val2)).Buffer = _vertexBuffer; inputAssembler.SetVertexBuffers(0, val2); val.InputAssembler.SetIndexBuffer(_indexBuffer, (Format)57, 0); val.InputAssembler.PrimitiveTopology = (PrimitiveTopology)4; ((CommonShaderStage)val.VertexShader).SetShader((DeviceChild)(object)_vertexShader, (ClassInstance[])null, 0); ((CommonShaderStage)val.VertexShader).SetConstantBuffer(0, _vertexConstantBuffer); ((CommonShaderStage)val.PixelShader).SetShader((DeviceChild)(object)_pixelShader, (ClassInstance[])null, 0); ((CommonShaderStage)val.PixelShader).SetSampler(0, _fontSampler); ((CommonShaderStage)val.GeometryShader).SetShader((DeviceChild)null, (ClassInstance[])null, 0); ((CommonShaderStage)val.HullShader).SetShader((DeviceChild)null, (ClassInstance[])null, 0); ((CommonShaderStage)val.DomainShader).SetShader((DeviceChild)null, (ClassInstance[])null, 0); ((CommonShaderStage)val.ComputeShader).SetShader((DeviceChild)null, (ClassInstance[])null, 0); RawColor4 value = default(RawColor4); ((RawColor4)(ref value))..ctor(0f, 0f, 0f, 0f); val.OutputMerger.SetBlendState(_blendState, (RawColor4?)value, uint.MaxValue); val.OutputMerger.SetDepthStencilState(_depthStencilState, 0); val.Rasterizer.State = _rasterizerState; } public unsafe static void RenderDrawData(ImDrawData* draw_data) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Expected O, but got Unknown //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) if (draw_data == null || ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).x <= 0f || ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).y <= 0f) { return; } DeviceContext deviceContext = _deviceContext; if (_vertexBuffer == null || _vertexBufferSize < ((ImDrawData)draw_data).TotalVtxCount) { Buffer vertexBuffer = _vertexBuffer; if (vertexBuffer != null) { ((DisposeBase)vertexBuffer).Dispose(); } _vertexBufferSize = ((ImDrawData)draw_data).TotalVtxCount + 5000; _vertexBuffer = new Buffer(_device, new BufferDescription { Usage = (ResourceUsage)2, SizeInBytes = _vertexBufferSize * Unsafe.SizeOf<ImDrawVert>(), BindFlags = (BindFlags)1, CpuAccessFlags = (CpuAccessFlags)65536, OptionFlags = (ResourceOptionFlags)0 }); VertexBufferBinding vertexBinding = default(VertexBufferBinding); ((VertexBufferBinding)(ref vertexBinding)).Buffer = _vertexBuffer; ((VertexBufferBinding)(ref vertexBinding)).Stride = Unsafe.SizeOf<ImDrawVert>(); ((VertexBufferBinding)(ref vertexBinding)).Offset = 0; _vertexBinding = vertexBinding; } if (_indexBuffer == null || _indexBufferSize < ((ImDrawData)draw_data).TotalIdxCount) { Buffer indexBuffer = _indexBuffer; if (indexBuffer != null) { ((DisposeBase)indexBuffer).Dispose(); } _indexBufferSize = ((ImDrawData)draw_data).TotalIdxCount + 10000; _indexBuffer = new Buffer(_device, new BufferDescription { Usage = (ResourceUsage)2, SizeInBytes = _indexBufferSize * 2, BindFlags = (BindFlags)2, CpuAccessFlags = (CpuAccessFlags)65536 }); } DataStream val = default(DataStream); deviceContext.MapSubresource(_vertexBuffer, (MapMode)4, (MapFlags)0, ref val); DataStream val2 = default(DataStream); deviceContext.MapSubresource(_indexBuffer, (MapMode)4, (MapFlags)0, ref val2); ImDrawVert* ptr = (ImDrawVert*)(void*)val.DataPointer; ushort* ptr2 = (ushort*)(void*)val2.DataPointer; for (int i = 0; i < ((ImDrawData)draw_data).CmdListsCount; i++) { ImDrawList* ptr3 = (ImDrawList*)(void*)((ImVector)(&((ImDrawData)draw_data).CmdLists)).Ref<IntPtr>(i); int num = ((ImVector)(&((ImDrawList)ptr3).VtxBuffer)).Size * Unsafe.SizeOf<ImDrawVert>(); Buffer.MemoryCopy((void*)((ImVector)(&((ImDrawList)ptr3).VtxBuffer)).Data, ptr, num, num); num = ((ImVector)(&((ImDrawList)ptr3).IdxBuffer)).Size * 2; Buffer.MemoryCopy((void*)((ImVector)(&((ImDrawList)ptr3).IdxBuffer)).Data, ptr2, num, num); ptr = (ImDrawVert*)((byte*)ptr + (nint)((ImVector)(&((ImDrawList)ptr3).VtxBuffer)).Size * (nint)Unsafe.SizeOf<ImDrawVert>()); ptr2 += ((ImVector)(&((ImDrawList)ptr3).IdxBuffer)).Size; } deviceContext.UnmapSubresource((Resource)(object)_vertexBuffer, 0); deviceContext.UnmapSubresource((Resource)(object)_indexBuffer, 0); DataStream val3 = default(DataStream); deviceContext.MapSubresource(_vertexConstantBuffer, (MapMode)4, (MapFlags)0, ref val3); VERTEX_CONSTANT_BUFFER_DX11* ptr4 = (VERTEX_CONSTANT_BUFFER_DX11*)(void*)val3.DataPointer; float x = ((Vector2)(&((ImDrawData)draw_data).DisplayPos)).x; float num2 = ((Vector2)(&((ImDrawData)draw_data).DisplayPos)).x + ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).x; float y = ((Vector2)(&((ImDrawData)draw_data).DisplayPos)).y; float num3 = ((Vector2)(&((ImDrawData)draw_data).DisplayPos)).y + ((Vector2)(&((ImDrawData)draw_data).DisplaySize)).y; float* fixedElementField = ptr4->mvp; *fixedElementField = 2f / (num2 - x); ptr4->mvp[1] = 0f; ptr4->mvp[2] = 0f; ptr4->mvp[3] = 0f; ptr4->mvp[4] = 0f; ptr4->mvp[5] = 2f / (y - num3); ptr4->mvp[6] = 0f; ptr4->mvp[7] = 0f; ptr4->mvp[8] = 0f; ptr4->mvp[9] = 0f; ptr4->mvp[10] = 0.5f; ptr4->mvp[11] = 0f; ptr4->mvp[12] = (num2 + x) / (x - num2); ptr4->mvp[13] = (y + num3) / (num3 - y); ptr4->mvp[14] = 0.5f; ptr4->mvp[15] = 1f; deviceContext.UnmapSubresource((Resource)(object)_vertexConstantBuffer, 0); StateBackup old = BackupRenderState(deviceContext); ImGui_ImplDX11_SetupRenderState(draw_data, ((CppObject)deviceContext).NativePointer); int num4 = 0; int num5 = 0; Vector2 displayPos = ((ImDrawData)draw_data).DisplayPos; Vector2 val5 = default(Vector2); Vector2 val6 = default(Vector2); RawRectangle val7 = default(RawRectangle); for (int j = 0; j < ((ImDrawData)draw_data).CmdListsCount; j++) { ImDrawList* ptr5 = (ImDrawList*)(void*)((ImVector)(&((ImDrawData)draw_data).CmdLists)).Ref<IntPtr>(j); for (int k = 0; k < ((ImVector)(&((ImDrawList)ptr5).CmdBuffer)).Size; k++) { ImDrawCmd val4 = ((ImVector)(&((ImDrawList)ptr5).CmdBuffer)).Ref<ImDrawCmd>(k); if (val4.UserCallback != IntPtr.Zero) { ImDrawUserCallBack delegateForFunctionPointer = Marshal.GetDelegateForFunctionPointer<ImDrawUserCallBack>(val4.UserCallback); if (val4.UserCallback == new IntPtr(-1)) { ImGui_ImplDX11_SetupRenderState(draw_data, ((CppObject)deviceContext).NativePointer); } else { delegateForFunctionPointer(ptr5, &val4); } continue; } ((Vector2)(ref val5))..ctor(val4.ClipRect.x - displayPos.x, val4.ClipRect.y - displayPos.y); ((Vector2)(ref val6))..ctor(val4.ClipRect.z - displayPos.x, val4.ClipRect.w - displayPos.y); if (!(val6.x <= val5.x) && !(val6.y <= val5.y)) { ((RawRectangle)(ref val7))..ctor((int)val5.x, (int)val5.y, (int)val6.x, (int)val6.y); deviceContext.Rasterizer.SetScissorRectangles<RawRectangle>((RawRectangle[])(object)new RawRectangle[1] { val7 }); ((CommonShaderStage)deviceContext.PixelShader).SetShaderResource(0, new ShaderResourceView(val4.TextureId)); deviceContext.DrawIndexed((int)val4.ElemCount, (int)(val4.IdxOffset + num4), (int)(val4.VtxOffset + num5)); } } num4 += ((ImVector)(&((ImDrawList)ptr5).IdxBuffer)).Size; num5 += ((ImVector)(&((ImDrawList)ptr5).VtxBuffer)).Size; } RestoreRenderState(deviceContext, old); } private static StateBackup BackupRenderState(DeviceContext ctx) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) StateBackup stateBackup = new StateBackup { ScissorRects = new Rectangle[16], Viewports = (RawViewportF[])(object)new RawViewportF[16], VertexBuffers = (Buffer[])(object)new Buffer[32], VertexBufferStrides = new int[32], VertexBufferOffsets = new int[32], InputLayout = ctx.InputAssembler.InputLayout }; ctx.InputAssembler.GetIndexBuffer(ref stateBackup.IndexBuffer, ref stateBackup.IndexBufferFormat, ref stateBackup.IndexBufferOffset); stateBackup.PrimitiveTopology = ctx.InputAssembler.PrimitiveTopology; ctx.InputAssembler.GetVertexBuffers(0, 32, stateBackup.VertexBuffers, stateBackup.VertexBufferStrides, stateBackup.VertexBufferOffsets); stateBackup.RS = ctx.Rasterizer.State; ctx.Rasterizer.GetScissorRectangles<Rectangle>(stateBackup.ScissorRects); ctx.Rasterizer.GetViewports<RawViewportF>(stateBackup.Viewports); stateBackup.BlendState = ctx.OutputMerger.GetBlendState(ref stateBackup.BlendFactor, ref stateBackup.SampleMask); stateBackup.DepthStencilState = ctx.OutputMerger.GetDepthStencilState(ref stateBackup.DepthStencilRef); stateBackup.RenderTargetViews = ctx.OutputMerger.GetRenderTargets(8, ref stateBackup.DepthStencilView); stateBackup.VS = ((CommonShaderStage<VertexShader>)(object)ctx.VertexShader).Get(); stateBackup.VSSamplers = ((CommonShaderStage)ctx.VertexShader).GetSamplers(0, 16); stateBackup.VSConstantBuffers = ((CommonShaderStage)ctx.VertexShader).GetConstantBuffers(0, 14); stateBackup.VSResourceViews = ((CommonShaderStage)ctx.VertexShader).GetShaderResources(0, 128); stateBackup.HS = ((CommonShaderStage<HullShader>)(object)ctx.HullShader).Get(); stateBackup.HSSamplers = ((CommonShaderStage)ctx.HullShader).GetSamplers(0, 16); stateBackup.HSConstantBuffers = ((CommonShaderStage)ctx.HullShader).GetConstantBuffers(0, 14); stateBackup.HSResourceViews = ((CommonShaderStage)ctx.HullShader).GetShaderResources(0, 128); stateBackup.DS = ((CommonShaderStage<DomainShader>)(object)ctx.DomainShader).Get(); stateBackup.DSSamplers = ((CommonShaderStage)ctx.DomainShader).GetSamplers(0, 16); stateBackup.DSConstantBuffers = ((CommonShaderStage)ctx.DomainShader).GetConstantBuffers(0, 14); stateBackup.DSResourceViews = ((CommonShaderStage)ctx.DomainShader).GetShaderResources(0, 128); stateBackup.GS = ((CommonShaderStage<GeometryShader>)(object)ctx.GeometryShader).Get(); stateBackup.GSSamplers = ((CommonShaderStage)ctx.GeometryShader).GetSamplers(0, 16); stateBackup.GSConstantBuffers = ((CommonShaderStage)ctx.GeometryShader).GetConstantBuffers(0, 14); stateBackup.GSResourceViews = ((CommonShaderStage)ctx.GeometryShader).GetShaderResources(0, 128); stateBackup.PS = ((CommonShaderStage<PixelShader>)(object)ctx.PixelShader).Get(); stateBackup.PSSamplers = ((CommonShaderStage)ctx.PixelShader).GetSamplers(0, 16); stateBackup.PSConstantBuffers = ((CommonShaderStage)ctx.PixelShader).GetConstantBuffers(0, 14); stateBackup.PSResourceViews = ((CommonShaderStage)ctx.PixelShader).GetShaderResources(0, 128); stateBackup.CS = ((CommonShaderStage<ComputeShader>)(object)ctx.ComputeShader).Get(); stateBackup.CSSamplers = ((CommonShaderStage)ctx.ComputeShader).GetSamplers(0, 16); stateBackup.CSConstantBuffers = ((CommonShaderStage)ctx.ComputeShader).GetConstantBuffers(0, 14); stateBackup.CSResourceViews = ((CommonShaderStage)ctx.ComputeShader).GetShaderResources(0, 128); stateBackup.CSUAVs = ctx.ComputeShader.GetUnorderedAccessViews(0, 8); return stateBackup; } private static void RestoreRenderState(DeviceContext ctx, StateBackup old) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) ctx.InputAssembler.InputLayout = old.InputLayout; ctx.InputAssembler.SetIndexBuffer(old.IndexBuffer, old.IndexBufferFormat, old.IndexBufferOffset); ctx.InputAssembler.PrimitiveTopology = old.PrimitiveTopology; ctx.InputAssembler.SetVertexBuffers(0, old.VertexBuffers, old.VertexBufferStrides, old.VertexBufferOffsets); ctx.Rasterizer.State = old.RS; ctx.Rasterizer.SetScissorRectangles<Rectangle>(old.ScissorRects); ctx.Rasterizer.SetViewports(old.Viewports, old.Viewports.Length); ctx.OutputMerger.SetBlendState(old.BlendState, (RawColor4?)old.BlendFactor, old.SampleMask); ctx.OutputMerger.SetDepthStencilState(old.DepthStencilState, old.DepthStencilRef); ctx.OutputMerger.SetRenderTargets(old.DepthStencilView, old.RenderTargetViews); ((CommonShaderStage<VertexShader>)(object)ctx.VertexShader).Set(old.VS); ((CommonShaderStage)ctx.VertexShader).SetSamplers(0, old.VSSamplers); ((CommonShaderStage)ctx.VertexShader).SetConstantBuffers(0, old.VSConstantBuffers); ((CommonShaderStage)ctx.VertexShader).SetShaderResources(0, old.VSResourceViews); ((CommonShaderStage<HullShader>)(object)ctx.HullShader).Set(old.HS); ((CommonShaderStage)ctx.HullShader).SetSamplers(0, old.HSSamplers); ((CommonShaderStage)ctx.HullShader).SetConstantBuffers(0, old.HSConstantBuffers); ((CommonShaderStage)ctx.HullShader).SetShaderResources(0, old.HSResourceViews); ((CommonShaderStage<DomainShader>)(object)ctx.DomainShader).Set(old.DS); ((CommonShaderStage)ctx.DomainShader).SetSamplers(0, old.DSSamplers); ((CommonShaderStage)ctx.DomainShader).SetConstantBuffers(0, old.DSConstantBuffers); ((CommonShaderStage)ctx.DomainShader).SetShaderResources(0, old.DSResourceViews); ((CommonShaderStage<GeometryShader>)(object)ctx.GeometryShader).Set(old.GS); ((CommonShaderStage)ctx.GeometryShader).SetSamplers(0, old.GSSamplers); ((CommonShaderStage)ctx.GeometryShader).SetConstantBuffers(0, old.GSConstantBuffers); ((CommonShaderStage)ctx.GeometryShader).SetShaderResources(0, old.GSResourceViews); ((CommonShaderStage<PixelShader>)(object)ctx.PixelShader).Set(old.PS); ((CommonShaderStage)ctx.PixelShader).SetSamplers(0, old.PSSamplers); ((CommonShaderStage)ctx.PixelShader).SetConstantBuffers(0, old.PSConstantBuffers); ((CommonShaderStage)ctx.PixelShader).SetShaderResources(0, old.PSResourceViews); ((CommonShaderStage<ComputeShader>)(object)ctx.ComputeShader).Set(old.CS); ((CommonShaderStage)ctx.ComputeShader).SetSamplers(0, old.CSSamplers); ((CommonShaderStage)ctx.ComputeShader).SetConstantBuffers(0, old.CSConstantBuffers); ((CommonShaderStage)ctx.ComputeShader).SetShaderResources(0, old.CSResourceViews); ctx.ComputeShader.SetUnorderedAccessViews(0, old.CSUAVs); } public static void CreateFontsTexture() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown ImGuiIOPtr iO = ImGui.GetIO(); ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts; IntPtr intPtr = default(IntPtr); int num = default(int); int height = default(int); int num2 = default(int); ((ImFontAtlasPtr)(ref fonts)).GetTexDataAsRGBA32(ref intPtr, ref num, ref height, ref num2); Texture2DDescription val = default(Texture2DDescription); val.Width = num; val.Height = height; val.MipLevels = 1; val.ArraySize = 1; val.Format = (Format)28; val.SampleDescription = new SampleDescription(1, 0); val.Usage = (ResourceUsage)1; val.BindFlags = (BindFlags)8; val.CpuAccessFlags = (CpuAccessFlags)0; val.OptionFlags = (ResourceOptionFlags)0; Texture2DDescription val2 = val; Texture2D val3 = new Texture2D(_device, val2, (DataRectangle[])(object)new DataRectangle[1] { new DataRectangle(intPtr, num * num2) }); try { _fontResourceView = new ShaderResourceView(_device, (Resource)(object)val3, new ShaderResourceViewDescription { Format = val2.Format, Dimension = (ShaderResourceViewDimension)4, Texture2D = { MipLevels = val2.MipLevels } }); } finally { ((IDisposable)val3)?.Dispose(); } fonts = ((ImGuiIOPtr)(ref iO)).Fonts; ((ImFontAtlasPtr)(ref fonts)).SetTexID(((CppObject)_fontResourceView).NativePointer); _fontSampler = new SamplerState(_device, new SamplerStateDescription { Filter = (Filter)21, AddressU = (TextureAddressMode)1, AddressV = (TextureAddressMode)1, AddressW = (TextureAddressMode)1, MipLodBias = 0f, ComparisonFunction = (Comparison)8, MinimumLod = 0f, MaximumLod = 0f }); } public static bool CreateDeviceObjects() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown if (_device == null) { return false; } if (_fontSampler != null) { InvalidateDeviceObjects(); } string path = Path.Combine(Overlay.AssetsFolderPath, "Shaders"); byte[] array = File.ReadAllBytes(Path.Combine(path, "imgui-vertex.hlsl.bytes")); _vertexShader = new VertexShader(_device, array, (ClassLinkage)null); _inputLayout = new InputLayout(_device, array, (InputElement[])(object)new InputElement[3] { new InputElement("POSITION", 0, (Format)16, 0), new InputElement("TEXCOORD", 0, (Format)16, 0), new InputElement("COLOR", 0, (Format)28, 0) }); _vertexConstantBuffer = new Buffer(_device, new BufferDescription { Usage = (ResourceUsage)2, BindFlags = (BindFlags)4, CpuAccessFlags = (CpuAccessFlags)65536, OptionFlags = (ResourceOptionFlags)0, SizeInBytes = 64 }); byte[] array2 = File.ReadAllBytes(Path.Combine(path, "imgui-frag.hlsl.bytes")); _pixelShader = new PixelShader(_device, array2, (ClassLinkage)null); BlendStateDescription val = default(BlendStateDescription); val.AlphaToCoverageEnable = RawBool.op_Implicit(false); BlendStateDescription val2 = val; ((BlendStateDescription)(ref val2)).RenderTarget[0].IsBlendEnabled = RawBool.op_Implicit(true); ((BlendStateDescription)(ref val2)).RenderTarget[0].SourceBlend = (BlendOption)5; ((BlendStateDescription)(ref val2)).RenderTarget[0].DestinationBlend = (BlendOption)6; ((BlendStateDescription)(ref val2)).RenderTarget[0].BlendOperation = (BlendOperation)1; ((BlendStateDescription)(ref val2)).RenderTarget[0].SourceAlphaBlend = (BlendOption)8; ((BlendStateDescription)(ref val2)).RenderTarget[0].DestinationAlphaBlend = (BlendOption)2; ((BlendStateDescription)(ref val2)).RenderTarget[0].AlphaBlendOperation = (BlendOperation)1; ((BlendStateDescription)(ref val2)).RenderTarget[0].RenderTargetWriteMask = (ColorWriteMaskFlags)15; _blendState = new BlendState(_device, val2); _rasterizerState = new RasterizerState(_device, new RasterizerStateDescription { FillMode = (FillMode)3, CullMode = (CullMode)1, IsScissorEnabled = RawBool.op_Implicit(true), IsDepthClipEnabled = RawBool.op_Implicit(true) }); _depthStencilState = new DepthStencilState(_device, new DepthStencilStateDescription { IsDepthEnabled = RawBool.op_Implicit(false), DepthWriteMask = (DepthWriteMask)1, DepthComparison = (Comparison)8, IsStencilEnabled = RawBool.op_Implicit(false), FrontFace = { FailOperation = (StencilOperation)1 }, FrontFace = { DepthFailOperation = (StencilOperation)1 }, FrontFace = { PassOperation = (StencilOperation)1 }, FrontFace = { Comparison = (Comparison)8 }, BackFace = { FailOperation = (StencilOperation)1 }, BackFace = { DepthFailOperation = (StencilOperation)1 }, BackFace = { PassOperation = (StencilOperation)1 }, BackFace = { Comparison = (Comparison)8 } }); CreateFontsTexture(); return true; } public static void InvalidateDeviceObjects() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (_device != null) { SamplerState fontSampler = _fontSampler; if (fontSampler != null) { ((DisposeBase)fontSampler).Dispose(); } _fontSampler = null; ShaderResourceView fontResourceView = _fontResourceView; if (fontResourceView != null) { ((DisposeBase)fontResourceView).Dispose(); } _fontResourceView = null; ImGuiIOPtr iO = ImGui.GetIO(); ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts; ((ImFontAtlasPtr)(ref fonts)).SetTexID(IntPtr.Zero); Buffer indexBuffer = _indexBuffer; if (indexBuffer != null) { ((DisposeBase)indexBuffer).Dispose(); } _indexBuffer = null; Buffer vertexBuffer = _vertexBuffer; if (vertexBuffer != null) { ((DisposeBase)vertexBuffer).Dispose(); } _vertexBuffer = null; BlendState blendState = _blendState; if (blendState != null) { ((DisposeBase)blendState).Dispose(); } _blendState = null; DepthStencilState depthStencilState = _depthStencilState; if (depthStencilState != null) { ((DisposeBase)depthStencilState).Dispose(); } _depthStencilState = null; RasterizerState rasterizerState = _rasterizerState; if (rasterizerState != null) { ((DisposeBase)rasterizerState).Dispose(); } _rasterizerState = null; PixelShader pixelShader = _pixelShader; if (pixelShader != null) { ((DisposeBase)pixelShader).Dispose(); } _pixelShader = null; Buffer vertexConstantBuffer = _vertexConstantBuffer; if (vertexConstantBuffer != null) { ((DisposeBase)vertexConstantBuffer).Dispose(); } _vertexConstantBuffer = null; InputLayout inputLayout = _inputLayout; if (inputLayout != null) { ((DisposeBase)inputLayout).Dispose(); } _inputLayout = null; VertexShader vertexShader = _vertexShader; if (vertexShader != null) { ((DisposeBase)vertexShader).Dispose(); } _vertexShader = null; } } public static void Shutdown() { InvalidateDeviceObjects(); _device = null; _deviceContext = null; if (_renderNamePtr != IntPtr.Zero) { Marshal.FreeHGlobal(_renderNamePtr); _renderNamePtr = IntPtr.Zero; } } public static void NewFrame() { if (_fontSampler == null) { CreateDeviceObjects(); } } internal unsafe static void Init(void* device, void* deviceContext) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown ImGuiIOPtr iO = ImGui.GetIO(); ref ImGuiBackendFlags backendFlags = ref ((ImGuiIOPtr)(ref iO)).BackendFlags; iO = ImGui.GetIO(); backendFlags = (ImGuiBackendFlags)((uint)((ImGuiIOPtr)(ref iO)).BackendFlags | 8u); _renderNamePtr = Marshal.StringToHGlobalAnsi("imgui_impl_dx11_c#"); iO = ImGui.GetIO(); ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).BackendRendererName = (byte*)_renderNamePtr.ToPointer(); _device = new Device((IntPtr)device); _deviceContext = new DeviceContext((IntPtr)deviceContext); } } public static class ImGuiWin32Impl { private delegate uint XInputGetCapabilitiesDelegate(uint a, uint b, IntPtr c); private delegate uint XInputGetStateDelegate(uint a, IntPtr b); private static IntPtr _windowHandle; private static IntPtr _mouseHandle; private static int _mouseTrackedArea; private static int _mouseButtonsDown; private static long _time; private static long _ticksPerSecond; private static ImGuiMouseCursor _lastMouseCursor; private static IntPtr _xInputDLL; private static XInputGetCapabilitiesDelegate _xInputGetCapabilities; private static XInputGetStateDelegate _xInputGetState; public const VirtualKey IM_VK_KEYPAD_ENTER = (VirtualKey)269; private const int XBUTTON1 = 1; private const int WHEEL_DELTA = 120; public static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4); private unsafe static bool ImGui_ImplWin32_InitEx(void* windowHandle, bool platform_has_own_dc) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) ImGuiIOPtr iO = ImGui.GetIO(); if (_windowHandle != IntPtr.Zero) { Log.Error("Already initialized a platform backend!", "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/ImGuiWin32Impl.cs", "ImGui_ImplWin32_InitEx", 35); return false; } if (!Kernel32.QueryPerformanceFrequency(out var frequency)) { return false; } if (!Kernel32.QueryPerformanceCounter(out var lpPerformanceCount)) { return false; } ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).BackendPlatformName = (byte*)(void*)Marshal.StringToHGlobalAnsi("imgui_impl_win32"); ref ImGuiBackendFlags backendFlags = ref ((ImGuiIOPtr)(ref iO)).BackendFlags; backendFlags = (ImGuiBackendFlags)((uint)backendFlags | 2u); ref ImGuiBackendFlags backendFlags2 = ref ((ImGuiIOPtr)(ref iO)).BackendFlags; backendFlags2 = (ImGuiBackendFlags)((uint)backendFlags2 | 4u); _windowHandle = (IntPtr)windowHandle; _ticksPerSecond = frequency; _time = lpPerformanceCount; _lastMouseCursor = (ImGuiMouseCursor)9; ImGuiViewportPtr mainViewport = ImGui.GetMainViewport(); ((ImGuiViewport)((ImGuiViewportPtr)(ref mainViewport)).NativePtr).PlatformHandleRaw = windowHandle; List<string> list = new List<string> { "xinput1_4.dll", "xinput1_3.dll", "xinput9_1_0.dll", "xinput1_2.dll", "xinput1_1.dll" }; for (int i = 0; i < list.Count; i++) { IntPtr intPtr = Kernel32.LoadLibrary(list[i]); if (intPtr != IntPtr.Zero) { _xInputDLL = intPtr; _xInputGetCapabilities = Marshal.GetDelegateForFunctionPointer<XInputGetCapabilitiesDelegate>(Kernel32.GetProcAddress(intPtr, "XInputGetCapabilities")); _xInputGetState = Marshal.GetDelegateForFunctionPointer<XInputGetStateDelegate>(Kernel32.GetProcAddress(intPtr, "XInputGetState")); break; } } return true; } public unsafe static bool ImGui_ImplWin32_Init(void* hwnd) { return ImGui_ImplWin32_InitEx(hwnd, platform_has_own_dc: false); } public unsafe static bool ImGui_ImplWin32_InitForOpenGL(void* hwnd) { return ImGui_ImplWin32_InitEx(hwnd, platform_has_own_dc: true); } public unsafe static void Shutdown() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_windowHandle == IntPtr.Zero) { Log.Error("No platform backend to shutdown, or already shutdown?", "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/ImGuiWin32Impl.cs", "Shutdown", 99); return; } ImGuiIOPtr iO = ImGui.GetIO(); if (_xInputDLL != IntPtr.Zero) { Kernel32.FreeLibrary(_xInputDLL); } ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).BackendPlatformName = null; ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).BackendPlatformUserData = null; ref ImGuiBackendFlags backendFlags = ref ((ImGuiIOPtr)(ref iO)).BackendFlags; backendFlags = (ImGuiBackendFlags)((uint)backendFlags & 0xFFFFFFF8u); } private static bool ImGui_ImplWin32_UpdateMouseCursor() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected I4, but got Unknown ImGuiIOPtr iO = ImGui.GetIO(); if (((uint)((ImGuiIOPtr)(ref iO)).ConfigFlags & 0x20u) != 0) { return false; } ImGuiMouseCursor mouseCursor = ImGui.GetMouseCursor(); if ((int)mouseCursor == -1 || ((ImGuiIOPtr)(ref iO)).MouseDrawCursor) { User32.SetCursor(IntPtr.Zero); } else { int lpCursorName = 32512; switch ((int)mouseCursor) { case 0: lpCursorName = 32512; break; case 1: lpCursorName = 32513; break; case 2: lpCursorName = 32646; break; case 4: lpCursorName = 32644; break; case 3: lpCursorName = 32645; break; case 5: lpCursorName = 32643; break; case 6: lpCursorName = 32642; break; case 7: lpCursorName = 32649; break; case 8: lpCursorName = 32648; break; } User32.SetCursor(User32.LoadCursor(IntPtr.Zero, lpCursorName)); } return true; } private static bool IsVkDown(VirtualKey vk) { return (User32.GetKeyState(vk) & 0x8000) != 0; } private static void ImGui_ImplWin32_AddKeyEvent(ImGuiKey key, bool down, VirtualKey native_keycode, int native_scancode = -1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) ImGuiIOPtr iO = ImGui.GetIO(); ((ImGuiIOPtr)(ref iO)).AddKeyEvent(key, down); ((ImGuiIOPtr)(ref iO)).SetKeyEventNativeData(key, (int)native_keycode, native_scancode); } private static void ImGui_ImplWin32_ProcessKeyEventsWorkarounds() { if (ImGui.IsKeyDown((ImGuiKey)528) && !IsVkDown(VirtualKey.LeftShift)) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)528, down: false, VirtualKey.LeftShift); } if (ImGui.IsKeyDown((ImGuiKey)532) && !IsVkDown(VirtualKey.RightShift)) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)532, down: false, VirtualKey.RightShift); } if (ImGui.IsKeyDown((ImGuiKey)530) && !IsVkDown(VirtualKey.LeftWindows)) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)530, down: false, VirtualKey.LeftWindows); } if (ImGui.IsKeyDown((ImGuiKey)534) && !IsVkDown(VirtualKey.RightWindows)) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)534, down: false, VirtualKey.RightWindows); } } public static void ImGui_ImplWin32_UpdateKeyModifiers() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) ImGuiIOPtr iO = ImGui.GetIO(); ((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)4096, IsVkDown(VirtualKey.Control)); ((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)8192, IsVkDown(VirtualKey.Shift)); ((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)16384, IsVkDown(VirtualKey.Menu)); ((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)32768, IsVkDown(VirtualKey.Application)); } public static void ImGui_ImplWin32_UpdateMouseData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) ImGuiIOPtr iO = ImGui.GetIO(); if (!(User32.GetForegroundWindow() == _windowHandle)) { return; } if (((ImGuiIOPtr)(ref iO)).WantSetMousePos) { User32.POINT lpPoint = new User32.POINT((int)((ImGuiIOPtr)(ref iO)).MousePos.x, (int)((ImGuiIOPtr)(ref iO)).MousePos.y); if (User32.ClientToScreen(_windowHandle, ref lpPoint)) { User32.SetCursorPos(lpPoint.X, lpPoint.Y); } } if (!((ImGuiIOPtr)(ref iO)).WantSetMousePos && _mouseTrackedArea == 0 && User32.GetCursorPos(out var point) && User32.ScreenToClient(_windowHandle, ref point)) { ((ImGuiIOPtr)(ref iO)).AddMousePosEvent((float)point.X, (float)point.Y); } } private static void ImGui_ImplWin32_UpdateGamepads() { } public unsafe static void NewFrame() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) ImGuiIOPtr iO = ImGui.GetIO(); User32.GetClientRect(_windowHandle, out var lpRect); Unsafe.Write(&((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).DisplaySize, new Vector2((float)(lpRect.Right - lpRect.Left), (float)(lpRect.Bottom - lpRect.Top))); Kernel32.QueryPerformanceCounter(out var lpPerformanceCount); ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).DeltaTime = (float)(lpPerformanceCount - _time) / (float)_ticksPerSecond; _time = lpPerformanceCount; ImGui_ImplWin32_UpdateMouseData(); ImGui_ImplWin32_ProcessKeyEventsWorkarounds(); ImGuiMouseCursor val = (ImGuiMouseCursor)(((ImGuiIOPtr)(ref iO)).MouseDrawCursor ? (-1) : ((int)ImGui.GetMouseCursor())); if (_lastMouseCursor != val) { _lastMouseCursor = val; ImGui_ImplWin32_UpdateMouseCursor(); } ImGui_ImplWin32_UpdateGamepads(); } public static ImGuiKey ImGui_ImplWin32_VirtualKeyToImGuiKey(VirtualKey wParam) { return (ImGuiKey)(wParam switch { VirtualKey.Tab => 512, VirtualKey.Left => 513, VirtualKey.Right => 514, VirtualKey.Up => 515, VirtualKey.Down => 516, VirtualKey.Prior => 517, VirtualKey.Next => 518, VirtualKey.Home => 519, VirtualKey.End => 520, VirtualKey.Insert => 521, VirtualKey.Delete => 522, VirtualKey.Back => 523, VirtualKey.Space => 524, VirtualKey.Return => 525, VirtualKey.Escape => 526, VirtualKey.OEM7 => 596, VirtualKey.OEMComma => 597, VirtualKey.OEMMinus => 598, VirtualKey.OEMPeriod => 599, VirtualKey.OEM2 => 600, VirtualKey.OEM1 => 601, VirtualKey.OEMPlus => 602, VirtualKey.OEM4 => 603, VirtualKey.OEM5 => 604, VirtualKey.OEM6 => 605, VirtualKey.OEM3 => 606, VirtualKey.CapsLock => 607, VirtualKey.ScrollLock => 608, VirtualKey.NumLock => 609, VirtualKey.Snapshot => 610, VirtualKey.Pause => 611, VirtualKey.Numpad0 => 612, VirtualKey.Numpad1 => 613, VirtualKey.Numpad2 => 614, VirtualKey.Numpad3 => 615, VirtualKey.Numpad4 => 616, VirtualKey.Numpad5 => 617, VirtualKey.Numpad6 => 618, VirtualKey.Numpad7 => 619, VirtualKey.Numpad8 => 620, VirtualKey.Numpad9 => 621, VirtualKey.Decimal => 622, VirtualKey.Divide => 623, VirtualKey.Multiply => 624, VirtualKey.Subtract => 625, VirtualKey.Add => 626, (VirtualKey)269 => 627, VirtualKey.LeftShift => 528, VirtualKey.LeftControl => 527, VirtualKey.LeftMenu => 529, VirtualKey.LeftWindows => 530, VirtualKey.RightShift => 532, VirtualKey.RightControl => 531, VirtualKey.RightMenu => 533, VirtualKey.RightWindows => 534, VirtualKey.Application => 535, VirtualKey.N0 => 536, VirtualKey.N1 => 537, VirtualKey.N2 => 538, VirtualKey.N3 => 539, VirtualKey.N4 => 540, VirtualKey.N5 => 541, VirtualKey.N6 => 542, VirtualKey.N7 => 543, VirtualKey.N8 => 544, VirtualKey.N9 => 545, VirtualKey.A => 546, VirtualKey.B => 547, VirtualKey.C => 548, VirtualKey.D => 549, VirtualKey.E => 550, VirtualKey.F => 551, VirtualKey.G => 552, VirtualKey.H => 553, VirtualKey.I => 554, VirtualKey.J => 555, VirtualKey.K => 556, VirtualKey.L => 557, VirtualKey.M => 558, VirtualKey.N => 559, VirtualKey.O => 560, VirtualKey.P => 561, VirtualKey.Q => 562, VirtualKey.R => 563, VirtualKey.S => 564, VirtualKey.T => 565, VirtualKey.U => 566, VirtualKey.V => 567, VirtualKey.W => 568, VirtualKey.X => 569, VirtualKey.Y => 570, VirtualKey.Z => 571, VirtualKey.F1 => 572, VirtualKey.F2 => 573, VirtualKey.F3 => 574, VirtualKey.F4 => 575, VirtualKey.F5 => 576, VirtualKey.F6 => 577, VirtualKey.F7 => 578, VirtualKey.F8 => 579, VirtualKey.F9 => 580, VirtualKey.F10 => 581, VirtualKey.F11 => 582, VirtualKey.F12 => 583, _ => 0, }); } private static ImGuiMouseSource GetMouseSourceFromMessageExtraInfo() { uint num = (uint)(int)User32.GetMessageExtraInfo(); if ((num & 0xFFFFFF80u) != 4283520768u) { if ((num & 0xFFFFFF80u) != 4283520896u) { return (ImGuiMouseSource)0; } return (ImGuiMouseSource)1; } return (ImGuiMouseSource)2; } public static int GET_X_LPARAM(IntPtr lp) { return (short)(long)lp; } public static int GET_Y_LPARAM(IntPtr lp) { return (short)((long)lp >> 16); } public static ushort HIWORD(IntPtr dwValue) { return (ushort)((long)dwValue >> 16); } public static ushort HIWORD(UIntPtr dwValue) { return (ushort)((ulong)dwValue >> 16); } public static ushort LOWORD(IntPtr dwValue) { return (ushort)(long)dwValue; } public static ushort LOWORD(UIntPtr dwValue) { return (ushort)(ulong)dwValue; } public static ushort GET_XBUTTON_WPARAM(UIntPtr val) { return HIWORD(val); } public static ushort GET_XBUTTON_WPARAM(IntPtr val) { return HIWORD(val); } internal static int GET_WHEEL_DELTA_WPARAM(IntPtr wParam) { return (short)HIWORD(wParam); } internal static int GET_WHEEL_DELTA_WPARAM(UIntPtr wParam) { return (short)HIWORD(wParam); } public static byte LOBYTE(ushort wValue) { return (byte)(wValue & 0xFFu); } public unsafe static IntPtr WndProcHandler(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) if (ImGui.GetCurrentContext() == IntPtr.Zero) { return IntPtr.Zero; } ImGuiIOPtr iO = ImGui.GetIO(); int num; int num6; int num2; bool flag; switch (msg) { case WindowMessage.WM_NCMOUSEMOVE: case WindowMessage.WM_MOUSEFIRST: { ImGuiMouseSource mouseSourceFromMessageExtraInfo3 = GetMouseSourceFromMessageExtraInfo(); int num5 = ((msg == WindowMessage.WM_MOUSEFIRST) ? 1 : 2); _mouseHandle = hwnd; if (_mouseTrackedArea != num5) { User32.TRACKMOUSEEVENT lpEventTrack = new User32.TRACKMOUSEEVENT(User32.TMEFlags.TME_CANCEL, hwnd, 0u); User32.TRACKMOUSEEVENT lpEventTrack2 = new User32.TRACKMOUSEEVENT((num5 == 2) ? (User32.TMEFlags.TME_LEAVE | User32.TMEFlags.TME_NONCLIENT) : User32.TMEFlags.TME_LEAVE, hwnd, 0u); if (_mouseTrackedArea != 0) { User32.TrackMouseEvent(ref lpEventTrack); } User32.TrackMouseEvent(ref lpEventTrack2); _mouseTrackedArea = num5; } User32.POINT lpPoint = new User32.POINT(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); if (msg != WindowMessage.WM_NCMOUSEMOVE || User32.ScreenToClient(hwnd, ref lpPoint)) { ((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent(mouseSourceFromMessageExtraInfo3); ((ImGuiIOPtr)(ref iO)).AddMousePosEvent((float)lpPoint.X, (float)lpPoint.Y); } break; } case WindowMessage.WM_NCMOUSELEAVE: num = 2; goto IL_01a4; case WindowMessage.WM_MOUSELEAVE: num = 1; goto IL_01a4; case WindowMessage.WM_LBUTTONDOWN: case WindowMessage.WM_LBUTTONDBLCLK: case WindowMessage.WM_RBUTTONDOWN: case WindowMessage.WM_RBUTTONDBLCLK: case WindowMessage.WM_MBUTTONDOWN: case WindowMessage.WM_MBUTTONDBLCLK: case WindowMessage.WM_XBUTTONDOWN: case WindowMessage.WM_XBUTTONDBLCLK: { ImGuiMouseSource mouseSourceFromMessageExtraInfo = GetMouseSourceFromMessageExtraInfo(); int num3 = 0; if (msg == WindowMessage.WM_LBUTTONDOWN || msg == WindowMessage.WM_LBUTTONDBLCLK) { num3 = 0; } if (msg == WindowMessage.WM_RBUTTONDOWN || msg == WindowMessage.WM_RBUTTONDBLCLK) { num3 = 1; } if (msg == WindowMessage.WM_MBUTTONDOWN || msg == WindowMessage.WM_MBUTTONDBLCLK) { num3 = 2; } if (msg == WindowMessage.WM_XBUTTONDOWN || msg == WindowMessage.WM_XBUTTONDBLCLK) { num3 = ((GET_XBUTTON_WPARAM(wParam) == 1) ? 3 : 4); } if (_mouseButtonsDown == 0 && User32.GetCapture() == IntPtr.Zero) { User32.SetCapture(hwnd); } _mouseButtonsDown |= 1 << num3; ((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent(mouseSourceFromMessageExtraInfo); ((ImGuiIOPtr)(ref iO)).AddMouseButtonEvent(num3, true); return IntPtr.Zero; } case WindowMessage.WM_LBUTTONUP: case WindowMessage.WM_RBUTTONUP: case WindowMessage.WM_MBUTTONUP: case WindowMessage.WM_XBUTTONUP: { ImGuiMouseSource mouseSourceFromMessageExtraInfo2 = GetMouseSourceFromMessageExtraInfo(); int num4 = 0; if (msg == WindowMessage.WM_LBUTTONUP) { num4 = 0; } if (msg == WindowMessage.WM_RBUTTONUP) { num4 = 1; } if (msg == WindowMessage.WM_MBUTTONUP) { num4 = 2; } if (msg == WindowMessage.WM_XBUTTONUP) { num4 = ((GET_XBUTTON_WPARAM(wParam) == 1) ? 3 : 4); } _mouseButtonsDown &= ~(1 << num4); if (_mouseButtonsDown == 0 && User32.GetCapture() == hwnd) { User32.ReleaseCapture(); } ((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent(mouseSourceFromMessageExtraInfo2); ((ImGuiIOPtr)(ref iO)).AddMouseButtonEvent(num4, false); return IntPtr.Zero; } case WindowMessage.WM_MOUSEWHEEL: ((ImGuiIOPtr)(ref iO)).AddMouseWheelEvent(0f, (float)GET_WHEEL_DELTA_WPARAM(wParam) / 120f); return IntPtr.Zero; case WindowMessage.WM_MOUSEHWHEEL: ((ImGuiIOPtr)(ref iO)).AddMouseWheelEvent((0f - (float)GET_WHEEL_DELTA_WPARAM(wParam)) / 120f, 0f); return IntPtr.Zero; case WindowMessage.WM_KEYUP: case WindowMessage.WM_SYSKEYDOWN: case WindowMessage.WM_SYSKEYUP: num6 = ((msg == WindowMessage.WM_SYSKEYDOWN) ? 1 : 0); goto IL_036b; case WindowMessage.WM_KEYFIRST: num6 = 1; goto IL_036b; case WindowMessage.WM_SETFOCUS: case WindowMessage.WM_KILLFOCUS: ((ImGuiIOPtr)(ref iO)).AddFocusEvent(msg == WindowMessage.WM_SETFOCUS); return IntPtr.Zero; case WindowMessage.WM_CHAR: if (User32.IsWindowUnicode(hwnd)) { if ((int)wParam > 0 && (int)wParam < 65536) { ((ImGuiIOPtr)(ref iO)).AddInputCharacterUTF16((ushort)(int)wParam); } } else { byte[] lpMultiByteStr = new byte[1] { *(byte*)(&wParam) }; IntPtr intPtr = Marshal.AllocHGlobal(1); Kernel32.MultiByteToWideChar(0u, 1u, lpMultiByteStr, 1, intPtr, 1); char c = *(char*)(void*)intPtr; ((ImGuiIOPtr)(ref iO)).AddInputCharacter((uint)c); Marshal.FreeHGlobal(intPtr); } return IntPtr.Zero; case WindowMessage.WM_SETCURSOR: if (LOWORD(lParam) == 1 && ImGui_ImplWin32_UpdateMouseCursor()) { return new IntPtr(1); } return IntPtr.Zero; case WindowMessage.WM_DEVICECHANGE: { return IntPtr.Zero; } IL_01a4: num2 = num; if (_mouseTrackedArea == num2) { if (_mouseHandle == hwnd) { _mouseHandle = IntPtr.Zero; } _mouseTrackedArea = 0; ((ImGuiIOPtr)(ref iO)).AddMousePosEvent(float.MinValue, float.MinValue); } break; IL_036b: flag = (byte)num6 != 0; if ((int)wParam < 256) { ImGui_ImplWin32_UpdateKeyModifiers(); VirtualKey virtualKey = (VirtualKey)(int)wParam; bool num7 = (ushort)(int)wParam == 13; bool flag2 = (HIWORD(lParam) & 0x100) != 0; if (num7 && flag2) { virtualKey = (VirtualKey)269; } ImGuiKey val = ImGui_ImplWin32_VirtualKeyToImGuiKey(virtualKey); int native_scancode = LOBYTE(HIWORD(lParam)); if ((int)val != 0) { ImGui_ImplWin32_AddKeyEvent(val, flag, virtualKey, native_scancode); } switch (virtualKey) { case VirtualKey.Shift: if (IsVkDown(VirtualKey.LeftShift) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)528, flag, VirtualKey.LeftShift, native_scancode); } if (IsVkDown(VirtualKey.RightShift) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)532, flag, VirtualKey.RightShift, native_scancode); } break; case VirtualKey.Control: if (IsVkDown(VirtualKey.LeftControl) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)527, flag, VirtualKey.LeftControl, native_scancode); } if (IsVkDown(VirtualKey.RightControl) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)531, flag, VirtualKey.RightControl, native_scancode); } break; case VirtualKey.Menu: if (IsVkDown(VirtualKey.LeftMenu) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)529, flag, VirtualKey.LeftMenu, native_scancode); } if (IsVkDown(VirtualKey.RightMenu) == flag) { ImGui_ImplWin32_AddKeyEvent((ImGuiKey)533, flag, VirtualKey.RightMenu, native_scancode); } break; } } return IntPtr.Zero; } return IntPtr.Zero; } private unsafe static bool _IsWindowsVersionOrGreater(short major, short minor, short unused) { OSVERSIONINFOEX oSVERSIONINFOEX = OSVERSIONINFOEX.Create(); ulong dwlConditionMask = 0uL; oSVERSIONINFOEX.dwMajorVersion = major; oSVERSIONINFOEX.dwMinorVersion = minor; Kernel32.VER_SET_CONDITION(ref dwlConditionMask, 2u, 3); Kernel32.VER_SET_CONDITION(ref dwlConditionMask, 1u, 3); return Ntdll.RtlVerifyVersionInfo(&oSVERSIONINFOEX, VER_MASK.VER_MAJORVERSION | VER_MASK.VER_MINORVERSION, (long)dwlConditionMask) == NtStatus.Success; } private static bool _IsWindowsVistaOrGreater() { return _IsWindowsVersionOrGreater((short)Kernel32.HiByte(1536), LOBYTE(1536), 0); } private static bool _IsWindows8OrGreater() { return _IsWindowsVersionOrGreater((short)Kernel32.HiByte(1538), LOBYTE(1538), 0); } private static bool _IsWindows8Point1OrGreater() { return _IsWindowsVersionOrGreater((short)Kernel32.HiByte(1539), LOBYTE(1539), 0); } private static bool _IsWindows10OrGreater() { return _IsWindowsVersionOrGreater((short)Kernel32.HiByte(2560), LOBYTE(2560), 0); } private static void ImGui_ImplWin32_EnableDpiAwareness() { if (_IsWindows10OrGreater()) { User32.SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); } else if (_IsWindows8Point1OrGreater()) { Shellscalingapi.SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE); } else { User32.SetProcessDPIAware(); } } public unsafe static float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor) { uint dpiX; if (_IsWindows8Point1OrGreater()) { Shellscalingapi.GetDpiForMonitor((IntPtr)monitor, MONITOR_DPI_TYPE.MDT_EFFECTIVE_DPI, out dpiX, out var _); return (float)dpiX / 96f; } IntPtr dC = User32.GetDC(IntPtr.Zero); dpiX = (uint)Gdi32.GetDeviceCaps(dC, 88); User32.ReleaseDC(IntPtr.Zero, dC); return (float)dpiX / 96f; } public unsafe static float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd) { return ImGui_ImplWin32_GetDpiScaleForMonitor((void*)User32.MonitorFromWindow((IntPtr)hwnd, 2u)); } public unsafe static void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd) { if (_IsWindowsVistaOrGreater() && Dwmapi.DwmIsCompositionEnabled(out var enabled) == 0 && enabled) { uint ColorizationColor; bool ColorizationOpaqueBlend; int num = Dwmapi.DwmGetColorizationColor(out ColorizationColor, out ColorizationOpaqueBlend); if (_IsWindows8OrGreater() || (num == 0 && !ColorizationOpaqueBlend)) { IntPtr intPtr = Gdi32.CreateRectRgn(0, 0, -1, -1); Dwmapi.DWM_BLURBEHIND blurBehind = new Dwmapi.DWM_BLURBEHIND(enabled: true); blurBehind.dwFlags |= Dwmapi.DWM_BB.BlurRegion; blurBehind.hRgnBlur = intPtr; Dwmapi.DwmEnableBlurBehindWindow((IntPtr)hwnd, ref blurBehind); Gdi32.DeleteObject(intPtr); } else { Dwmapi.DWM_BLURBEHIND blurBehind2 = new Dwmapi.DWM_BLURBEHIND(enabled: true); Dwmapi.DwmEnableBlurBehindWindow((IntPtr)hwnd, ref blurBehind2); } } } internal unsafe static void Init(IntPtr windowHandle) { ImGui_ImplWin32_Init((void*)windowHandle); } } internal interface ILog { internal void Debug(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); internal void Error(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); internal void Fatal(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); internal void Info(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); internal void Message(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); internal void Warning(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0); } internal static class Log { private static ILog _log; internal static void Init(ILog log) { _log = log; } internal static void Debug(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Debug(data, file, member, line); } internal static void Error(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Error(data, file, member, line); } internal static void Fatal(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Fatal(data, file, member, line); } internal static void Info(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Info(data, file, member, line); } internal static void Message(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Message(data, file, member, line); } internal static void Warning(object data, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { _log.Warning(data, file, member, line); } } public class Overlay { private Device _device; private DeviceContext _deviceContext; private SwapChain _swapChain; private RenderTargetView _mainRenderTargetView; internal const VirtualKey OverlayToggleDefault = VirtualKey.Insert; private const string IniFileName = "iDeathHD.OverlayDearImGui_imgui.ini"; private static RECT _gameRect; private static uint _resizeWidth; private static uint _resizeHeight; private static DisposableList<ClonedDrawData> _nextFrameDrawData; private static DisposableList<ClonedDrawData> _currentRenderDrawData; private static readonly object _drawDataLock = new object(); public static IConfigEntry<VirtualKey> OverlayToggle { get; internal set; } public static string AssetsFolderPath { get; private set; } = ""; public static string ImGuiIniConfigPath { get; private set; } public static bool IsOpen { get; private set; } public static RECT GameRect { get { return _gameRect; } private set { _gameRect = value; } } public static IntPtr GameHwnd { get; private set; } public static event Action OnRender; internal void CreateRenderTarget() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Texture2D backBuffer = _swapChain.GetBackBuffer<Texture2D>(0); try { _mainRenderTargetView = new RenderTargetView(_device, (Resource)(object)backBuffer); } finally { ((IDisposable)backBuffer)?.Dispose(); } } public void CleanupRenderTarget() { if (_mainRenderTargetView != null) { ((DisposeBase)_mainRenderTargetView).Dispose(); _mainRenderTargetView = null; } } public void CleanupDeviceD3D() { CleanupRenderTarget(); if (_swapChain != null) { ((DisposeBase)_swapChain).Dispose(); _swapChain = null; } if (_deviceContext != null) { ((DisposeBase)_deviceContext).Dispose(); _deviceContext = null; } if (_device != null) { ((DisposeBase)_device).Dispose(); _device = null; } } public bool CreateDeviceD3D(IntPtr hWnd) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) SwapChainDescription val = default(SwapChainDescription); val.BufferCount = 2; val.ModeDescription = new ModeDescription { Width = 0, Height = 0, Format = (Format)28, RefreshRate = new Rational(60, 1) }; val.Usage = (Usage)32; val.OutputHandle = hWnd; val.SampleDescription = new SampleDescription(1, 0); val.IsWindowed = RawBool.op_Implicit(true); val.SwapEffect = (SwapEffect)0; val.Flags = (SwapChainFlags)2; SwapChainDescription val2 = val; FeatureLevel[] array = (FeatureLevel[])(object)new FeatureLevel[2] { (FeatureLevel)45056, (FeatureLevel)40960 }; try { Device.CreateWithSwapChain((DriverType)1, (DeviceCreationFlags)0, array, val2, ref _device, ref _swapChain); } catch (Exception data) { Log.Error(data, "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/Overlay.cs", "CreateDeviceD3D", 146); try { Device.CreateWithSwapChain((DriverType)5, (DeviceCreationFlags)0, array, val2, ref _device, ref _swapChain); } catch (Exception data2) { Log.Error(data2, "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/Overlay.cs", "CreateDeviceD3D", 161); return false; } } _deviceContext = _device.ImmediateContext; CreateRenderTarget(); return true; } private unsafe static void CloneRenderData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) ImGuiPlatformIOPtr platformIO = ImGui.GetPlatformIO(); DisposableList<ClonedDrawData> disposableList = new DisposableList<ClonedDrawData>(((ImGuiPlatformIOPtr)(ref platformIO)).Viewports.Size); for (int i = 0; i < ((ImGuiPlatformIOPtr)(ref platformIO)).Viewports.Size; i++) { ImGuiViewportPtr val = ((ImGuiPlatformIOPtr)(ref platformIO)).Viewports[i]; if (!((Enum)((ImGuiViewportPtr)(ref val)).Flags).HasFlag((Enum)(object)(ImGuiViewportFlags)4096)) { disposableList.Add(new ClonedDrawData(new ImDrawDataPtr(ImDrawDataPtr.op_Implicit(((ImGuiViewportPtr)(ref val)).DrawData)))); } } lock (_drawDataLock) { _nextFrameDrawData?.Dispose(); _nextFrameDrawData = disposableList; } } internal static void UpdateOverlayDrawData() { ImGui.GetCurrentContext(); ImGuiDX11Impl.NewFrame(); ImGuiWin32Impl.NewFrame(); ImGui.NewFrame(); if (IsOpen && Overlay.OnRender != null) { Delegate[] invocationList = Overlay.OnRender.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { Action action = (Action)invocationList[i]; try { action(); } catch (Exception data) { Log.Error(data, "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/Overlay.cs", "UpdateOverlayDrawData", 216); } } } ImGui.Render(); CloneRenderData(); } public unsafe void Render(string windowName, string windowClass, string assetsFolderPath, string imguiIniConfigFolderPath, IConfigEntry<VirtualKey> overlayToggleKeybind) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) ImGuiIniConfigPath = Path.Combine(imguiIniConfigFolderPath, "iDeathHD.OverlayDearImGui_imgui.ini"); AssetsFolderPath = assetsFolderPath ?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Assets"); OverlayToggle = overlayToggleKeybind; GameHwnd = User32.FindWindowW(windowClass, windowName); User32.GetWindowRect(GameHwnd, out _gameRect); (IntPtr hwnd, WNDCLASSEXW wc) tuple = WindowFactory.CreateClassicWindow("OverlayDearImGui"); IntPtr item = tuple.hwnd; WNDCLASSEXW item2 = tuple.wc; MARGINS mARGINS = default(MARGINS); mARGINS.cxLeftWidth = -1; MARGINS margins = mARGINS; Dwmapi.DwmExtendFrameIntoClientArea(item, ref margins); if (!CreateDeviceD3D(item)) { CleanupDeviceD3D(); User32.UnregisterClass(item2.lpszClassName, item2.hInstance); Log.Error("Failed CreateDeviceD3D", "/home/runner/work/OverlayDearImGui/OverlayDearImGui/OverlayDearImGui.Shared/Overlay.cs", "Render", 246); return; } User32.ShowWindow(item, User32.ShowWindowCommand.ShowDefault); User32.UpdateWindow(item); ImGui.CreateContext(); ImGuiIOPtr iO = ImGui.GetIO(); ref ImGuiConfigFlags configFlags = ref ((ImGuiIOPtr)(ref iO)).ConfigFlags; configFlags = (ImGuiConfigFlags)((uint)configFlags | 3u); ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).IniFilename = (byte*)(void*)Marshal.StringToHGlobalAnsi(ImGuiIniConfigPath); ImGui.StyleColorsDark(); string text = Path.Combine(AssetsFolderPath, "Fonts", "Bombardier-Regular.ttf"); ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts; ImFontPtr val = ((ImFontAtlasPtr)(ref fonts)).AddFontFromFileTTF(text, 16f); ((ImGuiIO)((ImGuiIOPtr)(ref iO)).NativePtr).FontDefault = ImFontPtr.op_Implicit(val); ImGuiWin32Impl.Init(item); ImGuiDX11Impl.Init((void*)((CppObject)_device).NativePointer, (void*)((CppObject)_deviceContext).NativePointer); bool flag = false; ToggleOverlay(item); RawVector4 val2 = default(RawVector4); ((RawVector4)(ref val2))..ctor(0f, 0f, 0f, 0f); bool flag2 = false; while (!flag2) { User32.MSG lpMsg; while (User32.PeekMessage(out lpMsg, item, 0u, 0u, 1u)) { User32.TranslateMessage(ref lpMsg); User32.DispatchMessage(ref lpMsg); if (lpMsg.message == WindowMessage.WM_QUIT) { flag2 = true; break; } } bool num = (User32.GetAsyncKeyState(OverlayToggle.Get()) & 0x8000) != 0; if (num && !flag) { ToggleOverlay(item); } flag = num; if (_resizeWidth != 0 && _resizeHeight != 0) { CleanupRenderTarget(); _swapChain.ResizeBuffers(0, (int)_resizeWidth, (int)_resizeHeight, (Format)0, (SwapChainFlags)0); _resizeWidth = (_resizeHeight = 0u); CreateRenderTarget(); } IntPtr foregroundWindow = User32.GetForegroundWindow(); if (!(foregroundWindow == item) && !(foregroundWindow == GameHwnd)) { Kernel32.Sleep(16u); } bool flag3 = User32.IsWindowVisible(GameHwnd); User32.ShowWindow(item, flag3 ? User32.ShowWindowCommand.Show : User32.ShowWindowCommand.Hide); if (!flag3) { Kernel32.Sleep(16u); } User32.GetWindowRect(GameHwnd, out var lpRect); if (lpRect.Left != GameRect.Left || lpRect.Bottom != GameRect.Bottom || lpRect.Top != GameRect.Top || lpRect.Right != GameRect.Right) { GameRect = lpRect; User32.SetWindowPos(item, (IntPtr)(-2), GameRect.X, GameRect.Y, GameRect.Width, GameRect.Height, 8u); } User32.SetWindowDisplayAffinity(item, User32.DisplayAffinity.None); _deviceContext.OutputMerger.SetRenderTargets(_mainRenderTargetView); _deviceContext.ClearRenderTargetView(_mainRenderTargetView, new RawColor4(val2.X, val2.Y, val2.Z, val2.W)); DisposableList<ClonedDrawData> disposableList = null; lock (_drawDataLock) { if (_nextFrameDrawData != null) { _currentRenderDrawData?.Dispose(); _currentRenderDrawData = _nextFrameDrawData; _nextFrameDrawData = null; } disposableList = _currentRenderDrawData; } if (disposableList != null && disposableList.Count > 0) { ImGuiDX11Impl.RenderDrawData(disposableList[0].Data); } _swapChain.Present(1, (PresentFlags)0); } ImGuiDX11Impl.Shutdown(); ImGuiWin32Impl.Shutdown(); ImGui.DestroyContext(); CleanupDeviceD3D(); User32.DestroyWindow(item); User32.UnregisterClass(item2.lpszClassName, item2.hInstance); } private static void ToggleOverlay(IntPtr hwnd) { IsOpen = !IsOpen; if (IsOpen) { User32.ShowWindow(hwnd, User32.ShowWindowCommand.Restore); User32.ShowWindow(hwnd, User32.ShowWindowCommand.Show); User32.SetForegroundWindow(hwnd); } else { User32.ShowWindow(hwnd, User32.ShowWindowCommand.Hide); User32.ShowWindow(hwnd, User32.ShowWindowCommand.Minimize); User32.BringWindowToTop(GameHwnd); User32.SetForegroundWindow(GameHwnd); } } public static IntPtr WndProc(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam) { if (ImGuiWin32Impl.WndProcHandler(hWnd, msg, wParam, lParam) != IntPtr.Zero) { return new IntPtr(1); } return User32.DefWindowProc(hWnd, msg, wParam, lParam); } } } namespace OverlayDearImGui.Windows { public static class Dwmapi { public struct DWM_BLURBEHIND { public DWM_BB dwFlags; public bool fEnable; public IntPtr hRgnBlur; public bool fTransitionOnMaximized; public bool TransitionOnMaximized { get { return fTransitionOnMaximized; } set { fTransitionOnMaximized = value; dwFlags |= DWM_BB.TransitionMaximized; } } public DWM_BLURBEHIND(bool enabled) { fEnable = enabled; hRgnBlur = IntPtr.Zero; fTransitionOnMaximized = false; dwFlags = DWM_BB.Enable; } } [Flags] public enum DWM_BB { Enable = 1, BlurRegion = 2, TransitionMaximized = 4 } [DllImport("dwmapi.dll")] public static extern int DwmGetColorizationColor(out uint ColorizationColor, [MarshalAs(UnmanagedType.Bool)] out bool ColorizationOpaqueBlend); [DllImport("dwmapi.dll")] public static extern int DwmIsCompositionEnabled(out bool enabled); [DllImport("dwmapi.dll")] public static extern void DwmEnableBlurBehindWindow(IntPtr hwnd, ref DWM_BLURBEHIND blurBehind); [DllImport("dwmapi.dll")] public static extern int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins); } public static class Gdi32 { [DllImport("gdi32.dll")] public static extern int GetDeviceCaps(IntPtr hdc, int nIndex); [DllImport("gdi32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool DeleteObject([In] IntPtr hObject); [DllImport("gdi32.dll")] public static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); } public static class User32 { public enum GetWindowType : uint { GW_HWNDFIRST, GW_HWNDLAST, GW_HWNDNEXT, GW_HWNDPREV, GW_OWNER, GW_CHILD, GW_ENABLEDPOPUP } public struct MSG { public IntPtr hwnd; public WindowMessage message; public IntPtr wParam; public IntPtr lParam; public uint time; public POINT pt; } public struct POINT { public int X; public int Y; public POINT(int x, int y) { X = x; Y = y; } } public enum SystemMetric { SM_ARRANGE = 56, SM_CLEANBOOT = 67, SM_CMONITORS = 80, SM_CMOUSEBUTTONS = 43, SM_CXBORDER = 5, SM_CXCURSOR = 13, SM_CXDLGFRAME = 7, SM_CXDOUBLECLK = 36, SM_CXDRAG = 68, SM_CXEDGE = 45, SM_CXFIXEDFRAME = 7, SM_CXFOCUSBORDER = 83, SM_CXFRAME = 32, SM_CXFULLSCREEN = 16, SM_CXHSCROLL = 21, SM_CXHTHUMB = 10, SM_CXICON = 11, SM_CXICONSPACING = 38, SM_CXMAXIMIZED = 61, SM_CXMAXTRACK = 59, SM_CXMENUCHECK = 71, SM_CXMENUSIZE = 54, SM_CXMIN = 28, SM_CXMINIMIZED = 57, SM_CXMINSPACING = 47, SM_CXMINTRACK = 34, SM_CXPADDEDBORDER = 92, SM_CXSCREEN = 0, SM_CXSIZE = 30, SM_CXSIZEFRAME = 32, SM_CXSMICON = 49, SM_CXSMSIZE = 52, SM_CXVIRTUALSCREEN = 78, SM_CXVSCROLL = 2, SM_CYBORDER = 6, SM_CYCAPTION = 4, SM_CYCURSOR = 14, SM_CYDLGFRAME = 8, SM_CYDOUBLECLK = 37, SM_CYDRAG = 69, SM_CYEDGE = 46, SM_CYFIXEDFRAME = 8, SM_CYFOCUSBORDER = 84, SM_CYFRAME = 33, SM_CYFULLSCREEN = 17, SM_CYHSCROLL = 3, SM_CYICON = 12, SM_CYICONSPACING = 39, SM_CYKANJIWINDOW = 18, SM_CYMAXIMIZED = 62, SM_CYMAXTRACK = 60, SM_CYMENU = 15, SM_CYMENUCHECK = 72, SM_CYMENUSIZE = 55, SM_CYMIN = 29, SM_CYMINIMIZED = 58, SM_CYMINSPACING = 48, SM_CYMINTRACK = 35, SM_CYSCREEN = 1, SM_CYSIZE = 31, SM_CYSIZEFRAME = 33, SM_CYSMCAPTION = 51, SM_CYSMICON = 50, SM_CYSMSIZE = 53, SM_CYVIRTUALSCREEN = 79, SM_CYVSCROLL = 20, SM_CYVTHUMB = 9, SM_DBCSENABLED = 42, SM_DEBUG = 22, SM_DIGITIZER = 94, SM_IMMENABLED = 82, SM_MAXIMUMTOUCHES = 95, SM_MEDIACENTER = 87, SM_MENUDROPALIGNMENT = 40, SM_MIDEASTENABLED = 74, SM_MOUSEPRESENT = 19, SM_MOUSEHORIZONTALWHEELPRESENT = 91, SM_MOUSEWHEELPRESENT = 75, SM_NETWORK = 63, SM_PENWINDOWS = 41, SM_REMOTECONTROL = 8193, SM_REMOTESESSION = 4096, SM_SAMEDISPLAYFORMAT = 81, SM_SECURE = 44, SM_SERVERR2 = 89, SM_SHOWSOUNDS = 70, SM_SHUTTINGDOWN = 8192, SM_SLOWMACHINE = 73, SM_STARTER = 88, SM_SWAPBUTTON = 23, SM_TABLETPC = 86, SM_XVIRTUALSCREEN = 76, SM_YVIRTUALSCREEN = 77 } [Flags] public enum KeyFlag { KF_EXTENDED = 0x100, KF_DLGMODE = 0x800, KF_MENUMODE = 0x1000, KF_ALTDOWN = 0x2000, KF_REPEAT = 0x4000, KF_UP = 0x8000 } public enum ShowWindowCommand { Hide, ShowNormal, ShowMinimized, ShowMaximized, ShowNoActivate, Show, Minimize, ShowMinNoActive, ShowNA, Restore, ShowDefault, ForceMinimize } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct MonitorInfoEx { public int Size; public RectStruct Monitor; public RectStruct WorkArea; public uint Flags; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string DeviceName; public void Init() { Size = 104; DeviceName = string.Empty; } } public struct RectStruct { public int Left; public int Top; public int Right; public int Bottom; } [Flags] public enum TMEFlags : uint { TME_CANCEL = 0x80000000u, TME_HOVER = 1u, TME_LEAVE = 2u, TME_NONCLIENT = 0x10u, TME_QUERY = 0x40000000u } public struct TRACKMOUSEEVENT { public int cbSize; [MarshalAs(UnmanagedType.U4)] public TMEFlags dwFlags; public IntPtr hWnd; public uint dwHoverTime; public TRACKMOUSEEVENT(TMEFlags dwFlags, IntPtr hWnd, uint dwHoverTime) { cbSize = Marshal.SizeOf(typeof(TRACKMOUSEEVENT)); this.dwFlags = dwFlags; this.hWnd = hWnd; this.dwHoverTime = dwHoverTime; } } public enum DisplayAffinity : uint { None, Monitor } [Flags] public enum WindowStylesEx : uint { WS_EX_ACCEPTFILES = 0x10u, WS_EX_APPWINDOW = 0x40000u, WS_EX_CLIENTEDGE = 0x200u, WS_EX_COMPOSITED = 0x2000000u, WS_EX_CONTEXTHELP = 0x400u, WS_EX_CONTROLPARENT = 0x10000u, WS_EX_DLGMODALFRAME = 1u, WS_EX_LAYERED = 0x80000u, WS_EX_LAYOUTRTL = 0x400000u, WS_EX_LEFT = 0u, WS_EX_LEFTSCROLLBAR = 0x4000u, WS_EX_LTRREADING = 0u, WS_EX_MDICHILD = 0x40u, WS_EX_NOACTIVATE = 0x8000000u, WS_EX_NOINHERITLAYOUT = 0x100000u, WS_EX_NOPARENTNOTIFY = 4u, WS_EX_OVERLAPPEDWINDOW = 0x300u, WS_EX_PALETTEWINDOW = 0x188u, WS_EX_RIGHT = 0x1000u, WS_EX_RIGHTSCROLLBAR = 0u, WS_EX_RTLREADING = 0x2000u, WS_EX_STATICEDGE = 0x20000u, WS_EX_TOOLWINDOW = 0x80u, WS_EX_TOPMOST = 8u, WS_EX_TRANSPARENT = 0x20u, WS_EX_WINDOWEDGE = 0x100u } private const int CCHDEVICENAME = 32; public const uint SWP_NOREDRAW = 8u; public const int GWL_EXSTYLE = -20; public const uint PM_REMOVE = 1u; [DllImport("user32.dll")] public static extern IntPtr SetThreadDpiAwarenessContext(IntPtr dpiContext); [DllImport("user32.dll", SetLastError = true)] public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect); [DllImport("user32.dll")] public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags); [DllImport("user32.dll")] public static extern bool UnregisterClass(string lpClassName, IntPtr hInstance); [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool IsWindowVisible(IntPtr hWnd); [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool SetForegroundWindow(IntPtr hWnd); [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommand nCmdShow); [DllImport("user32.dll")] public static extern bool BringWindowToTop(IntPtr hWnd); [DllImport("user32.dll")] public static extern bool UpdateWindow(IntPtr hWnd); [DllImport("user32.dll")] public static extern IntPtr DefWindowProc(IntPtr hWnd, WindowMessage uMsg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] public static extern void PostQuitMessage(int nExitCode); [DllImport("user32.dll")] public static extern IntPtr GetThreadDpiAwarenessContext(); [DllImport("user32.dll")] public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); [DllImport("User32.dll")] public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfoEx lpmi); [DllImport("user32.dll")] public static extern IntPtr GetDC(IntPtr hWnd); [DllImport("user32.dll")] public static extern int GetSystemMetrics(SystemMetric smIndex); [DllImport("user32.dll")] public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); [DllImport("user32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool IsWindowUnicode(IntPtr hWnd); [DllImport("user32.dll")] public static extern bool IsChild(IntPtr hWndParent, IntPtr hWnd); [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] public static extern ushort RegisterClassExW(ref WNDCLASSEXW lpwcx); [DllImport("user32.dll", SetLastError = true)] public static extern bool SetProcessDPIAware(); [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] public static extern IntPtr FindWindowW(string lpClassName, string lpWindowName); [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int MessageBox(IntPtr hWnd, string text, string caption, int options); [DllImport("user32.dll")] public static extern bool AdjustWindowRectEx(ref RECT lpRect, uint dwStyle, bool bMenu, uint dwExStyle); [DllImport("user32.dll")] public static extern short GetAsyncKeyState(VirtualKey vKey); public static IntPtr CreateWindowW([Optional][In] string lpClassName, [Optional][In] string lpWindowName, [In] uint dwStyle, [In] int X, [In] int Y, [In] int nWidth, [In] int nHeight, [Optional][In] IntPtr hWndParent, [Optional][In] IntPtr hMenu, [Optional][In] IntPtr hInstance, [Optional][In] IntPtr lpParam) { return CreateWindowExW(0u, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); } [DllImport("user32.dll")] public static extern int TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack); [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern IntPtr SetCapture(IntPtr hWnd); [DllImport("user32.dll")] public static extern IntPtr GetCapture(); [DllImport("user32.dll")] public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect); [DllImport("user32.dll")] public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); [DllImport("user32.dll")] public static extern IntPtr WindowFromPoint(POINT p); [DllImport("user32.dll")] public static extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint); [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] public static extern IntPtr CreateWindowExW(uint dwExStyle, [MarshalAs(UnmanagedType.LPWStr)] string lpClassName, [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName, uint dwStyle, int X, int Y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr GetWindow(IntPtr hWnd, GetWindowType uCmd); [DllImport("user32.dll", SetLastError = true)] public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); [DllImport("user32.dll")] public static extern bool SetWindowDisplayAffinity(IntPtr hwnd, DisplayAffinity affinity); [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool DestroyWindow(IntPtr hwnd); public static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { if (IntPtr.Size == 8) { return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); } return new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32())); } [DllImport("user32.dll", EntryPoint = "SetWindowLong")] private static extern int SetWindowLong32(HandleRef hWnd, int nIndex, int dwNewLong); [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")] private static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, int nIndex, IntPtr dwNewLong); [DllImport("USER32.dll")] public static extern short GetKeyState(VirtualKey nVirtKey); [DllImport("user32.dll")] public static extern IntPtr GetMessageExtraInfo(); [DllImport("user32.dll")] public static extern IntPtr DispatchMessage([In] ref MSG lpmsg); [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool PeekMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg); [DllImport("user32.dll")] public static extern bool TranslateMessage([In] ref MSG lpMsg); [DllImport("user32.dll")] public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName); [DllImport("user32.dll")] public static extern IntPtr SetCursor(IntPtr handle); [DllImport("user32.dll", EntryPoint = "GetWindowLong")] public static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex); [DllImport("user32.dll", EntryPoint = "GetWindowLongPtr")] public static extern IntPtr GetWindowL
plugins/OverlayDearImGui.Shared/SharpDX.DXGI.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using SharpDX.DXGI; using SharpDX.Direct3D; using SharpDX.Mathematics.Interop; using SharpDX.Win32; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("SharpDX.Direct3D10")] [assembly: InternalsVisibleTo("SharpDX.Direct3D11")] [assembly: InternalsVisibleTo("SharpDX.Direct2D1")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("4.2.1.34")] [assembly: AssemblyInformationalVersion("4.2.1-beta0+7abb72df54")] [assembly: AssemblyCompany("Alexandre Mutel")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) 2010-2016 Alexandre Mutel")] [assembly: AssemblyDescription("Assembly providing DirectX - DXGI managed API.")] [assembly: AssemblyProduct("SharpDX.DXGI")] [assembly: AssemblyTitle("SharpDX.DXGI")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/xiaoxiao921/SharpDX")] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.2.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { ModuleInit.Setup(); } } internal sealed class ThisAssembly { internal const string AssemblyVersion = "4.2.0.0"; internal const string AssemblyFileVersion = "4.2.1.34"; internal const string AssemblyInformationalVersion = "4.2.1-beta0+7abb72df54"; internal const string AssemblyName = "SharpDX.DXGI"; internal const string AssemblyTitle = "SharpDX.DXGI"; internal const string AssemblyConfiguration = "Release"; internal const string GitCommitId = "7abb72df544eaede656c546ee71a8ad1be9dd19b"; internal const string RootNamespace = "SharpDX.DXGI"; private ThisAssembly() { } } namespace SharpDX.DXGI; [Guid("2411e7e1-12ac-4ccf-bd14-9798e8534dc0")] public class Adapter : DXGIObject { public Output[] Outputs { get { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) List<Output> list = new List<Output>(); Output outputOut; while (!(GetOutput(list.Count, out outputOut) == ResultDescriptor.op_Implicit(ResultCode.NotFound)) && outputOut != null) { list.Add(outputOut); } return list.ToArray(); } } public AdapterDescription Description { get { GetDescription(out var descRef); return descRef; } } public bool IsInterfaceSupported(Type type) { long userModeVersion; return IsInterfaceSupported(type, out userModeVersion); } public bool IsInterfaceSupported<T>() where T : ComObject { long userModeVersion; return IsInterfaceSupported(typeof(T), out userModeVersion); } public bool IsInterfaceSupported<T>(out long userModeVersion) where T : ComObject { return IsInterfaceSupported(typeof(T), out userModeVersion); } public bool IsInterfaceSupported(Type type, out long userModeVersion) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Result val = CheckInterfaceSupport(Utilities.GetGuidFromType(type), out userModeVersion); return ((Result)(ref val)).Success; } public Output GetOutput(int outputIndex) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Output outputOut; Result output = GetOutput(outputIndex, out outputOut); ((Result)(ref output)).CheckError(); return outputOut; } public int GetOutputCount() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) int i; Output outputOut; for (i = 0; !(GetOutput(i, out outputOut) == ResultDescriptor.op_Implicit(ResultCode.NotFound)); i++) { if (outputOut == null) { break; } ((DisposeBase)outputOut).Dispose(); } return i; } public Adapter(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Adapter(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Adapter(nativePtr); } return null; } internal unsafe Result GetOutput(int output, out Output outputOut) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, output, &zero)); if (zero != IntPtr.Zero) { outputOut = new Output(zero); return result; } outputOut = null; return result; } internal unsafe void GetDescription(out AdapterDescription descRef) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) AdapterDescription.__Native @ref = default(AdapterDescription.__Native); descRef = default(AdapterDescription); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref)); descRef.__MarshalFrom(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe Result CheckInterfaceSupport(Guid interfaceName, out long uMDVersionRef) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) Result result; fixed (long* ptr = &uMDVersionRef) { void* ptr2 = ptr; result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &interfaceName, ptr2)); } return result; } } [CompilerGenerated] internal class AssemblyDoc { } public static class DebugId { public static readonly Guid All = new Guid("e48ae283-da80-490b-87e6-43e9a9cfda08"); public static readonly Guid App = new Guid("06cd6e01-4219-4ebd-8709-27ed23360c62"); public static readonly Guid Dx = new Guid("35cdd7fc-13b2-421d-a5d7-7e4451287d64"); public static readonly Guid Dxgi = new Guid("25cddaa4-b1c6-47e1-ac3e-98875b5a2e2a"); } internal static class DebugInterface { [UnmanagedFunctionPointer(CallingConvention.Winapi)] private delegate Result GetDebugInterface(ref Guid guid, out IntPtr result); private static readonly GetDebugInterface getDebugInterface; static DebugInterface() { getDebugInterface = null; } public static bool TryCreateComPtr<T>(out IntPtr comPtr) where T : class { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) comPtr = IntPtr.Zero; if (getDebugInterface == null) { return false; } Guid guid = typeof(T).GetTypeInfo().GUID; Result val = getDebugInterface(ref guid, out comPtr); if (((Result)(ref val)).Failure) { return false; } return comPtr != IntPtr.Zero; } } [Guid("54ec77fa-1377-44e6-8c32-88fd5f44c84c")] public class Device : DXGIObject { public Adapter Adapter { get { GetAdapter(out var adapterRef); return adapterRef; } } public int GPUThreadPriority { get { GetGPUThreadPriority(out var priorityRef); return priorityRef; } set { SetGPUThreadPriority(value); } } public Residency[] QueryResourceResidency(params ComObject[] comObjects) { int num = comObjects.Length; Residency[] array = new Residency[num]; QueryResourceResidency((IUnknown[])(object)comObjects, array, num); return array; } public Device(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Device(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Device(nativePtr); } return null; } internal unsafe void GetAdapter(out Adapter adapterRef) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &zero)); if (zero != IntPtr.Zero) { adapterRef = new Adapter(zero); } else { adapterRef = null; } ((Result)(ref val)).CheckError(); } internal unsafe void CreateSurface(ref SurfaceDescription descRef, int numSurfaces, int usage, SharedResource? sharedResourceRef, out Surface surfaceOut) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; SharedResource value = default(SharedResource); if (sharedResourceRef.HasValue) { value = sharedResourceRef.Value; } Result val; fixed (SurfaceDescription* ptr = &descRef) { void* ptr2 = ptr; void* nativePointer = ((CppObject)this)._nativePointer; SharedResource* intPtr = ((!sharedResourceRef.HasValue) ? null : (&value)); val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(nativePointer, ptr2, numSurfaces, usage, intPtr, &zero)); } if (zero != IntPtr.Zero) { surfaceOut = new Surface(zero); } else { surfaceOut = null; } ((Result)(ref val)).CheckError(); } internal unsafe void QueryResourceResidency(IUnknown[] resourcesOut, Residency[] residencyStatusRef, int numResources) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) IntPtr* ptr = null; if (resourcesOut != null) { ptr = stackalloc IntPtr[resourcesOut.Length]; } if (resourcesOut != null) { for (int i = 0; i < resourcesOut.Length; i++) { ptr[i] = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)resourcesOut[i]); } } Result val; fixed (Residency* ptr2 = residencyStatusRef) { void* ptr3 = ptr2; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr, ptr3, numResources)); } ((Result)(ref val)).CheckError(); } internal unsafe void SetGPUThreadPriority(int priority) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, priority)); ((Result)(ref val)).CheckError(); } internal unsafe void GetGPUThreadPriority(out int priorityRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &priorityRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2)); } ((Result)(ref val)).CheckError(); } } [Guid("3d3e0379-f9de-4d58-bb6c-18d62992f1a6")] public class DeviceChild : DXGIObject { public unsafe string DebugName { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) byte* ptr = stackalloc byte[1024]; int dataSizeRef = 1023; Result privateData = GetPrivateData(CommonGuid.DebugObjectName, ref dataSizeRef, new IntPtr(ptr)); if (((Result)(ref privateData)).Failure) { return string.Empty; } ptr[dataSizeRef] = 0; return Marshal.PtrToStringAnsi(new IntPtr(ptr)); } set { if (string.IsNullOrEmpty(value)) { SetPrivateData(CommonGuid.DebugObjectName, 0, IntPtr.Zero); return; } IntPtr dataRef = Utilities.StringToHGlobalAnsi(value); SetPrivateData(CommonGuid.DebugObjectName, value.Length, dataRef); } } public T GetDevice<T>() where T : ComObject { GetDevice(Utilities.GetGuidFromType(typeof(T)), out var deviceOut); return CppObject.FromPointer<T>(deviceOut); } public DeviceChild(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DeviceChild(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DeviceChild(nativePtr); } return null; } public unsafe void GetDevice(Guid riid, out IntPtr deviceOut) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &deviceOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &riid, ptr2)); } ((Result)(ref val)).CheckError(); } } [Guid("119E7452-DE9E-40fe-8806-88F90C12B441")] public class DXGIDebug : ComObject { public static DXGIDebug TryCreate() { if (!DebugInterface.TryCreateComPtr<DXGIDebug>(out var comPtr)) { return null; } return new DXGIDebug(comPtr); } public DXGIDebug(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DXGIDebug(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DXGIDebug(nativePtr); } return null; } public unsafe void ReportLiveObjects(Guid apiid, DebugRloFlags flags) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)3 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, apiid, (int)flags)); ((Result)(ref val)).CheckError(); } } [Guid("c5a05f0c-16f2-4adf-9f4d-a8c4d58ac550")] public class DXGIDebug1 : DXGIDebug { public RawBool IsLeakTrackingEnabledForThread => IsLeakTrackingEnabledForThread_(); public new static DXGIDebug1 TryCreate() { if (!DebugInterface.TryCreateComPtr<DXGIDebug1>(out var comPtr)) { return null; } return new DXGIDebug1(comPtr); } public DXGIDebug1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DXGIDebug1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DXGIDebug1(nativePtr); } return null; } public unsafe void EnableLeakTrackingForThread() { ((delegate* unmanaged[Stdcall]<void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)4 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } public unsafe void DisableLeakTrackingForThread() { ((delegate* unmanaged[Stdcall]<void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)5 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } internal unsafe RawBool IsLeakTrackingEnabledForThread_() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)6 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } } [Guid("aec22fb8-76f3-4639-9be0-28eb43a67a2e")] public class DXGIObject : ComObject { public T GetParent<T>() where T : ComObject { GetParent(Utilities.GetGuidFromType(typeof(T)), out var parentOut); return CppObject.FromPointer<T>(parentOut); } public DXGIObject(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator DXGIObject(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new DXGIObject(nativePtr); } return null; } public unsafe void SetPrivateData(Guid name, int dataSize, IntPtr dataRef) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)3 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &name, dataSize, (void*)dataRef)); ((Result)(ref val)).CheckError(); } public unsafe void SetPrivateDataInterface(Guid name, IUnknown unknownRef) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)unknownRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)4 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &name, (void*)zero)); ((Result)(ref val)).CheckError(); } public unsafe Result GetPrivateData(Guid name, ref int dataSizeRef, IntPtr dataRef) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) Result result; fixed (int* ptr = &dataSizeRef) { void* ptr2 = ptr; result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)5 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &name, ptr2, (void*)dataRef)); } return result; } public unsafe void GetParent(Guid riid, out IntPtr parentOut) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &parentOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)6 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &riid, ptr2)); } ((Result)(ref val)).CheckError(); } } [Guid("7b7166ec-21c7-44ae-b21a-c9ae321ae369")] public class Factory : DXGIObject { public Adapter[] Adapters { get { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) List<Adapter> list = new List<Adapter>(); Adapter adapterOut; while (!(GetAdapter(list.Count, out adapterOut) == ResultDescriptor.op_Implicit(ResultCode.NotFound))) { list.Add(adapterOut); } return list.ToArray(); } } public Adapter GetAdapter(int index) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Adapter adapterOut; Result adapter = GetAdapter(index, out adapterOut); ((Result)(ref adapter)).CheckError(); return adapterOut; } public int GetAdapterCount() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) int num = 0; while (true) { Adapter adapterOut; Result adapter = GetAdapter(num, out adapterOut); if (adapterOut != null) { ((DisposeBase)adapterOut).Dispose(); } if (adapter == ResultDescriptor.op_Implicit(ResultCode.NotFound)) { break; } num++; } return num; } public Factory(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Factory(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Factory(nativePtr); } return null; } internal unsafe Result GetAdapter(int adapter, out Adapter adapterOut) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, adapter, &zero)); if (zero != IntPtr.Zero) { adapterOut = new Adapter(zero); return result; } adapterOut = null; return result; } public unsafe void MakeWindowAssociation(IntPtr windowHandle, WindowAssociationFlags flags) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)windowHandle, (int)flags)); ((Result)(ref val)).CheckError(); } public unsafe IntPtr GetWindowAssociation() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) IntPtr result = default(IntPtr); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &result)); ((Result)(ref val)).CheckError(); return result; } internal unsafe void CreateSwapChain(IUnknown deviceRef, ref SwapChainDescription descRef, SwapChain swapChainOut) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); Result val; fixed (SwapChainDescription* ptr = &descRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, ptr2, &zero2)); } ((CppObject)swapChainOut).NativePointer = zero2; ((Result)(ref val)).CheckError(); } public unsafe Adapter CreateSoftwareAdapter(IntPtr module) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)module, &zero)); Adapter result = ((!(zero != IntPtr.Zero)) ? null : new Adapter(zero)); ((Result)(ref val)).CheckError(); return result; } } [Guid("770aae78-f26f-4dba-a829-253c83d1b387")] public class Factory1 : Factory { public Adapter1[] Adapters1 { get { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) List<Adapter1> list = new List<Adapter1>(); Adapter1 adapterOut; while (!(GetAdapter1(list.Count, out adapterOut) == ResultDescriptor.op_Implicit(ResultCode.NotFound))) { list.Add(adapterOut); } return list.ToArray(); } } public RawBool IsCurrent => IsCurrent_(); public Factory1() : base(IntPtr.Zero) { DXGI.CreateDXGIFactory1(Utilities.GetGuidFromType(((object)this).GetType()), out var factoryOut); ((CppObject)this).NativePointer = factoryOut; } public Adapter1 GetAdapter1(int index) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Adapter1 adapterOut; Result adapter = GetAdapter1(index, out adapterOut); ((Result)(ref adapter)).CheckError(); return adapterOut; } public int GetAdapterCount1() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) int num = 0; while (true) { Adapter1 adapterOut; Result adapter = GetAdapter1(num, out adapterOut); if (adapterOut != null) { ((DisposeBase)adapterOut).Dispose(); } if (adapter == ResultDescriptor.op_Implicit(ResultCode.NotFound)) { break; } num++; } return num; } public Factory1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Factory1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Factory1(nativePtr); } return null; } internal unsafe Result GetAdapter1(int adapter, out Adapter1 adapterOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, adapter, &zero)); if (zero != IntPtr.Zero) { adapterOut = new Adapter1(zero); return result; } adapterOut = null; return result; } internal unsafe RawBool IsCurrent_() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } } [Guid("50c83a1c-e072-4c48-87b0-3630fa36a6d0")] public class Factory2 : Factory1 { public RawBool IsWindowedStereoEnabled => IsWindowedStereoEnabled_(); public Factory2(bool debug = false) : this(IntPtr.Zero) { DXGI.CreateDXGIFactory2(debug ? 1 : 0, Utilities.GetGuidFromType(((object)this).GetType()), out var factoryOut); ((CppObject)this).NativePointer = factoryOut; } public Factory2(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Factory2(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Factory2(nativePtr); } return null; } internal unsafe RawBool IsWindowedStereoEnabled_() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)14 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } internal unsafe void CreateSwapChainForHwnd(IUnknown deviceRef, IntPtr hWnd, ref SwapChainDescription1 descRef, SwapChainFullScreenDescription? fullscreenDescRef, Output restrictToOutputRef, SwapChain1 swapChainOut) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; IntPtr zero3 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); SwapChainFullScreenDescription value = default(SwapChainFullScreenDescription); if (fullscreenDescRef.HasValue) { value = fullscreenDescRef.Value; } zero2 = CppObject.ToCallbackPtr<Output>((ICallbackable)(object)restrictToOutputRef); Result val; fixed (SwapChainDescription1* ptr = &descRef) { void* ptr2 = ptr; void* nativePointer = ((CppObject)this)._nativePointer; void* intPtr = (void*)zero; void* intPtr2 = (void*)hWnd; SwapChainFullScreenDescription* intPtr3 = ((!fullscreenDescRef.HasValue) ? null : (&value)); val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)15 * (nint)sizeof(void*))))(nativePointer, intPtr, intPtr2, ptr2, intPtr3, (void*)zero2, &zero3)); } ((CppObject)swapChainOut).NativePointer = zero3; ((Result)(ref val)).CheckError(); } internal unsafe void CreateSwapChainForCoreWindow(IUnknown deviceRef, IUnknown windowRef, ref SwapChainDescription1 descRef, Output restrictToOutputRef, SwapChain1 swapChainOut) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; IntPtr zero3 = IntPtr.Zero; IntPtr zero4 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); zero2 = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)windowRef); zero3 = CppObject.ToCallbackPtr<Output>((ICallbackable)(object)restrictToOutputRef); Result val; fixed (SwapChainDescription1* ptr = &descRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)16 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, (void*)zero2, ptr2, (void*)zero3, &zero4)); } ((CppObject)swapChainOut).NativePointer = zero4; ((Result)(ref val)).CheckError(); } public unsafe void GetSharedResourceAdapterLuid(IntPtr hResource, out long luidRef) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (long* ptr = &luidRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)17 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)hResource, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void RegisterStereoStatusWindow(IntPtr windowHandle, int wMsg, out int dwCookieRef) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &dwCookieRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)18 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)windowHandle, wMsg, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void RegisterStereoStatusEvent(IntPtr hEvent, out int dwCookieRef) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &dwCookieRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)19 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)hEvent, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void UnregisterStereoStatus(int dwCookie) { ((delegate* unmanaged[Stdcall]<void*, int, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)20 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, dwCookie); } public unsafe void RegisterOcclusionStatusWindow(IntPtr windowHandle, int wMsg, out int dwCookieRef) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &dwCookieRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)21 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)windowHandle, wMsg, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void RegisterOcclusionStatusEvent(IntPtr hEvent, out int dwCookieRef) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &dwCookieRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)22 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)hEvent, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void UnregisterOcclusionStatus(int dwCookie) { ((delegate* unmanaged[Stdcall]<void*, int, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)23 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, dwCookie); } internal unsafe void CreateSwapChainForComposition(IUnknown deviceRef, ref SwapChainDescription1 descRef, Output restrictToOutputRef, SwapChain1 swapChainOut) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; IntPtr zero3 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); zero2 = CppObject.ToCallbackPtr<Output>((ICallbackable)(object)restrictToOutputRef); Result val; fixed (SwapChainDescription1* ptr = &descRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)24 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, ptr2, (void*)zero2, &zero3)); } ((CppObject)swapChainOut).NativePointer = zero3; ((Result)(ref val)).CheckError(); } } [Guid("1bc6ea02-ef36-464f-bf0c-21ca39e5168a")] public class Factory4 : Factory3 { public Factory4() : this(IntPtr.Zero) { DXGI.CreateDXGIFactory1(Utilities.GetGuidFromType(((object)this).GetType()), out var factoryOut); ((CppObject)this).NativePointer = factoryOut; } public Factory4(bool debug = false) : this(IntPtr.Zero) { DXGI.CreateDXGIFactory2(debug ? 1 : 0, Utilities.GetGuidFromType(typeof(Factory4)), out var factoryOut); ((CppObject)this).NativePointer = factoryOut; } public Adapter GetWarpAdapter() { EnumWarpAdapter(Utilities.GetGuidFromType(typeof(Adapter)), out var vAdapterOut); return new Adapter(vAdapterOut); } public Adapter GetAdapterByLuid(long adapterLuid) { EnumAdapterByLuid(adapterLuid, Utilities.GetGuidFromType(typeof(Adapter)), out var vAdapterOut); return new Adapter(vAdapterOut); } public Factory4(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Factory4(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Factory4(nativePtr); } return null; } private unsafe void EnumAdapterByLuid(long adapterLuid, Guid riid, out IntPtr vAdapterOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &vAdapterOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, long, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)26 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, adapterLuid, &riid, ptr2)); } ((Result)(ref val)).CheckError(); } private unsafe void EnumWarpAdapter(Guid riid, out IntPtr vAdapterOut) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (IntPtr* ptr = &vAdapterOut) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)27 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &riid, ptr2)); } ((Result)(ref val)).CheckError(); } } [Guid("7632e1f5-ee65-4dca-87fd-84cd75f8838d")] public class Factory5 : Factory4 { public unsafe bool PresentAllowTearing { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) RawBool val = default(RawBool); CheckFeatureSupport(Feature.PresentAllowTearing, new IntPtr(&val), Unsafe.SizeOf<RawBool>()); return RawBool.op_Implicit(val); } } public Factory5(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Factory5(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Factory5(nativePtr); } return null; } public unsafe void CheckFeatureSupport(Feature feature, IntPtr featureSupportDataRef, int featureSupportDataSize) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)28 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)feature, (void*)featureSupportDataRef, featureSupportDataSize)); ((Result)(ref val)).CheckError(); } } public static class FormatHelper { private static readonly int[] sizeOfInBits; private static readonly bool[] compressedFormats; private static readonly bool[] srgbFormats; private static readonly bool[] typelessFormats; public static int SizeOfInBytes(this Format format) { return format.SizeOfInBits() >> 3; } public static int SizeOfInBits(this Format format) { return sizeOfInBits[(int)format]; } public static bool IsValid(this Format format) { if (format >= Format.R32G32B32A32_Typeless) { return format <= Format.B4G4R4A4_UNorm; } return false; } public static bool IsCompressed(this Format format) { return compressedFormats[(int)format]; } public static bool IsPacked(this Format format) { if (format != Format.R8G8_B8G8_UNorm) { return format == Format.G8R8_G8B8_UNorm; } return true; } public static bool IsVideo(this Format format) { switch (format) { case Format.AYUV: case Format.Y410: case Format.Y416: case Format.NV12: case Format.P010: case Format.P016: case Format.YUY2: case Format.Y210: case Format.Y216: case Format.NV11: return true; case Format.Opaque420: case Format.AI44: case Format.IA44: case Format.P8: case Format.A8P8: return true; default: return false; } } public static bool IsSRgb(this Format format) { return srgbFormats[(int)format]; } public static bool IsTypeless(this Format format) { return typelessFormats[(int)format]; } public static int ComputeScanlineCount(this Format format, int height) { if ((uint)(format - 70) <= 14u || (uint)(format - 94) <= 5u) { return Math.Max(1, (height + 3) / 4); } return height; } static FormatHelper() { sizeOfInBits = new int[256]; compressedFormats = new bool[256]; srgbFormats = new bool[256]; typelessFormats = new bool[256]; InitFormat(new Format[1] { Format.R1_UNorm }, 1); InitFormat(new Format[6] { Format.A8_UNorm, Format.R8_SInt, Format.R8_SNorm, Format.R8_Typeless, Format.R8_UInt, Format.R8_UNorm }, 8); InitFormat(new Format[15] { Format.B5G5R5A1_UNorm, Format.B5G6R5_UNorm, Format.D16_UNorm, Format.R16_Float, Format.R16_SInt, Format.R16_SNorm, Format.R16_Typeless, Format.R16_UInt, Format.R16_UNorm, Format.R8G8_SInt, Format.R8G8_SNorm, Format.R8G8_Typeless, Format.R8G8_UInt, Format.R8G8_UNorm, Format.B4G4R4A4_UNorm }, 16); InitFormat(new Format[38] { Format.B8G8R8X8_Typeless, Format.B8G8R8X8_UNorm, Format.B8G8R8X8_UNorm_SRgb, Format.D24_UNorm_S8_UInt, Format.D32_Float, Format.D32_Float_S8X24_UInt, Format.G8R8_G8B8_UNorm, Format.R10G10B10_Xr_Bias_A2_UNorm, Format.R10G10B10A2_Typeless, Format.R10G10B10A2_UInt, Format.R10G10B10A2_UNorm, Format.R11G11B10_Float, Format.R16G16_Float, Format.R16G16_SInt, Format.R16G16_SNorm, Format.R16G16_Typeless, Format.R16G16_UInt, Format.R16G16_UNorm, Format.R24_UNorm_X8_Typeless, Format.R24G8_Typeless, Format.R32_Float, Format.R32_Float_X8X24_Typeless, Format.R32_SInt, Format.R32_Typeless, Format.R32_UInt, Format.R8G8_B8G8_UNorm, Format.R8G8B8A8_SInt, Format.R8G8B8A8_SNorm, Format.R8G8B8A8_Typeless, Format.R8G8B8A8_UInt, Format.R8G8B8A8_UNorm, Format.R8G8B8A8_UNorm_SRgb, Format.B8G8R8A8_Typeless, Format.B8G8R8A8_UNorm, Format.B8G8R8A8_UNorm_SRgb, Format.R9G9B9E5_Sharedexp, Format.X24_Typeless_G8_UInt, Format.X32_Typeless_G8X24_UInt }, 32); InitFormat(new Format[11] { Format.R16G16B16A16_Float, Format.R16G16B16A16_SInt, Format.R16G16B16A16_SNorm, Format.R16G16B16A16_Typeless, Format.R16G16B16A16_UInt, Format.R16G16B16A16_UNorm, Format.R32G32_Float, Format.R32G32_SInt, Format.R32G32_Typeless, Format.R32G32_UInt, Format.R32G8X24_Typeless }, 64); InitFormat(new Format[4] { Format.R32G32B32_Float, Format.R32G32B32_SInt, Format.R32G32B32_Typeless, Format.R32G32B32_UInt }, 96); InitFormat(new Format[4] { Format.R32G32B32A32_Float, Format.R32G32B32A32_SInt, Format.R32G32B32A32_Typeless, Format.R32G32B32A32_UInt }, 128); InitFormat(new Format[6] { Format.BC1_Typeless, Format.BC1_UNorm, Format.BC1_UNorm_SRgb, Format.BC4_SNorm, Format.BC4_Typeless, Format.BC4_UNorm }, 4); InitFormat(new Format[15] { Format.BC2_Typeless, Format.BC2_UNorm, Format.BC2_UNorm_SRgb, Format.BC3_Typeless, Format.BC3_UNorm, Format.BC3_UNorm_SRgb, Format.BC5_SNorm, Format.BC5_Typeless, Format.BC5_UNorm, Format.BC6H_Sf16, Format.BC6H_Typeless, Format.BC6H_Uf16, Format.BC7_Typeless, Format.BC7_UNorm, Format.BC7_UNorm_SRgb }, 8); InitDefaults(new Format[21] { Format.BC1_Typeless, Format.BC1_UNorm, Format.BC1_UNorm_SRgb, Format.BC2_Typeless, Format.BC2_UNorm, Format.BC2_UNorm_SRgb, Format.BC3_Typeless, Format.BC3_UNorm, Format.BC3_UNorm_SRgb, Format.BC4_Typeless, Format.BC4_UNorm, Format.BC4_SNorm, Format.BC5_Typeless, Format.BC5_UNorm, Format.BC5_SNorm, Format.BC6H_Typeless, Format.BC6H_Uf16, Format.BC6H_Sf16, Format.BC7_Typeless, Format.BC7_UNorm, Format.BC7_UNorm_SRgb }, compressedFormats); InitDefaults(new Format[7] { Format.R8G8B8A8_UNorm_SRgb, Format.BC1_UNorm_SRgb, Format.BC2_UNorm_SRgb, Format.BC3_UNorm_SRgb, Format.B8G8R8A8_UNorm_SRgb, Format.B8G8R8X8_UNorm_SRgb, Format.BC7_UNorm_SRgb }, srgbFormats); InitDefaults(new Format[22] { Format.R32G32B32A32_Typeless, Format.R32G32B32_Typeless, Format.R16G16B16A16_Typeless, Format.R32G32_Typeless, Format.R32G8X24_Typeless, Format.R10G10B10A2_Typeless, Format.R8G8B8A8_Typeless, Format.R16G16_Typeless, Format.R32_Typeless, Format.R24G8_Typeless, Format.R8G8_Typeless, Format.R16_Typeless, Format.R8_Typeless, Format.BC1_Typeless, Format.BC2_Typeless, Format.BC3_Typeless, Format.BC4_Typeless, Format.BC5_Typeless, Format.B8G8R8A8_Typeless, Format.B8G8R8X8_Typeless, Format.BC6H_Typeless, Format.BC7_Typeless }, typelessFormats); } private static void InitFormat(IEnumerable<Format> formats, int bitCount) { foreach (Format format in formats) { sizeOfInBits[(int)format] = bitCount; } } private static void InitDefaults(IEnumerable<Format> formats, bool[] outputArray) { foreach (Format format in formats) { outputArray[(int)format] = true; } } } [Guid("D67441C7-672A-476f-9E82-CD55B44949CE")] public class InfoQueue : ComObject { public static InfoQueue TryCreate() { if (!DebugInterface.TryCreateComPtr<InfoQueue>(out var comPtr)) { return null; } return new InfoQueue(comPtr); } public InfoQueue(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator InfoQueue(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new InfoQueue(nativePtr); } return null; } public unsafe void SetMessageCountLimit(Guid producer, long messageCountLimit) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, long, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)3 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, messageCountLimit)); ((Result)(ref val)).CheckError(); } public unsafe void ClearStoredMessages(Guid producer) { ((delegate* unmanaged[Stdcall]<void*, Guid, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)4 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void GetMessage(Guid producer, long messageIndex, InformationQueueMessage[] messageRef, ref PointerSize messageByteLengthRef) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) InformationQueueMessage.__Native[] array = ((messageRef == null) ? null : new InformationQueueMessage.__Native[messageRef.Length]); Result val; fixed (PointerSize* ptr = &messageByteLengthRef) { void* ptr2 = ptr; fixed (InformationQueueMessage.__Native* ptr3 = array) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, long, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)5 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, messageIndex, ptr4, ptr2)); } } if (messageRef != null) { for (int i = 0; i < messageRef.Length; i++) { messageRef?[i].__MarshalFrom(ref array[i]); } } ((Result)(ref val)).CheckError(); } public unsafe long GetNumStoredMessagesAllowedByRetrievalFilters(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)6 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe long GetNumStoredMessages(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe long GetNumMessagesDiscardedByMessageCountLimit(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe long GetMessageCountLimit(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe long GetNumMessagesAllowedByStorageFilter(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe long GetNumMessagesDeniedByStorageFilter(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, long>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void AddStorageFilterEntries(Guid producer, ref InfoQueueFilter filterRef) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (InfoQueueFilter* ptr = &filterRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void GetStorageFilter(Guid producer, InfoQueueFilter[] filterRef, ref PointerSize filterByteLengthRef) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (PointerSize* ptr = &filterByteLengthRef) { void* ptr2 = ptr; fixed (InfoQueueFilter* ptr3 = filterRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } public unsafe void ClearStorageFilter(Guid producer) { ((delegate* unmanaged[Stdcall]<void*, Guid, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)14 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void PushEmptyStorageFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)15 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushDenyAllStorageFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)16 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushCopyOfStorageFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)17 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushStorageFilter(Guid producer, ref InfoQueueFilter filterRef) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (InfoQueueFilter* ptr = &filterRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)18 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void PopStorageFilter(Guid producer) { ((delegate* unmanaged[Stdcall]<void*, Guid, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)19 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe int GetStorageFilterStackSize(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)20 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void AddRetrievalFilterEntries(Guid producer, ref InfoQueueFilter filterRef) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (InfoQueueFilter* ptr = &filterRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)21 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void GetRetrievalFilter(Guid producer, InfoQueueFilter[] filterRef, ref PointerSize filterByteLengthRef) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (PointerSize* ptr = &filterByteLengthRef) { void* ptr2 = ptr; fixed (InfoQueueFilter* ptr3 = filterRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)22 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } public unsafe void ClearRetrievalFilter(Guid producer) { ((delegate* unmanaged[Stdcall]<void*, Guid, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)23 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void PushEmptyRetrievalFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)24 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushDenyAllRetrievalFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)25 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushCopyOfRetrievalFilter(Guid producer) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)26 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer)); ((Result)(ref val)).CheckError(); } public unsafe void PushRetrievalFilter(Guid producer, ref InfoQueueFilter filterRef) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (InfoQueueFilter* ptr = &filterRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)27 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void PopRetrievalFilter(Guid producer) { ((delegate* unmanaged[Stdcall]<void*, Guid, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)28 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe int GetRetrievalFilterStackSize(Guid producer) { return ((delegate* unmanaged[Stdcall]<void*, Guid, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)29 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } public unsafe void AddMessage(Guid producer, InformationQueueMessageCategory category, InformationQueueMessageSeverity severity, int id, string descriptionRef) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) IntPtr intPtr = Marshal.StringToHGlobalAnsi(descriptionRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int, int, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)30 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, (int)category, (int)severity, id, (void*)intPtr)); Marshal.FreeHGlobal(intPtr); ((Result)(ref val)).CheckError(); } public unsafe void AddApplicationMessage(InformationQueueMessageSeverity severity, string descriptionRef) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) IntPtr intPtr = Marshal.StringToHGlobalAnsi(descriptionRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)31 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)severity, (void*)intPtr)); Marshal.FreeHGlobal(intPtr); ((Result)(ref val)).CheckError(); } public unsafe void SetBreakOnCategory(Guid producer, InformationQueueMessageCategory category, RawBool bEnable) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)32 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, (int)category, bEnable)); ((Result)(ref val)).CheckError(); } public unsafe void SetBreakOnSeverity(Guid producer, InformationQueueMessageSeverity severity, RawBool bEnable) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)33 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, (int)severity, bEnable)); ((Result)(ref val)).CheckError(); } public unsafe void SetBreakOnID(Guid producer, int id, RawBool bEnable) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)34 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, id, bEnable)); ((Result)(ref val)).CheckError(); } public unsafe RawBool GetBreakOnCategory(Guid producer, InformationQueueMessageCategory category) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)35 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, (int)category); } public unsafe RawBool GetBreakOnSeverity(Guid producer, InformationQueueMessageSeverity severity) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)36 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, (int)severity); } public unsafe RawBool GetBreakOnID(Guid producer, int id) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, Guid, int, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)37 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, id); } public unsafe void SetMuteDebugOutput(Guid producer, RawBool bMute) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((delegate* unmanaged[Stdcall]<void*, Guid, RawBool, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)38 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer, bMute); } public unsafe RawBool GetMuteDebugOutput(Guid producer) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, Guid, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)39 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, producer); } } [Guid("e9550983-360b-4f53-b391-afd695078691")] public class IVirtualSurfaceImageSourceNative : ISurfaceImageSourceNative { private class VirtualSurfaceUpdatesCallbackNativeCallback : CallbackBase, IVirtualSurfaceUpdatesCallbackNative, IUnknown, ICallbackable, IDisposable { private IVirtualSurfaceImageSourceNative eventCallback; public VirtualSurfaceUpdatesCallbackNativeCallback(IVirtualSurfaceImageSourceNative eventCallbackArg) { eventCallback = eventCallbackArg; } public void UpdatesNeeded() { eventCallback.OnUpdatesNeeded(); } } private IVirtualSurfaceUpdatesCallbackNative callback; private EventHandler<EventArgs> updatesNeeded; public RawRectangle[] UpdateRectangles { get { int updateRectCount = GetUpdateRectCount(); RawRectangle[] array = (RawRectangle[])(object)new RawRectangle[updateRectCount]; GetUpdateRects(array, updateRectCount); return array; } } public RawRectangle VisibleBounds { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) GetVisibleBounds(out var bounds); return bounds; } } public event EventHandler<EventArgs> UpdatesNeeded { add { if (callback == null) { callback = new VirtualSurfaceUpdatesCallbackNativeCallback(this); RegisterForUpdatesNeeded(callback); } updatesNeeded = (EventHandler<EventArgs>)Delegate.Combine(updatesNeeded, value); } remove { updatesNeeded = (EventHandler<EventArgs>)Delegate.Remove(updatesNeeded, value); } } private void OnUpdatesNeeded() { if (updatesNeeded != null) { updatesNeeded(this, EventArgs.Empty); } } public IVirtualSurfaceImageSourceNative(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator IVirtualSurfaceImageSourceNative(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new IVirtualSurfaceImageSourceNative(nativePtr); } return null; } public unsafe void Invalidate(RawRectangle updateRect) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, RawRectangle, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)6 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, updateRect)); ((Result)(ref val)).CheckError(); } internal unsafe int GetUpdateRectCount() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) int result = default(int); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &result)); ((Result)(ref val)).CheckError(); return result; } internal unsafe void GetUpdateRects(RawRectangle[] updates, int count) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (RawRectangle* ptr = updates) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, count)); } ((Result)(ref val)).CheckError(); } internal unsafe void GetVisibleBounds(out RawRectangle bounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) bounds = default(RawRectangle); Result val; fixed (RawRectangle* ptr = &bounds) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2)); } ((Result)(ref val)).CheckError(); } internal unsafe void RegisterForUpdatesNeeded(IVirtualSurfaceUpdatesCallbackNative callback) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IVirtualSurfaceUpdatesCallbackNative>((ICallbackable)callback); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero)); ((Result)(ref val)).CheckError(); } public unsafe void Resize(int newWidth, int newHeight) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, newWidth, newHeight)); ((Result)(ref val)).CheckError(); } } [Shadow(typeof(VirtualSurfaceUpdatesCallbackNativeShadow))] [Guid("dbf2e947-8e6c-4254-9eee-7738f71386c9")] internal interface IVirtualSurfaceUpdatesCallbackNative : IUnknown, ICallbackable, IDisposable { void UpdatesNeeded(); } [Guid("dbf2e947-8e6c-4254-9eee-7738f71386c9")] internal class IVirtualSurfaceUpdatesCallbackNativeNative : ComObject, IVirtualSurfaceUpdatesCallbackNative, IUnknown, ICallbackable, IDisposable { public void UpdatesNeeded() { UpdatesNeeded_(); } public IVirtualSurfaceUpdatesCallbackNativeNative(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator IVirtualSurfaceUpdatesCallbackNativeNative(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new IVirtualSurfaceUpdatesCallbackNativeNative(nativePtr); } return null; } internal unsafe void UpdatesNeeded_() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)3 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); ((Result)(ref val)).CheckError(); } } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct ModeDescription { public int Width; public int Height; public Rational RefreshRate; public Format Format; public DisplayModeScanlineOrder ScanlineOrdering; public DisplayModeScaling Scaling; public ModeDescription(int width, int height, Rational refreshRate, Format format) { Width = width; Height = height; RefreshRate = refreshRate; Format = format; ScanlineOrdering = DisplayModeScanlineOrder.Unspecified; Scaling = DisplayModeScaling.Unspecified; } public ModeDescription(Format format) { this = default(ModeDescription); Format = format; } } internal class ModuleInit { [Tag("SharpDX.ModuleInit")] internal static void Setup() { ResultDescriptor.RegisterProvider(typeof(ResultCode)); } } [CompilerGenerated] internal class NamespaceDoc { } [Guid("ae02eedb-c735-4690-8d52-5a8dc20213aa")] public class Output : DXGIObject { public OutputDescription Description { get { GetDescription(out var descRef); return descRef; } } public GammaControlCapabilities GammaControlCapabilities { get { GetGammaControlCapabilities(out var gammaCapsRef); return gammaCapsRef; } } public GammaControl GammaControl { get { GetGammaControl(out var arrayRef); return arrayRef; } set { SetGammaControl(ref value); } } public FrameStatistics FrameStatistics { get { GetFrameStatistics(out var statsRef); return statsRef; } } public void GetClosestMatchingMode(ComObject device, ModeDescription modeToMatch, out ModeDescription closestMatch) { FindClosestMatchingMode(ref modeToMatch, out closestMatch, (IUnknown)(object)device); } public ModeDescription[] GetDisplayModeList(Format format, DisplayModeEnumerationFlags flags) { int numModesRef = 0; GetDisplayModeList(format, (int)flags, ref numModesRef, null); ModeDescription[] array = new ModeDescription[numModesRef]; if (numModesRef > 0) { GetDisplayModeList(format, (int)flags, ref numModesRef, array); } return array; } public Output(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Output(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Output(nativePtr); } return null; } internal unsafe void GetDescription(out OutputDescription descRef) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) OutputDescription.__Native @ref = default(OutputDescription.__Native); descRef = default(OutputDescription); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref)); descRef.__MarshalFrom(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe void GetDisplayModeList(Format enumFormat, int flags, ref int numModesRef, ModeDescription[] descRef) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (ModeDescription* ptr = descRef) { void* ptr2 = ptr; fixed (int* ptr3 = &numModesRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)enumFormat, flags, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } internal unsafe void FindClosestMatchingMode(ref ModeDescription modeToMatchRef, out ModeDescription closestMatchRef, IUnknown concernedDeviceRef) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) closestMatchRef = default(ModeDescription); IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)concernedDeviceRef); Result val; fixed (ModeDescription* ptr = &closestMatchRef) { void* ptr2 = ptr; fixed (ModeDescription* ptr3 = &modeToMatchRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, (void*)zero)); } } ((Result)(ref val)).CheckError(); } public unsafe void WaitForVerticalBlank() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); ((Result)(ref val)).CheckError(); } public unsafe void TakeOwnership(IUnknown deviceRef, RawBool exclusive) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, RawBool, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, exclusive)); ((Result)(ref val)).CheckError(); } public unsafe void ReleaseOwnership() { ((delegate* unmanaged[Stdcall]<void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } internal unsafe void GetGammaControlCapabilities(out GammaControlCapabilities gammaCapsRef) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) GammaControlCapabilities.__Native @ref = default(GammaControlCapabilities.__Native); gammaCapsRef = default(GammaControlCapabilities); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref)); gammaCapsRef.__MarshalFrom(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe void SetGammaControl(ref GammaControl arrayRef) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) GammaControl.__Native @ref = default(GammaControl.__Native); arrayRef.__MarshalTo(ref @ref); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)14 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref)); arrayRef.__MarshalFree(ref @ref); ((Result)(ref val)).CheckError(); } internal unsafe void GetGammaControl(out GammaControl arrayRef) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) GammaControl.__Native @ref = default(GammaControl.__Native); arrayRef = default(GammaControl); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)15 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &@ref)); arrayRef.__MarshalFrom(ref @ref); ((Result)(ref val)).CheckError(); } public unsafe void SetDisplaySurface(Surface scanoutSurfaceRef) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Surface>((ICallbackable)(object)scanoutSurfaceRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)16 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero)); ((Result)(ref val)).CheckError(); } public unsafe void CopyDisplaySurfaceTo(Surface destinationRef) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Surface>((ICallbackable)(object)destinationRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)17 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero)); ((Result)(ref val)).CheckError(); } internal unsafe void GetFrameStatistics(out FrameStatistics statsRef) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) statsRef = default(FrameStatistics); Result val; fixed (FrameStatistics* ptr = &statsRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)18 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2)); } ((Result)(ref val)).CheckError(); } } [Guid("00cddea8-939b-4b83-a340-a685226666cc")] public class Output1 : Output { public ModeDescription1[] GetDisplayModeList1(Format enumFormat, DisplayModeEnumerationFlags flags) { int numModesRef = 0; GetDisplayModeList1(enumFormat, (int)flags, ref numModesRef, null); ModeDescription1[] array = new ModeDescription1[numModesRef]; if (numModesRef > 0) { GetDisplayModeList1(enumFormat, (int)flags, ref numModesRef, array); } return array; } public Output1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Output1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Output1(nativePtr); } return null; } internal unsafe void GetDisplayModeList1(Format enumFormat, int flags, ref int numModesRef, ModeDescription1[] descRef) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (ModeDescription1* ptr = descRef) { void* ptr2 = ptr; fixed (int* ptr3 = &numModesRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)19 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (int)enumFormat, flags, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } public unsafe void FindClosestMatchingMode1(ref ModeDescription1 modeToMatchRef, out ModeDescription1 closestMatchRef, IUnknown concernedDeviceRef) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) closestMatchRef = default(ModeDescription1); IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)concernedDeviceRef); Result val; fixed (ModeDescription1* ptr = &closestMatchRef) { void* ptr2 = ptr; fixed (ModeDescription1* ptr3 = &modeToMatchRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)20 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr4, ptr2, (void*)zero)); } } ((Result)(ref val)).CheckError(); } public unsafe void GetDisplaySurfaceData1(Resource destinationRef) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; zero = CppObject.ToCallbackPtr<Resource>((ICallbackable)(object)destinationRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)21 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero)); ((Result)(ref val)).CheckError(); } public unsafe OutputDuplication DuplicateOutput(IUnknown deviceRef) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; IntPtr zero2 = IntPtr.Zero; zero = CppObject.ToCallbackPtr<IUnknown>((ICallbackable)(object)deviceRef); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)22 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, (void*)zero, &zero2)); OutputDuplication result = ((!(zero2 != IntPtr.Zero)) ? null : new OutputDuplication(zero2)); ((Result)(ref val)).CheckError(); return result; } } [Guid("595e39d1-2724-4663-99b1-da969de28364")] public class Output2 : Output1 { public bool SupportsOverlays => RawBool.op_Implicit(SupportsOverlays_()); public Output2(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Output2(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Output2(nativePtr); } return null; } internal unsafe RawBool SupportsOverlays_() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return ((delegate* unmanaged[Stdcall]<void*, RawBool>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)23 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer); } } [Guid("191cfac3-a341-470d-b26e-a864f428319c")] public class OutputDuplication : DXGIObject { public OutputDuplicateDescription Description { get { GetDescription(out var descRef); return descRef; } } public OutputDuplication(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator OutputDuplication(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new OutputDuplication(nativePtr); } return null; } internal unsafe void GetDescription(out OutputDuplicateDescription descRef) { descRef = default(OutputDuplicateDescription); fixed (OutputDuplicateDescription* ptr = &descRef) { void* ptr2 = ptr; ((delegate* unmanaged[Stdcall]<void*, void*, void>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)7 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2); } } public unsafe Result TryAcquireNextFrame(int timeoutInMilliseconds, out OutputDuplicateFrameInformation frameInfoRef, out Resource desktopResourceOut) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) frameInfoRef = default(OutputDuplicateFrameInformation); IntPtr zero = IntPtr.Zero; Result result; fixed (OutputDuplicateFrameInformation* ptr = &frameInfoRef) { void* ptr2 = ptr; result = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, timeoutInMilliseconds, ptr2, &zero)); } if (zero != IntPtr.Zero) { desktopResourceOut = new Resource(zero); return result; } desktopResourceOut = null; return result; } public unsafe void GetFrameDirtyRects(int dirtyRectsBufferSize, RawRectangle[] dirtyRectsBufferRef, out int dirtyRectsBufferSizeRequiredRef) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &dirtyRectsBufferSizeRequiredRef) { void* ptr2 = ptr; fixed (RawRectangle* ptr3 = dirtyRectsBufferRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, dirtyRectsBufferSize, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } public unsafe void GetFrameMoveRects(int moveRectsBufferSize, OutputDuplicateMoveRectangle[] moveRectBufferRef, out int moveRectsBufferSizeRequiredRef) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &moveRectsBufferSizeRequiredRef) { void* ptr2 = ptr; fixed (OutputDuplicateMoveRectangle* ptr3 = moveRectBufferRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, moveRectsBufferSize, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } public unsafe void GetFramePointerShape(int pointerShapeBufferSize, IntPtr pointerShapeBufferRef, out int pointerShapeBufferSizeRequiredRef, out OutputDuplicatePointerShapeInformation pointerShapeInfoRef) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) pointerShapeInfoRef = default(OutputDuplicatePointerShapeInformation); Result val; fixed (OutputDuplicatePointerShapeInformation* ptr = &pointerShapeInfoRef) { void* ptr2 = ptr; fixed (int* ptr3 = &pointerShapeBufferSizeRequiredRef) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, pointerShapeBufferSize, (void*)pointerShapeBufferRef, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } internal unsafe void MapDesktopSurface(out MappedRectangle lockedRectRef) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) lockedRectRef = default(MappedRectangle); Result val; fixed (MappedRectangle* ptr = &lockedRectRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2)); } ((Result)(ref val)).CheckError(); } public unsafe void UnMapDesktopSurface() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); ((Result)(ref val)).CheckError(); } public unsafe void ReleaseFrame() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)14 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); ((Result)(ref val)).CheckError(); } } public struct PresentParameters { internal struct __Native { public int DirtyRectsCount; public IntPtr PDirtyRects; public IntPtr PScrollRect; public IntPtr PScrollOffset; } public RawRectangle[] DirtyRectangles; public RawRectangle? ScrollRectangle; public RawPoint? ScrollOffset; internal int DirtyRectsCount; internal IntPtr PDirtyRects; internal IntPtr PScrollRect; internal IntPtr PScrollOffset; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct Rational : IEquatable<Rational> { public static readonly Rational Empty; public int Numerator; public int Denominator; public Rational(int numerator, int denominator) { Numerator = numerator; Denominator = denominator; } public bool Equals(Rational other) { if (Numerator == other.Numerator) { return Denominator == other.Denominator; } return false; } public override bool Equals(object obj) { if (obj == null) { return false; } if (obj is Rational) { return Equals((Rational)obj); } return false; } public override int GetHashCode() { return (Numerator * 397) ^ Denominator; } public static bool operator ==(Rational left, Rational right) { return left.Equals(right); } public static bool operator !=(Rational left, Rational right) { return !left.Equals(right); } public override string ToString() { return $"{Numerator}/{Denominator}"; } } [Guid("30961379-4609-4a41-998e-54fe567ee0c1")] public class Resource1 : Resource { public IntPtr CreateSharedHandle(string name, SharedResourceFlags dwAccess, SecurityAttributes? attributesRef = null) { return CreateSharedHandle(attributesRef, dwAccess, name); } public Resource1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Resource1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Resource1(nativePtr); } return null; } internal unsafe void CreateSubresourceSurface(int index, Surface2 surfaceOut) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) IntPtr zero = IntPtr.Zero; Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, index, &zero)); ((CppObject)surfaceOut).NativePointer = zero; ((Result)(ref val)).CheckError(); } internal unsafe IntPtr CreateSharedHandle(SecurityAttributes? attributesRef, SharedResourceFlags dwAccess, string lpName) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) SecurityAttributes value = default(SecurityAttributes); if (attributesRef.HasValue) { value = attributesRef.Value; } Result val; IntPtr result = default(IntPtr); fixed (char* ptr = lpName) { void* nativePointer = ((CppObject)this)._nativePointer; SecurityAttributes* intPtr = ((!attributesRef.HasValue) ? null : (&value)); val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(nativePointer, intPtr, (int)dwAccess, ptr, &result)); } ((Result)(ref val)).CheckError(); return result; } } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct SampleDescription { public int Count; public int Quality; public SampleDescription(int count, int quality) { Count = count; Quality = quality; } public override string ToString() { return $"{{{Count}, {Quality}}}"; } } [Guid("cafcb56c-6ac3-4889-bf47-9e23bbd260ec")] public class Surface : DeviceChild { public SurfaceDescription Description { get { GetDescription(out var descRef); return descRef; } } public DataRectangle Map(MapFlags flags) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Map(out var lockedRectRef, (int)flags); return new DataRectangle(lockedRectRef.PBits, lockedRectRef.Pitch); } public DataRectangle Map(MapFlags flags, out DataStream dataStream) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) DataRectangle val = Map(flags); dataStream = new DataStream(val.DataPointer, (long)(Description.Height * val.Pitch), true, true); return val; } public static Surface FromSwapChain(SwapChain swapChain, int index) { swapChain.GetBuffer(index, Utilities.GetGuidFromType(typeof(Surface)), out var surfaceOut); return new Surface(surfaceOut); } public Surface(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Surface(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Surface(nativePtr); } return null; } internal unsafe void GetDescription(out SurfaceDescription descRef) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) descRef = default(SurfaceDescription); Result val; fixed (SurfaceDescription* ptr = &descRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)8 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2)); } ((Result)(ref val)).CheckError(); } internal unsafe void Map(out MappedRectangle lockedRectRef, int mapFlags) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) lockedRectRef = default(MappedRectangle); Result val; fixed (MappedRectangle* ptr = &lockedRectRef) { void* ptr2 = ptr; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)9 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, ptr2, mapFlags)); } ((Result)(ref val)).CheckError(); } public unsafe void Unmap() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)10 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer)); ((Result)(ref val)).CheckError(); } } [Guid("4AE63092-6327-4c1b-80AE-BFE12EA32B86")] public class Surface1 : Surface { public void ReleaseDC() { ReleaseDC_(null); } public void ReleaseDC(RawRectangle dirtyRect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ReleaseDC_(dirtyRect); } public Surface1(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Surface1(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Surface1(nativePtr); } return null; } public unsafe IntPtr GetDC(RawBool discard) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) IntPtr result = default(IntPtr); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, RawBool, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)11 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, discard, &result)); ((Result)(ref val)).CheckError(); return result; } internal unsafe void ReleaseDC_(RawRectangle? dirtyRectRef) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) RawRectangle value = default(RawRectangle); if (dirtyRectRef.HasValue) { value = dirtyRectRef.Value; } void* nativePointer = ((CppObject)this)._nativePointer; RawRectangle* intPtr = ((!dirtyRectRef.HasValue) ? null : (&value)); Result val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)12 * (nint)sizeof(void*))))(nativePointer, intPtr)); ((Result)(ref val)).CheckError(); } } [Guid("aba496dd-b617-4cb8-a866-bc44d7eb1fa2")] public class Surface2 : Surface1 { public Surface2(Resource1 resource, int index) : base(IntPtr.Zero) { resource.CreateSubresourceSurface(index, this); } public Surface2(IntPtr nativePtr) : base(nativePtr) { } public static explicit operator Surface2(IntPtr nativePtr) { if (!(nativePtr == IntPtr.Zero)) { return new Surface2(nativePtr); } return null; } public unsafe void GetResource(Guid riid, out IntPtr parentResourceOut, out int subresourceIndexRef) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Result val; fixed (int* ptr = &subresourceIndexRef) { void* ptr2 = ptr; fixed (IntPtr* ptr3 = &parentResourceOut) { void* ptr4 = ptr3; val = Result.op_Implicit(((delegate* unmanaged[Stdcall]<void*, void*, void*, void*, int>)(*(IntPtr*)((nint)(*(IntPtr*)((CppObject)this)._nativePointer) + (nint)13 * (nint)sizeof(void*))))(((CppObject)this)._nativePointer, &riid, ptr4, ptr2)); } } ((Result)(ref val)).CheckError(); } } [Guid("310d36a0-d2e7-4c0a-aa04-6a9d23b8886a")] public class SwapChain : DeviceChild { public FrameStatistics FrameStatistics { get { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) FrameStatistics statsRef; Result val = TryGetFrameStatistics(out statsRef); ((Result)(ref val)).CheckError(); return statsRef; } } public bool IsFullScreen { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) GetFullscreenState(out var fullscreenRef, out var targetOut); if (targetOut != null) { ((DisposeBase)targetOut).Dispose(); } return RawBool.op_Implicit(fullscreenRef); } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SetFullscreenState(RawBool.op_Implicit(value), null); } } public SwapChainDescription Description { get { GetDescription(out var descRef); return descRef; } } public Output ContainingOutput { get { GetContainingOutput(out var outputOut); return outputOut; } } public int LastPresentCount { get { GetLastPresentCount(out var lastPresentCountRef); return lastPresentCountRef; } } public SwapChain(Factory factory, ComObject device, SwapChainDescription description) : base(IntPtr.Zero) { factory.CreateSwapChain((IUnknown)(object)device, ref description, this); } public T GetBackBuffer<T>(int index) where T : ComObject { GetBuffer(index, Utilities.GetGuidFromType(typeof(T)), out var surfaceOut); return CppObject.Fro
plugins/OverlayDearImGui.Shared/System.Runtime.dll
Decompiled 11 months agousing System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Text; using System.Threading; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("System.Runtime")] [assembly: AssemblyDescription("System.Runtime")] [assembly: AssemblyDefaultAlias("System.Runtime")] [assembly: AssemblyCompany("Mono development team")] [assembly: AssemblyProduct("Mono Common Language Infrastructure")] [assembly: AssemblyCopyright("(c) Various Mono authors")] [assembly: AssemblyInformationalVersion("4.0.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyVersion("4.1.0.0")] [assembly: TypeForwardedTo(typeof(Action))] [assembly: TypeForwardedTo(typeof(Action<>))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, >))] [assembly: TypeForwardedTo(typeof(Action<, , >))] [assembly: TypeForwardedTo(typeof(Action<, , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(Action<, , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Activator))] [assembly: TypeForwardedTo(typeof(ArgumentException))] [assembly: TypeForwardedTo(typeof(ArgumentNullException))] [assembly: TypeForwardedTo(typeof(ArgumentOutOfRangeException))] [assembly: TypeForwardedTo(typeof(ArithmeticException))] [assembly: TypeForwardedTo(typeof(Array))] [assembly: TypeForwardedTo(typeof(ArraySegment<>))] [assembly: TypeForwardedTo(typeof(ArrayTypeMismatchException))] [assembly: TypeForwardedTo(typeof(AsyncCallback))] [assembly: TypeForwardedTo(typeof(Attribute))] [assembly: TypeForwardedTo(typeof(AttributeTargets))] [assembly: TypeForwardedTo(typeof(AttributeUsageAttribute))] [assembly: TypeForwardedTo(typeof(BadImageFormatException))] [assembly: TypeForwardedTo(typeof(bool))] [assembly: TypeForwardedTo(typeof(Buffer))] [assembly: TypeForwardedTo(typeof(byte))] [assembly: TypeForwardedTo(typeof(char))] [assembly: TypeForwardedTo(typeof(CLSCompliantAttribute))] [assembly: TypeForwardedTo(typeof(DictionaryEntry))] [assembly: TypeForwardedTo(typeof(ICollection<>))] [assembly: TypeForwardedTo(typeof(IComparer<>))] [assembly: TypeForwardedTo(typeof(IDictionary<, >))] [assembly: TypeForwardedTo(typeof(IEnumerable<>))] [assembly: TypeForwardedTo(typeof(IEnumerator<>))] [assembly: TypeForwardedTo(typeof(IEqualityComparer<>))] [assembly: TypeForwardedTo(typeof(IList<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyCollection<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyDictionary<, >))] [assembly: TypeForwardedTo(typeof(IReadOnlyList<>))] [assembly: TypeForwardedTo(typeof(ISet<>))] [assembly: TypeForwardedTo(typeof(KeyNotFoundException))] [assembly: TypeForwardedTo(typeof(KeyValuePair<, >))] [assembly: TypeForwardedTo(typeof(ICollection))] [assembly: TypeForwardedTo(typeof(IComparer))] [assembly: TypeForwardedTo(typeof(IDictionary))] [assembly: TypeForwardedTo(typeof(IDictionaryEnumerator))] [assembly: TypeForwardedTo(typeof(IEnumerable))] [assembly: TypeForwardedTo(typeof(IEnumerator))] [assembly: TypeForwardedTo(typeof(IEqualityComparer))] [assembly: TypeForwardedTo(typeof(IList))] [assembly: TypeForwardedTo(typeof(IStructuralComparable))] [assembly: TypeForwardedTo(typeof(IStructuralEquatable))] [assembly: TypeForwardedTo(typeof(Collection<>))] [assembly: TypeForwardedTo(typeof(ReadOnlyCollection<>))] [assembly: TypeForwardedTo(typeof(Comparison<>))] [assembly: TypeForwardedTo(typeof(DefaultValueAttribute))] [assembly: TypeForwardedTo(typeof(EditorBrowsableAttribute))] [assembly: TypeForwardedTo(typeof(EditorBrowsableState))] [assembly: TypeForwardedTo(typeof(DateTime))] [assembly: TypeForwardedTo(typeof(DateTimeKind))] [assembly: TypeForwardedTo(typeof(DateTimeOffset))] [assembly: TypeForwardedTo(typeof(DayOfWeek))] [assembly: TypeForwardedTo(typeof(decimal))] [assembly: TypeForwardedTo(typeof(Delegate))] [assembly: TypeForwardedTo(typeof(ConditionalAttribute))] [assembly: TypeForwardedTo(typeof(DebuggableAttribute))] [assembly: TypeForwardedTo(typeof(DivideByZeroException))] [assembly: TypeForwardedTo(typeof(double))] [assembly: TypeForwardedTo(typeof(Enum))] [assembly: TypeForwardedTo(typeof(EventArgs))] [assembly: TypeForwardedTo(typeof(EventHandler))] [assembly: TypeForwardedTo(typeof(EventHandler<>))] [assembly: TypeForwardedTo(typeof(Exception))] [assembly: TypeForwardedTo(typeof(FieldAccessException))] [assembly: TypeForwardedTo(typeof(FlagsAttribute))] [assembly: TypeForwardedTo(typeof(FormatException))] [assembly: TypeForwardedTo(typeof(FormattableString))] [assembly: TypeForwardedTo(typeof(Func<>))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , , , , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, >))] [assembly: TypeForwardedTo(typeof(Func<, , >))] [assembly: TypeForwardedTo(typeof(Func<, , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(Func<, , , , , , , , >))] [assembly: TypeForwardedTo(typeof(GC))] [assembly: TypeForwardedTo(typeof(GCCollectionMode))] [assembly: TypeForwardedTo(typeof(DateTimeStyles))] [assembly: TypeForwardedTo(typeof(NumberStyles))] [assembly: TypeForwardedTo(typeof(TimeSpanStyles))] [assembly: TypeForwardedTo(typeof(Guid))] [assembly: TypeForwardedTo(typeof(IAsyncResult))] [assembly: TypeForwardedTo(typeof(IComparable))] [assembly: TypeForwardedTo(typeof(IComparable<>))] [assembly: TypeForwardedTo(typeof(IConvertible))] [assembly: TypeForwardedTo(typeof(ICustomFormatter))] [assembly: TypeForwardedTo(typeof(IDisposable))] [assembly: TypeForwardedTo(typeof(IEquatable<>))] [assembly: TypeForwardedTo(typeof(IFormatProvider))] [assembly: TypeForwardedTo(typeof(IFormattable))] [assembly: TypeForwardedTo(typeof(IndexOutOfRangeException))] [assembly: TypeForwardedTo(typeof(InsufficientExecutionStackException))] [assembly: TypeForwardedTo(typeof(short))] [assembly: TypeForwardedTo(typeof(int))] [assembly: TypeForwardedTo(typeof(long))] [assembly: TypeForwardedTo(typeof(IntPtr))] [assembly: TypeForwardedTo(typeof(InvalidCastException))] [assembly: TypeForwardedTo(typeof(InvalidOperationException))] [assembly: TypeForwardedTo(typeof(InvalidProgramException))] [assembly: TypeForwardedTo(typeof(InvalidTimeZoneException))] [assembly: TypeForwardedTo(typeof(DirectoryNotFoundException))] [assembly: TypeForwardedTo(typeof(FileLoadException))] [assembly: TypeForwardedTo(typeof(FileNotFoundException))] [assembly: TypeForwardedTo(typeof(IOException))] [assembly: TypeForwardedTo(typeof(PathTooLongException))] [assembly: TypeForwardedTo(typeof(IObservable<>))] [assembly: TypeForwardedTo(typeof(IObserver<>))] [assembly: TypeForwardedTo(typeof(IProgress<>))] [assembly: TypeForwardedTo(typeof(Lazy<>))] [assembly: TypeForwardedTo(typeof(Lazy<, >))] [assembly: TypeForwardedTo(typeof(MemberAccessException))] [assembly: TypeForwardedTo(typeof(MethodAccessException))] [assembly: TypeForwardedTo(typeof(MissingFieldException))] [assembly: TypeForwardedTo(typeof(MissingMemberException))] [assembly: TypeForwardedTo(typeof(MissingMethodException))] [assembly: TypeForwardedTo(typeof(MTAThreadAttribute))] [assembly: TypeForwardedTo(typeof(MulticastDelegate))] [assembly: TypeForwardedTo(typeof(NotImplementedException))] [assembly: TypeForwardedTo(typeof(NotSupportedException))] [assembly: TypeForwardedTo(typeof(Nullable))] [assembly: TypeForwardedTo(typeof(Nullable<>))] [assembly: TypeForwardedTo(typeof(NullReferenceException))] [assembly: TypeForwardedTo(typeof(object))] [assembly: TypeForwardedTo(typeof(ObjectDisposedException))] [assembly: TypeForwardedTo(typeof(ObsoleteAttribute))] [assembly: TypeForwardedTo(typeof(OutOfMemoryException))] [assembly: TypeForwardedTo(typeof(OverflowException))] [assembly: TypeForwardedTo(typeof(ParamArrayAttribute))] [assembly: TypeForwardedTo(typeof(PlatformNotSupportedException))] [assembly: TypeForwardedTo(typeof(Predicate<>))] [assembly: TypeForwardedTo(typeof(RankException))] [assembly: TypeForwardedTo(typeof(AssemblyCompanyAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyConfigurationAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyCopyrightAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyCultureAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyDefaultAliasAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyDelaySignAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyDescriptionAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyFileVersionAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyFlagsAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyInformationalVersionAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyKeyFileAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyKeyNameAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyMetadataAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyNameFlags))] [assembly: TypeForwardedTo(typeof(AssemblyProductAttribute))] [assembly: TypeForwardedTo(typeof(AssemblySignatureKeyAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyTitleAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyTrademarkAttribute))] [assembly: TypeForwardedTo(typeof(AssemblyVersionAttribute))] [assembly: TypeForwardedTo(typeof(DefaultMemberAttribute))] [assembly: TypeForwardedTo(typeof(ProcessorArchitecture))] [assembly: TypeForwardedTo(typeof(AccessedThroughPropertyAttribute))] [assembly: TypeForwardedTo(typeof(AsyncStateMachineAttribute))] [assembly: TypeForwardedTo(typeof(CallerFilePathAttribute))] [assembly: TypeForwardedTo(typeof(CallerLineNumberAttribute))] [assembly: TypeForwardedTo(typeof(CallerMemberNameAttribute))] [assembly: TypeForwardedTo(typeof(CompilationRelaxationsAttribute))] [assembly: TypeForwardedTo(typeof(CompilerGeneratedAttribute))] [assembly: TypeForwardedTo(typeof(ConditionalWeakTable<, >))] [assembly: TypeForwardedTo(typeof(CustomConstantAttribute))] [assembly: TypeForwardedTo(typeof(DateTimeConstantAttribute))] [assembly: TypeForwardedTo(typeof(DecimalConstantAttribute))] [assembly: TypeForwardedTo(typeof(DisablePrivateReflectionAttribute))] [assembly: TypeForwardedTo(typeof(ExtensionAttribute))] [assembly: TypeForwardedTo(typeof(FixedBufferAttribute))] [assembly: TypeForwardedTo(typeof(FormattableStringFactory))] [assembly: TypeForwardedTo(typeof(IndexerNameAttribute))] [assembly: TypeForwardedTo(typeof(InternalsVisibleToAttribute))] [assembly: TypeForwardedTo(typeof(IsConst))] [assembly: TypeForwardedTo(typeof(IStrongBox))] [assembly: TypeForwardedTo(typeof(IsVolatile))] [assembly: TypeForwardedTo(typeof(IteratorStateMachineAttribute))] [assembly: TypeForwardedTo(typeof(MethodImplAttribute))] [assembly: TypeForwardedTo(typeof(MethodImplOptions))] [assembly: TypeForwardedTo(typeof(ReferenceAssemblyAttribute))] [assembly: TypeForwardedTo(typeof(RuntimeCompatibilityAttribute))] [assembly: TypeForwardedTo(typeof(RuntimeHelpers))] [assembly: TypeForwardedTo(typeof(StateMachineAttribute))] [assembly: TypeForwardedTo(typeof(StrongBox<>))] [assembly: TypeForwardedTo(typeof(TypeForwardedFromAttribute))] [assembly: TypeForwardedTo(typeof(TypeForwardedToAttribute))] [assembly: TypeForwardedTo(typeof(UnsafeValueTypeAttribute))] [assembly: TypeForwardedTo(typeof(ExceptionDispatchInfo))] [assembly: TypeForwardedTo(typeof(GCLargeObjectHeapCompactionMode))] [assembly: TypeForwardedTo(typeof(GCLatencyMode))] [assembly: TypeForwardedTo(typeof(GCSettings))] [assembly: TypeForwardedTo(typeof(CharSet))] [assembly: TypeForwardedTo(typeof(ComVisibleAttribute))] [assembly: TypeForwardedTo(typeof(FieldOffsetAttribute))] [assembly: TypeForwardedTo(typeof(GCHandle))] [assembly: TypeForwardedTo(typeof(GCHandleType))] [assembly: TypeForwardedTo(typeof(LayoutKind))] [assembly: TypeForwardedTo(typeof(OutAttribute))] [assembly: TypeForwardedTo(typeof(StructLayoutAttribute))] [assembly: TypeForwardedTo(typeof(TargetFrameworkAttribute))] [assembly: TypeForwardedTo(typeof(RuntimeFieldHandle))] [assembly: TypeForwardedTo(typeof(RuntimeMethodHandle))] [assembly: TypeForwardedTo(typeof(RuntimeTypeHandle))] [assembly: TypeForwardedTo(typeof(sbyte))] [assembly: TypeForwardedTo(typeof(AllowPartiallyTrustedCallersAttribute))] [assembly: TypeForwardedTo(typeof(SecurityCriticalAttribute))] [assembly: TypeForwardedTo(typeof(SecurityException))] [assembly: TypeForwardedTo(typeof(SecuritySafeCriticalAttribute))] [assembly: TypeForwardedTo(typeof(SecurityTransparentAttribute))] [assembly: TypeForwardedTo(typeof(VerificationException))] [assembly: TypeForwardedTo(typeof(float))] [assembly: TypeForwardedTo(typeof(STAThreadAttribute))] [assembly: TypeForwardedTo(typeof(string))] [assembly: TypeForwardedTo(typeof(StringComparison))] [assembly: TypeForwardedTo(typeof(StringSplitOptions))] [assembly: TypeForwardedTo(typeof(StringBuilder))] [assembly: TypeForwardedTo(typeof(LazyThreadSafetyMode))] [assembly: TypeForwardedTo(typeof(Timeout))] [assembly: TypeForwardedTo(typeof(WaitHandle))] [assembly: TypeForwardedTo(typeof(ThreadStaticAttribute))] [assembly: TypeForwardedTo(typeof(TimeoutException))] [assembly: TypeForwardedTo(typeof(TimeSpan))] [assembly: TypeForwardedTo(typeof(TimeZoneInfo))] [assembly: TypeForwardedTo(typeof(Tuple))] [assembly: TypeForwardedTo(typeof(Tuple<>))] [assembly: TypeForwardedTo(typeof(Tuple<, >))] [assembly: TypeForwardedTo(typeof(Tuple<, , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(Type))] [assembly: TypeForwardedTo(typeof(TypeAccessException))] [assembly: TypeForwardedTo(typeof(TypeCode))] [assembly: TypeForwardedTo(typeof(TypeInitializationException))] [assembly: TypeForwardedTo(typeof(TypeLoadException))] [assembly: TypeForwardedTo(typeof(ushort))] [assembly: TypeForwardedTo(typeof(uint))] [assembly: TypeForwardedTo(typeof(ulong))] [assembly: TypeForwardedTo(typeof(UIntPtr))] [assembly: TypeForwardedTo(typeof(UnauthorizedAccessException))] [assembly: TypeForwardedTo(typeof(Uri))] [assembly: TypeForwardedTo(typeof(UriComponents))] [assembly: TypeForwardedTo(typeof(UriFormat))] [assembly: TypeForwardedTo(typeof(UriFormatException))] [assembly: TypeForwardedTo(typeof(UriHostNameType))] [assembly: TypeForwardedTo(typeof(UriKind))] [assembly: TypeForwardedTo(typeof(ValueType))] [assembly: TypeForwardedTo(typeof(Version))] [assembly: TypeForwardedTo(typeof(void))] [assembly: TypeForwardedTo(typeof(WeakReference))] [assembly: TypeForwardedTo(typeof(WeakReference<>))]