From 777059489c0e461d51d63d02170c8f53280a3cc2 Mon Sep 17 00:00:00 2001 From: max Date: Fri, 12 Jul 2024 17:59:06 +0200 Subject: [PATCH] updated project structure --- .../{Gui => Content}/Shaders/generate-spirv.bat | 0 .../{Gui => Content}/Shaders/imgui-frag.glsl | 0 .../{Assets => Content}/Shaders/imgui-frag.spv | Bin .../{Gui => Content}/Shaders/imgui-vertex.glsl | 0 .../{Assets => Content}/Shaders/imgui-vertex.spv | Bin Nerfed.Runtime/Gui/GuiController.cs | 8 +++++--- Nerfed.Runtime/Gui/Shaders/imgui-frag.spv | Bin 664 -> 0 bytes Nerfed.Runtime/Gui/Shaders/imgui-vertex.spv | Bin 1440 -> 0 bytes Nerfed.Runtime/Nerfed.Runtime.csproj | 9 +++------ Nerfed.sln | 6 ------ 10 files changed, 8 insertions(+), 15 deletions(-) rename Nerfed.Runtime/{Gui => Content}/Shaders/generate-spirv.bat (100%) rename Nerfed.Runtime/{Gui => Content}/Shaders/imgui-frag.glsl (100%) rename Nerfed.Runtime/{Assets => Content}/Shaders/imgui-frag.spv (100%) rename Nerfed.Runtime/{Gui => Content}/Shaders/imgui-vertex.glsl (100%) rename Nerfed.Runtime/{Assets => Content}/Shaders/imgui-vertex.spv (100%) delete mode 100644 Nerfed.Runtime/Gui/Shaders/imgui-frag.spv delete mode 100644 Nerfed.Runtime/Gui/Shaders/imgui-vertex.spv diff --git a/Nerfed.Runtime/Gui/Shaders/generate-spirv.bat b/Nerfed.Runtime/Content/Shaders/generate-spirv.bat similarity index 100% rename from Nerfed.Runtime/Gui/Shaders/generate-spirv.bat rename to Nerfed.Runtime/Content/Shaders/generate-spirv.bat diff --git a/Nerfed.Runtime/Gui/Shaders/imgui-frag.glsl b/Nerfed.Runtime/Content/Shaders/imgui-frag.glsl similarity index 100% rename from Nerfed.Runtime/Gui/Shaders/imgui-frag.glsl rename to Nerfed.Runtime/Content/Shaders/imgui-frag.glsl diff --git a/Nerfed.Runtime/Assets/Shaders/imgui-frag.spv b/Nerfed.Runtime/Content/Shaders/imgui-frag.spv similarity index 100% rename from Nerfed.Runtime/Assets/Shaders/imgui-frag.spv rename to Nerfed.Runtime/Content/Shaders/imgui-frag.spv diff --git a/Nerfed.Runtime/Gui/Shaders/imgui-vertex.glsl b/Nerfed.Runtime/Content/Shaders/imgui-vertex.glsl similarity index 100% rename from Nerfed.Runtime/Gui/Shaders/imgui-vertex.glsl rename to Nerfed.Runtime/Content/Shaders/imgui-vertex.glsl diff --git a/Nerfed.Runtime/Assets/Shaders/imgui-vertex.spv b/Nerfed.Runtime/Content/Shaders/imgui-vertex.spv similarity index 100% rename from Nerfed.Runtime/Assets/Shaders/imgui-vertex.spv rename to Nerfed.Runtime/Content/Shaders/imgui-vertex.spv diff --git a/Nerfed.Runtime/Gui/GuiController.cs b/Nerfed.Runtime/Gui/GuiController.cs index ae610c9..f560b45 100644 --- a/Nerfed.Runtime/Gui/GuiController.cs +++ b/Nerfed.Runtime/Gui/GuiController.cs @@ -13,7 +13,7 @@ internal class GuiController : IDisposable { 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 Window mainWindow; @@ -175,7 +175,7 @@ private void UpdatePerFrameImGuiData(float deltaSeconds) io.DeltaTime = deltaSeconds; // DeltaTime is in seconds. } - private static void UpdateInput() + private void UpdateInput() { ImGuiIOPtr io = ImGui.GetIO(); @@ -240,7 +240,7 @@ private static void UpdateInput() } } - private static void UpdateCursor() + private void UpdateCursor() { ImGuiIOPtr io = ImGui.GetIO(); @@ -500,6 +500,7 @@ private void RenderCommandLists(CommandBuffer commandBuffer, Texture renderTextu commandBuffer.EndRenderPass(renderPass); } + #region Resources private unsafe void BuildFontAtlas() { 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?). this.fontTexture = fontTexture; // <-- So we also keep a reference to make sure it doesn't happen. } + #endregion #region Window private void CreateWindow(ImGuiViewportPtr vp) diff --git a/Nerfed.Runtime/Gui/Shaders/imgui-frag.spv b/Nerfed.Runtime/Gui/Shaders/imgui-frag.spv deleted file mode 100644 index 550f9a08131507837953b6970d98bb906d49c1c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmYk2y-osA5QVR-izv#EC}>O!NKY)(m>6v+Xy_=ciBOn;OK?ei0bk6gvN7@dc9(>k z%+5V$&YU~5QK^3r!d|F`O1KF5X@(L^fGcNtG@gtHpXqFHcYmv*7NSh3rcU2J*;r2B zKP(&)RpN|jptZ&$+#;Mq_@Oa|-R+5C>`ON3YLgC=MY7H``n+W*?`eQ1)8%S0w;pG2 zr1P&~lB{Qx!U$J=t_2*i9=lkN8^T$vi+hAe?A+?zuZ2ooFPlE^X>%{bb%_pocN4o$ zmv4paACiA6urtY7KO*bBt&5#e?vm+G$oh$Q&lX?dRHL9yzj`5(^F6UUd7ST*te<f3}G`R{`3aM#D$ O3$OTpDW7}yxh@@(>*Im<@s7zH_1x)sYf>Kj$;4LuRi^J zkW;SYs1=+Dm6+Ng#X+8rPjE|2E#b}JL(u9Ke6wmrta?XZIE09)i##=mn7){A(k7!X z?+`>CTnQ#W#`f=;$M~4SP0SkdtkI^1TI^!>5#uJl%UFHtWmLu1o{!bWIM!1a<5*8k zV!RGZUXvc2OMeq@k-dR!ai4t}JMRYn%j^xzwKt8g;9Gx(_$s@6u{xgm#2V(b2E6O+ zQOmc}*l$YAdsa$bRo8orS25Q%vD#VJzUrJ(LosXLVs{oXYa6SpnEBgNU%oSLvDvu42NF#GV#V@xf~shM%?@j1S8n^O - + + - - - - - + Always diff --git a/Nerfed.sln b/Nerfed.sln index 30ec14e..be1920e 100644 --- a/Nerfed.sln +++ b/Nerfed.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 17.10.35013.160 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nerfed.Runtime", "Nerfed.Runtime\Nerfed.Runtime.csproj", "{98E09BAF-587F-4238-89BD-7693C036C233}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE