Window Name setable through app.run(...)

This commit is contained in:
Ano-sys
2025-04-03 18:56:00 +02:00
parent 847d39906d
commit 498b7594b7
3 changed files with 15 additions and 7 deletions
+9 -4
View File
@@ -558,6 +558,11 @@ void Vulkan::createGraphicsPipeline(){
pipelineInfo.renderPass = renderPass;
pipelineInfo.subpass = 0;
/* Performance optimization entrypoint
pipelineInfo.basePipelineIndex = -1;
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
*/
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS){
throw std::runtime_error("Func; createGraphicsPipeline\nError: Failed to create graphics pipeline!\n");
}
@@ -769,11 +774,11 @@ void Vulkan::drawFrame(){
vkQueuePresentKHR(presentQueue, &presentInfo);
}
void Vulkan::initWindow(){
void Vulkan::initWindow(const char* windowName){
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); // tell glfw to not use opengl
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); // disable window resize
this->window = glfwCreateWindow(static_cast<int>(_width), static_cast<int>(_height), "Vulkan", nullptr, nullptr);
this->window = glfwCreateWindow(static_cast<int>(_width), static_cast<int>(_height), windowName, nullptr, nullptr);
}
void Vulkan::initVulkan(){
@@ -838,11 +843,11 @@ void Vulkan::cleanup(){
glfwTerminate();
}
void Vulkan::run(const uint32_t width, const uint32_t height){
void Vulkan::run(const char* windowName, const uint32_t width, const uint32_t height){
this->_width = width;
this->_height = height;
initWindow();
initWindow(windowName);
initVulkan();
mainLoop();
cleanup();