Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access