2026-02-19 11:03:22 -05:00
parent 96213d6cb3
commit 023a06c0cd
43 changed files with 9736 additions and 226 deletions

View File

@@ -21,10 +21,21 @@ struct AppConfig
bool bVerboseLogging = false;
};
const std::vector<Vertex> TriangleVertices = {
{ { 0.0f, -0.5f }, { 1.0f, 1.0f, 1.0f } },
{ { 0.5f, 0.5f }, { 0.0f, 1.0f, 0.0f } },
{ { -0.5f, 0.5f }, { 0.0f, 0.0f, 1.0f } }
// const std::vector<Vertex> TriangleVertices = {
// { { 0.0f, -0.5f }, { 1.0f, 1.0f, 1.0f } },
// { { 0.5f, 0.5f }, { 0.0f, 1.0f, 0.0f } },
// { { -0.5f, 0.5f }, { 0.0f, 0.0f, 1.0f } }
// };
const std::vector<Vertex> SquareVertices = {
{ { -0.5f, -0.5f }, { 1.0f, 0.0f, 0.0f } },
{ { 0.5f, -0.5f }, { 0.0f, 1.0f, 0.0f } },
{ { 0.5f, 0.5f }, { 0.0f, 0.0f, 1.0f } },
{ { -0.5f, 0.5f }, { 1.0f, 1.0f, 1.0f } }
};
const std::vector<uint16_t> SquareIndices = {
0, 1, 2, 2, 3, 0
};
class HelloTriangleApplication
@@ -44,7 +55,7 @@ private:
GlfwWindowManager WindowManager;
VulkanContext VkContext;
bool bShowImGui = true;
bool bShowImGui = false;
bool bShowDemo = false;
static void KeyCallback(GLFWwindow* Window, int Key, int Scancode, int Action, int Mods)
@@ -89,7 +100,7 @@ private:
Settings.bVerboseLogging,
WindowManager.GetWindow(),
};
VkContext.Initialize(Config, TriangleVertices);
VkContext.Initialize(Config, SquareVertices, SquareIndices);
}
void InitGlfw()
@@ -141,7 +152,7 @@ private:
}
}
VkContext.DrawFrame(bShowImGui, TriangleVertices.size());
VkContext.DrawFrame(bShowImGui, SquareVertices.size(), SquareIndices.size());
}
}