O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required