Added multi triangle support
This commit is contained in:
23
main.cpp
23
main.cpp
@@ -23,20 +23,39 @@ int main()
|
||||
|
||||
/* Initializes GLFW and creates a window */
|
||||
GLFWwindow* window = GLFWManager::Init(800, 600, "Vulkan window");
|
||||
if (!window)
|
||||
if (window == nullptr)
|
||||
return -1;
|
||||
|
||||
/* Runs Vulkan initialisation functions */
|
||||
if (!VulkanManager::Init(window))
|
||||
CleanupAllAndExit(EXIT_FAILURE);
|
||||
|
||||
/* Adds runtime objects */
|
||||
const std::vector vertices = {
|
||||
0.0f, -0.5f,
|
||||
0.5f, 0.9f,
|
||||
-0.5f, 0.5f
|
||||
};
|
||||
|
||||
const std::vector<uint32_t> indices = {0, 1, 2};
|
||||
|
||||
VulkanManager::CreateNewRenderObject(vertices, indices);
|
||||
|
||||
const std::vector otherVertices = {
|
||||
-0.9f, 0.0f,
|
||||
-0.9f, -0.9f,
|
||||
0.0f, -0.9f
|
||||
};
|
||||
|
||||
VulkanManager::CreateNewRenderObject(otherVertices, indices);
|
||||
|
||||
/* Polls window events whilst it is still open */
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
glfwPollEvents();
|
||||
GLFWManager::UpdateWindowTitleFPSInfo();
|
||||
|
||||
if (!VulkanManager::RenderPass(window))
|
||||
if (VulkanManager::RenderPass(window) == false)
|
||||
CleanupAllAndExit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user