What just happened?

We've created a window that will be rendered using Vulkan. The main() function initializes Vulkan, creates a window, passes the instance object to the window, and shows it on the screen. As usual, the final call to exec() starts Qt's event loop. When the window is shown, Qt will call the createRenderer() function on the window and a new renderer object will be created in your implementation of this function. The renderer is attached to the window and will automatically be deleted along with it, so there is no need to delete it manually. Each time the window needs to be painted, Qt will call the renderer's startNextFrame() function. We don't perform any painting yet, so the window remains blank.

It's important that the ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.