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;
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 @@ internal class GuiController : IDisposable
io.DeltaTime = deltaSeconds; // DeltaTime is in seconds.
}
private static void UpdateInput()
private void UpdateInput()
{
ImGuiIOPtr io = ImGui.GetIO();
@ -240,7 +240,7 @@ internal class GuiController : IDisposable
}
}
private static void UpdateCursor()
private void UpdateCursor()
{
ImGuiIOPtr io = ImGui.GetIO();
@ -500,6 +500,7 @@ internal class GuiController : IDisposable
commandBuffer.EndRenderPass(renderPass);
}
#region Resources
private unsafe void BuildFontAtlas()
{
ResourceUploader resourceUploader = new ResourceUploader(graphicsDevice);
@ -528,6 +529,7 @@ internal class GuiController : IDisposable
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)

View File

@ -1,2 +0,0 @@
glslangvalidator -V imgui-vertex.glsl -o imgui-vertex.spv -S vert
glslangvalidator -V imgui-frag.glsl -o imgui-frag.spv -S frag

View File

@ -1,13 +0,0 @@
#version 450
layout (location = 0) in vec4 color;
layout (location = 1) in vec2 texCoord;
layout(set = 2, binding = 0) uniform sampler2D Sampler;
layout (location = 0) out vec4 outputColor;
void main()
{
outputColor = color * texture(Sampler, texCoord);
}

View File

@ -1,20 +0,0 @@
#version 450
layout (location = 0) in vec2 in_position;
layout (location = 1) in vec2 in_texCoord;
layout (location = 2) in vec4 in_color;
layout (set = 1, binding = 0) uniform ProjectionMatrixBuffer
{
mat4 projection_matrix;
};
layout (location = 0) out vec4 color;
layout (location = 1) out vec2 texCoord;
void main()
{
gl_Position = projection_matrix * vec4(in_position, 0, 1);
color = in_color;
texCoord = in_texCoord;
}