commit 04ca0d1d6927391be02c31ee371fa59ba634025f Author: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Sat Nov 15 17:03:05 2025 +0000 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/VulkanRenderer.iml b/.idea/VulkanRenderer.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/VulkanRenderer.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..ead1d8a --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,248 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a116dfe --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..eb9cd20 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +# Sets minimum CMake and C++ Standard version # +cmake_minimum_required (VERSION 4.0) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +project(VulkanRendererProject) +include(FetchContent) + +# Adds Vulkan to the project # +FetchContent_Declare( + VulkanHeaders + GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Headers.git + GIT_TAG v1.3.296 +) + +FetchContent_MakeAvailable(VulkanHeaders) +find_package(Vulkan REQUIRED) + +# Adds GLFW for window creation # +FetchContent_Declare( + glfw + GIT_REPOSITORY https://github.com/glfw/glfw.git + GIT_TAG 3.4 +) + +FetchContent_MakeAvailable(glfw) + +# Creates the output binary +project(VulkanRenderer LANGUAGES CXX) +add_executable(VulkanRenderer + main.cpp +) + +# Links the libraries to the binary # +target_link_libraries(VulkanRenderer PRIVATE + Vulkan::Vulkan + glfw +) diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..0a32d62 --- /dev/null +++ b/main.cpp @@ -0,0 +1,37 @@ +#include +#include + +#include + +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(); +} \ No newline at end of file