#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>
#include <glm/mat4x4.hpp>
#include<vulkan/vulkan.h>
#include <iostream>
class XFutureWorld
{
public:
XFutureWorld():
window(NULL)
{
}
~XFutureWorld()
{
}
private:
const int WIDTH = 800;
const int HEIGHT = 600;
GLFWwindow* window;
VkInstance instance;
public:
void run()
{
initWindow();
initVulkan();
mainLoop();
cleanUp();
}
private:
void initWindow()
{
//调用glfw 初始化
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
//穿件glfw 窗口
window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan window", nullptr, nullptr);
if(window==NULL)
{
std::cout << "窗口创建失败";
}
}
void initVulkan()
{
createInstance();
}
void mainLoop()
{
while (!glfwWindowShouldClose(wi
创建vulkan instance
最新推荐文章于 2023-04-03 14:19:47 发布