We've already created a project while testing the developing environment. Now let's add two new classes to the project. One class named MyWindow should be derived from QVulkanWindow, and the other class named MyRenderer should be derived from QVulkanWindowRenderer. Implement the window's createRenderer() virtual function:
QVulkanWindowRenderer *MyWindow::createRenderer() { return new MyRenderer(this);}
Add the QVulkanWindow *m_window private field to the renderer class. Implement the constructor to initialize this field and override the startNextFrame() virtual function, as shown:
MyRenderer::MyRenderer(QVulkanWindow *window){ m_window = window;}void MyRenderer::startNextFrame() { m_window->frameReady(); ...