Skip to content

Commit ecbc5f2

Browse files
committed
Update sample to be able use NativeAOT
rd.xml file is workaround to SharpDx limitations.
1 parent 57948fe commit ecbc5f2

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/ImGui.NET.SampleProgram/ImGui.NET.SampleProgram.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<PublishAot>true</PublishAot>
78
</PropertyGroup>
89

910
<ItemGroup>
@@ -12,6 +13,10 @@
1213
<PackageReference Include="Veldrid.StartupUtilities" Version="4.8.0" />
1314
<ProjectReference Include="..\ImPlot.NET\ImPlot.NET.csproj" />
1415
</ItemGroup>
16+
17+
<ItemGroup>
18+
<RdXmlFile Include="rd.xml" />
19+
</ItemGroup>
1520

1621
<ItemGroup>
1722
<EmbeddedResource Include="Shaders/GLSL/imgui-vertex.glsl" LogicalName="imgui-vertex.glsl" />

src/ImGui.NET.SampleProgram/rd.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Directives>
3+
<Application>
4+
<Assembly Name="SharpDX.DXGI" Dynamic="Required All">
5+
<Type Name="SharpDX.DXGI.Factory" Dynamic="Required All" />
6+
</Assembly>
7+
<Assembly Name="SharpDX.Direct3D11" Dynamic="Required All">
8+
<Type Name="SharpDX.Direct3D11.Texture2D" Dynamic="Required All" />
9+
</Assembly>
10+
</Application>
11+
</Directives>

0 commit comments

Comments
 (0)