https://github.com/nathanpotter17/glfw-vulkan
Vulkan + GLFW on Windows 11
https://github.com/nathanpotter17/glfw-vulkan
cmake cpp glfw3 vulkan
Last synced: about 1 month ago
JSON representation
Vulkan + GLFW on Windows 11
- Host: GitHub
- URL: https://github.com/nathanpotter17/glfw-vulkan
- Owner: nathanpotter17
- Created: 2025-02-16T06:45:20.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T15:46:16.000Z (3 months ago)
- Last Synced: 2025-05-14T10:32:38.273Z (about 1 month ago)
- Topics: cmake, cpp, glfw3, vulkan
- Language: C++
- Homepage:
- Size: 1010 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GLFW & Vulkan Template for Windows
This repository contains a simple example of how to use GLFW with Vulkan on Windows only. The example is a simple triangle that is rendered to the screen. \
- The example is informed by the [Vulkan Guide by GLFW](https://www.glfw.org/docs/3.3/vulkan_guide.html)
- The [Vulkan Tutorial](https://vulkan-tutorial.com/Overview) + [Github](https://github.com/Overv/VulkanTutorial/tree/main/code) by Alexander Overvoorde
- The [Vulkan Spec](https://registry.khronos.org/vulkan/specs/latest/pdf/vkspec.pdf)
- Other resources:
- Vulkan YouTube channel + OGLDEV on YouTube
- [Khronos Vulkan Guide](https://github.com/KhronosGroup/Vulkan-Guide)## Dependencies
- [GLFW](https://www.glfw.org/)
- [Vulkan SDK](https://vulkan.lunarg.com/)
- Windows SDK (Only for Windows)
- CMake
- VS Code## Building
I recommend using Ninja as the build system for this project. It is by far the fastest and easiest to use.
First ensure you install the Vulkan SDK for Windows. Add the VULKAN_SDK environment variable to your system if desired. Check install with `vulkaninfo` in the command prompt.
Next, grab glfw from https://github.com/glfw/glfw/releases or simply clone it into your C or Root directory. Then build the glfw library using CMake & Ninja. The following commands should be used to build the library:
```bash
cd glfw
mkdir build
cd build
cmake -G "Ninja" ..
cmake --build ..
ninja install
```That should ensure that the glfw library is built and installed on your system, and links correctly with other required windows libraries.
## Building the Template
To build the example, simply clone the repository and run the following commands in the command prompt:
```cmd
cd glfw-vulkan
build.bat
```## Run Pre-Built Template
To see the example in action, simply run the `run.bat` file in the command prompt. This will run the pre-built executable from the `/build` directory.