Home Features Tutorial Guide Reference Modules Third-Party Demo Tests Install
Lifetime of an Object / Command-Line Arguments
Before you create new objects or use existing ones, you should get familiar with the lifetime of objects
It is basically possible to create all objects in liblava on the stack or on the heap
But be careful. You have to take care of the lifetime yourself
This is the general pattern that is used in this library:
- make - Use constructor or factory method (static function to get a shared pointer)
- create - Build the respective object
- destroy - Discard it after your use
The destructor calls the destroy method if it was not called before
void use_buffer_on_stack() {
buffer buf; // make
auto created = buf.create(device, data, size, usage);
if (created) {
// ...
buf.destroy();
}
}
Or look at this method where it is returned as a shared pointer:
buffer::ptr use_buffer_on_heap() {
auto buf = make_buffer();
if (buf->create(device, data, size, usage))
return buf;
return nullptr;
}
--clean, -c
- clean preferences folder
--v_sync, -vs {0|1}
- 0 ➜ vertical sync off
- 1 ➜ vertical sync on
--physical_device, -pd {n}
- n ➜ physical device index
--debug, -d
- validation layer (VK_LAYER_KHRONOS_validation)
--utils, -u
- debug utils extension (VK_EXT_debug_utils)
--renderdoc, -r
- RenderDoc capture layer (VK_LAYER_RENDERDOC_Capture)
--verbose, -v
- verbose debugging
--log, -l {0|1|2|3|4|5|6}
- 0 ➜ trace level
- 1 ➜ debug level
- 2 ➜ info level
- 3 ➜ warn level
- 4 ➜ error level
- 5 ➜ critical level
- 6 ➜ logging off
WIP