Putting it all together into a Vulkan application
In the previous recipes, we discussed various sides of the Vulkan initialization process, without rendering anything on screen. Now, let's render our rubber duck 3D model using the Vulkan API.
Getting ready
The final Vulkan demo application for this chapter is located in Chapter3/VK02_DemoApp
.
How to do it...
The main routine is similar to any of the previous OpenGL samples in that it initializes the GLFW library, sets the keyboard callback, initializes any Vulkan-related objects, enters the main loop, and calls the deinitialization routine:
int main() {
- Initialize the
glslang
compiler, the Volk library, and GLFW:glslang_initialize_process(); volkInitialize(); if (!glfwInit()) exit( EXIT_FAILURE ); if (!glfwVulkanSupported()) exit( EXIT_FAILURE );
- Since GLFW was originally an OpenGL helper library...