Initial commit
This commit is contained in:
37
main.cpp
Normal file
37
main.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user