mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-10 02:41:47 +00:00
d9ca075c86
Library contains barebones implementations for simplified Instance creation Physical Device selection Device creation Swapchain Creation/Recreation Much of the repo is WIP, and there is little to no testing. Also, while a single header file is desired for the future, currently it is structured more like a normal project with .cpp files
50 lines
1.1 KiB
Markdown
50 lines
1.1 KiB
Markdown
# Vk-Bootstrap
|
|
|
|
A Vulkan Utility library meant to jump start a Vulkan Application
|
|
|
|
This library simplifies the tedious process of:
|
|
|
|
* Instance Creation
|
|
* Physical Device Selection
|
|
* Device Creation
|
|
* Getting Queues
|
|
* Swapchain Creation
|
|
|
|
## Example
|
|
|
|
```cpp
|
|
vkbs::InstanceBuilder builder;
|
|
builder.setup_validation_layers()
|
|
.set_app_name ("example")
|
|
.set_default_debug_messenger ();
|
|
auto inst_ret = builder.build ();
|
|
vkbs::Instance inst;
|
|
if (inst_ret.has_value()) {
|
|
// successfully created instance
|
|
inst = inst_ret.value();
|
|
}
|
|
|
|
vkbs::PhysicalDeviceSelector;
|
|
selector.set_instance(inst)
|
|
.set_surface (/* from user created window*/)
|
|
.set_minimum_version (1, 0)
|
|
.require_dedicated_transfer_queue();
|
|
auto phys_ret = selector.select ();
|
|
vkbs::PhysicalDevice phys;
|
|
if (phys_ret.has_value()) {
|
|
// successfully selected a sufficient physical device
|
|
phys = phys_ret.value();
|
|
}
|
|
|
|
vkbs::DeviceBuilder device_builder;
|
|
device_builder.set_physical_device (phys_dev);
|
|
auto dev_ret = device_builder.build ();
|
|
if(dev_ret.has_value()){
|
|
// successfully created a vulkan device
|
|
}
|
|
|
|
```
|
|
|
|
## Building
|
|
|