mirror of
https://github.com/prime31/FNA-VSCode-Template.git
synced 2025-10-31 21:50:44 +07:00
move to using nuget for ImGui.NET
This commit is contained in:
parent
00a70f8f1e
commit
1f1ef82697
45
getFNA.sh
45
getFNA.sh
@ -63,36 +63,6 @@ function updateFNA()
|
||||
}
|
||||
|
||||
|
||||
# Clones FNA from the git master branch
|
||||
function downloadImGui()
|
||||
{
|
||||
checkGit
|
||||
echo "Downloading ImGui..."
|
||||
echo "Temporarily using ImGui.NET branch until ImGui.NET master is updated"
|
||||
#git -C $MY_DIR clone https://github.com/mellinoe/ImGui.NET.git --recursive
|
||||
git -C $MY_DIR clone -b fix-MonoGame-FNA https://github.com/prime31/ImGui.NET.git --recursive
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Finished downloading!"
|
||||
else
|
||||
echo >&2 "ERROR: Unable to download successfully. Maybe try again later?"
|
||||
fi
|
||||
}
|
||||
|
||||
# Pulls FNA from the git master branch
|
||||
function updateImGui()
|
||||
{
|
||||
checkGit
|
||||
echo "Updating to the latest git version of ImGui.NET..."
|
||||
git -C "$MY_DIR/ImGui.NET" pull --recurse-submodules
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Finished updating!\n"
|
||||
else
|
||||
echo >&2 "ERROR: Unable to update."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Downloads and extracts prepackaged archive of native libraries ("fnalibs")
|
||||
function getLibs()
|
||||
{
|
||||
@ -139,14 +109,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Dear ImGui
|
||||
if [ ! -d "$MY_DIR/ImGui.NET" ]; then
|
||||
read -p "Download ImGui.NET (y/n)? " shouldDownload
|
||||
else
|
||||
read -p "Update ImGui.NET (y/n)? " shouldUpdate
|
||||
fi
|
||||
|
||||
|
||||
# act on the input
|
||||
|
||||
# FNA
|
||||
@ -161,13 +123,6 @@ if [[ $shouldDownloadLibs =~ ^[Yy]$ ]]; then
|
||||
getLibs
|
||||
fi
|
||||
|
||||
# Dear ImGui
|
||||
if [[ $shouldDownload =~ ^[Yy]$ ]]; then
|
||||
downloadImGui
|
||||
elif [[ $shouldUpdate =~ ^[Yy]$ ]]; then
|
||||
updateImGui
|
||||
fi
|
||||
|
||||
|
||||
# install t4 engine
|
||||
installT4
|
||||
|
||||
@ -39,8 +39,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{3
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "Nez.FNA\Nez.FNA\Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImGui.NET", "ImGui.NET\src\ImGui.NET\ImGui.NET.csproj", "{AD548A1D-01B2-410E-B3ED-ADAC05C3C4A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8C576ECC-147D-4B4A-8EC1-56533D26A178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
||||
@ -17,9 +17,9 @@ namespace Nez
|
||||
|
||||
public ImGuiFinalRenderDelegate()
|
||||
{
|
||||
var core = typeof(Core).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) as Core;
|
||||
_imGuiRenderer = new ImGuiRenderer(core);
|
||||
_imGuiRenderer = new ImGuiRenderer(Core.instance);
|
||||
_imGuiRenderer.RebuildFontAtlas();
|
||||
ImGui.GetIO().ConfigWindowsMoveFromTitleBarOnly = true;
|
||||
}
|
||||
|
||||
public void handleFinalRender( Color letterboxColor, RenderTarget2D source, Rectangle finalRenderDestinationRect, SamplerState samplerState )
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../FNA/FNA.csproj"/>
|
||||
<ProjectReference Include="../Nez.FNA/Nez.FNA/Nez.FNA.csproj"/>
|
||||
<ProjectReference Include="../ImGui.NET/src/ImGui.NET/ImGui.NET.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Include the Content directory (except for .fx files, since we use .fxb at runtime) -->
|
||||
@ -74,22 +73,30 @@
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy ImGui native code to output -->
|
||||
<PropertyGroup>
|
||||
<ImGuiRuntimes>$(NuGetPackageRoot)\imgui.net\**\runtimes\</ImGuiRuntimes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\ImGui.NET\deps\cimgui\win-x86\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x64'">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<Content Include="$(ImGuiRuntimes)win-x86\native\cimgui.dll" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x64'">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ImGui.NET\deps\cimgui\win-x64\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x86'">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<Content Include="$(ImGuiRuntimes)win-x64\native\cimgui.dll" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x86'">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ImGui.NET\deps\cimgui\osx-x64\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsOSX) == 'true'">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<Content Include="$(ImGuiRuntimes)osx-x64\native\cimgui.dylib" Condition="'$(OS)' != 'Windows_NT' AND $(IsOSX) == 'true'">
|
||||
<Link>libcimgui.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ImGui.NET\deps\cimgui\linux-x64\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<Content Include=".$(ImGuiRuntimes)linux-x64\native\cimgui.so" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ImGui.NET" Version="1.67.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user