This commit is contained in:
25
src/main.cpp
25
src/main.cpp
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user