Add default frame submission function to base class
This commit is contained in:
parent
c5e8c178c2
commit
bb8d4c6df1
2 changed files with 13 additions and 1 deletions
|
|
@ -90,6 +90,15 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
|
||||||
return vkCreateInstance(&instanceCreateInfo, nullptr, &instance);
|
return vkCreateInstance(&instanceCreateInfo, nullptr, &instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VulkanExampleBase::drawFrame()
|
||||||
|
{
|
||||||
|
VulkanExampleBase::prepareFrame();
|
||||||
|
submitInfo.commandBufferCount = 1;
|
||||||
|
submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
|
||||||
|
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||||
|
VulkanExampleBase::submitFrame();
|
||||||
|
}
|
||||||
|
|
||||||
std::string VulkanExampleBase::getWindowTitle()
|
std::string VulkanExampleBase::getWindowTitle()
|
||||||
{
|
{
|
||||||
std::string device(deviceProperties.deviceName);
|
std::string device(deviceProperties.deviceName);
|
||||||
|
|
@ -298,7 +307,7 @@ void VulkanExampleBase::renderLoop()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!IsIconic(window)) {
|
if (prepared && !IsIconic(window)) {
|
||||||
renderFrame();
|
renderFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -319,6 +319,9 @@ public:
|
||||||
|
|
||||||
// Pure virtual render function (override in derived class)
|
// Pure virtual render function (override in derived class)
|
||||||
virtual void render() = 0;
|
virtual void render() = 0;
|
||||||
|
/** @brief (Virtual) Default image acquire and command buffer submission function */
|
||||||
|
virtual void drawFrame();
|
||||||
|
|
||||||
// Called when view change occurs
|
// Called when view change occurs
|
||||||
// Can be overriden in derived class to e.g. update uniform buffers
|
// Can be overriden in derived class to e.g. update uniform buffers
|
||||||
// Containing view dependant matrices
|
// Containing view dependant matrices
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue