Refactoring Vulkan initialization and the main loop
Starting from Chapter 3, Getting Started with OpenGL and Vulkan, we introduced an ad hoc rendering loop for each demo application, which resulted in significant code duplication. Let's revisit this topic and learn how to create multiple rendering passes for Vulkan without too much boilerplate code.
Getting ready
Before completing this recipe, make sure to revisit the Putting it all together into a Vulkan application recipe of Chapter 3, Getting Started with OpenGL and Vulkan, as well as all the related recipes.
How to do it...
The goal of this recipe is to improve the rendering framework to avoid code repetition in renderers, as well as to simplify our rendering setup. In the next recipe, as a useful side effect, we will use a system capable of setting up and composing multiple rendering passes without too much hustle.
The main
function for all our upcoming demos should consist of just three lines:
int main...