General structure

在上一节中,我们创建了一个正确配置、可运行的的Vulkan应用程序,并使用测试代码进行了测试。本节中我们从头开始,使用如下代码构建一个基于GLFW的Vulkan应用程序原型框架的雏形。

Android培训,安卓培训,手机开发培训,移动开发培训,云培训培训

#include <vulkan/vulkan.h>#include <iostream>#include <stdexcept>#include <functional>class HelloTriangleApplication {public:    void run() {
        initVulkan();
        mainLoop();
        cleanup();
    }private:    void initVulkan() {

    }    void mainLoop() {

    }    void cleanup() {

    }
};int main() {
    HelloTriangleApplication app;    try {
        app.run();
    } catch (const std::runtime_error& e) {
        std::cerr << e.what() << std::endl;        return EXIT_FAILURE;
    }    return EXIT_SUCCESS;
}

Android培训,安卓培训,手机开发培训,移动开发培训,云培训培训

网友评论