#define GLFW_INCLUDE_VULKAN#include <GLFW/glfw3.h>#include <iostream>#include <stdexcept>#include <cstdlib>const int WIDTH = 800;const int HEIGHT = 600;class HelloTriangleApplication {public:void run() {initWindow();initVulkan();mainLoop();cleanup();}private:GLFWwindow* window;void initWindow() {glfwInit();glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan", nullptr, nullptr);}void initVulkan() {}void mainLoop() {while (!glfwWindowShouldClose(window)) {glfwPollEvents();}}void cleanup() {glfwDestroyWindow(window);glfwTerminate();}};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;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。