diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..80a7ef8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vulkan-test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..be7c8a9 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -std=c++17 -O2 +LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi + +vulkan-test: src/main.cpp + g++ $(CFLAGS) -o vulkan-test src/main.cpp $(LDFLAGS) + +.PHONY: test clean + +test: vulkan-test + ./vulkan-test + +clean: + rm -r vulkan-test diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..37e10ce --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,37 @@ +#define GLFW_INCLUDE_VULKAN +#include + +#define GLM_FORCE_RADIANS +#define GLM_FORCE_DEPth_ZERO_TO_ONE +#include +#include + +#include + +int main() +{ + glfwInit(); + + glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); + GLFWwindow* window = glfwCreateWindow(800, 600, "Vulkan window", nullptr, nullptr); + + uint32_t extensionCount = 0; + vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr); + + std::cout << extensionCount << " extensions supported\n"; + + glm::mat4 matrix; + glm::vec4 vec; + auto test = matrix * vec; + + while (!glfwWindowShouldClose(window)) + { + glfwPollEvents(); + } + + glfwDestroyWindow(window); + + glfwTerminate(); + + return 0; +}