Files
VulkanRenderer/main.cpp
2025-11-15 17:03:05 +00:00

37 lines
802 B
C++

#include <vulkan/vulkan.h>
#include <GLFW/glfw3.h>
#include <iostream>
int main()
{
/* Initializes GLFW and creates window */
if (!glfwInit())
{
std::cout << "Failed to initialize GLFW" << std::endl;
return -1;
}
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
const int WIDTH = 800;
const int HEIGHT = 600;
GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan Window", nullptr, nullptr);
if (!window)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
/* Polls window events whilst it is still open */
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
/* Cleans up GLFW */
glfwDestroyWindow(window);
glfwTerminate();
}