updated project structure

This commit is contained in:
max 2024-07-12 17:59:06 +02:00
parent 4b824f3205
commit 777059489c
10 changed files with 8 additions and 15 deletions

View File

@ -13,7 +13,7 @@ internal class GuiController : IDisposable
{ {
public event Action OnGui; public event Action OnGui;
private readonly string shaderContentPath = Path.Combine(System.AppContext.BaseDirectory, "Assets", "Shaders"); private readonly string shaderContentPath = Path.Combine(System.AppContext.BaseDirectory, "Content", "Shaders");
private readonly GraphicsDevice graphicsDevice; private readonly GraphicsDevice graphicsDevice;
private readonly Window mainWindow; private readonly Window mainWindow;
@ -175,7 +175,7 @@ private void UpdatePerFrameImGuiData(float deltaSeconds)
io.DeltaTime = deltaSeconds; // DeltaTime is in seconds. io.DeltaTime = deltaSeconds; // DeltaTime is in seconds.
} }
private static void UpdateInput() private void UpdateInput()
{ {
ImGuiIOPtr io = ImGui.GetIO(); ImGuiIOPtr io = ImGui.GetIO();
@ -240,7 +240,7 @@ private static void UpdateInput()
} }
} }
private static void UpdateCursor() private void UpdateCursor()
{ {
ImGuiIOPtr io = ImGui.GetIO(); ImGuiIOPtr io = ImGui.GetIO();
@ -500,6 +500,7 @@ private void RenderCommandLists(CommandBuffer commandBuffer, Texture renderTextu
commandBuffer.EndRenderPass(renderPass); commandBuffer.EndRenderPass(renderPass);
} }
#region Resources
private unsafe void BuildFontAtlas() private unsafe void BuildFontAtlas()
{ {
ResourceUploader resourceUploader = new ResourceUploader(graphicsDevice); ResourceUploader resourceUploader = new ResourceUploader(graphicsDevice);
@ -528,6 +529,7 @@ out int bytesPerPixel
textureStorage.Add(fontTexture); // <-- The fontTexture seems to get lost after some time (CG?). textureStorage.Add(fontTexture); // <-- The fontTexture seems to get lost after some time (CG?).
this.fontTexture = fontTexture; // <-- So we also keep a reference to make sure it doesn't happen. this.fontTexture = fontTexture; // <-- So we also keep a reference to make sure it doesn't happen.
} }
#endregion
#region Window #region Window
private void CreateWindow(ImGuiViewportPtr vp) private void CreateWindow(ImGuiViewportPtr vp)

View File

@ -10,14 +10,11 @@
<Compile Include="Libraries\FAudio\csharp\FAudio.cs" /> <Compile Include="Libraries\FAudio\csharp\FAudio.cs" />
<Compile Include="Libraries\WellspringCS\WellspringCS.cs" /> <Compile Include="Libraries\WellspringCS\WellspringCS.cs" />
<Compile Include="Libraries\dav1dfile\csharp\dav1dfile.cs" /> <Compile Include="Libraries\dav1dfile\csharp\dav1dfile.cs" />
<Compile Include="Libraries\ImGui.NET\src\ImGui.NET\**\*.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="Libraries\ImGui.NET\src\ImGui.NET\ImGui.NET.csproj" /> <Content Include="Content\**\*.*">
</ItemGroup>
<ItemGroup>
<Content Include="Assets\**\*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>

View File

@ -5,8 +5,6 @@ VisualStudioVersion = 17.10.35013.160
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nerfed.Runtime", "Nerfed.Runtime\Nerfed.Runtime.csproj", "{98E09BAF-587F-4238-89BD-7693C036C233}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nerfed.Runtime", "Nerfed.Runtime\Nerfed.Runtime.csproj", "{98E09BAF-587F-4238-89BD-7693C036C233}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImGui.NET", "Nerfed.Runtime\Libraries\ImGui.NET\src\ImGui.NET\ImGui.NET.csproj", "{4EC3C399-4E09-4A36-B11E-391F0792C1C8}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -17,10 +15,6 @@ Global
{98E09BAF-587F-4238-89BD-7693C036C233}.Debug|Any CPU.Build.0 = Debug|Any CPU {98E09BAF-587F-4238-89BD-7693C036C233}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98E09BAF-587F-4238-89BD-7693C036C233}.Release|Any CPU.ActiveCfg = Release|Any CPU {98E09BAF-587F-4238-89BD-7693C036C233}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98E09BAF-587F-4238-89BD-7693C036C233}.Release|Any CPU.Build.0 = Release|Any CPU {98E09BAF-587F-4238-89BD-7693C036C233}.Release|Any CPU.Build.0 = Release|Any CPU
{4EC3C399-4E09-4A36-B11E-391F0792C1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EC3C399-4E09-4A36-B11E-391F0792C1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EC3C399-4E09-4A36-B11E-391F0792C1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EC3C399-4E09-4A36-B11E-391F0792C1C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE