All we need is a `window`, `device` and `renderer`.
⇒ All we need is a `window`, `device` and `renderer`
<br/>
**Vulkan** is a low-level, verbose graphics API and such a program can take several hundred lines of code
**Vulkan** is a low-level, verbose graphics API and such a program can take several hundred lines of code.
<br/>
The good news is that **liblava** will help you...
The good news is that **liblava** will help you!
<br/>
```c++
#include<liblava/lava.hpp>
usingnamespacelava;
```
<br/>
⇓ Here are a few examples to get to know `lava`
Here are a few examples to get to know `lava`
<br/>
#### 1. frame init
...
...
@@ -41,7 +56,9 @@ int main(int argc, char* argv[]) {
}
```
This is how to initialize `lava frame` with command line arguments.
This is how to initialize `lava frame` with command line arguments
<br/>
#### 2. run loop
...
...
@@ -67,7 +84,9 @@ frame.add_run([&]() {
returnframe.run();
```
The last line performs a loop with the **run** we added before. If *count* reaches 3 that **loop** will exit.
The last line performs a loop with the **run** we added before - If *count* reaches 3 that **loop** will exit
<br/>
#### 3. window input
...
...
@@ -104,7 +123,11 @@ frame.add_run([&]() {
returnframe.run();
```
Straightforward - with this knowledge in hand let's write **Hello World** now...
<br/>
Straightforward ⇒ With this knowledge in hand let's write our **Hello World** now...
<br/>
#### 4. clear color
...
...
@@ -230,21 +253,33 @@ frame.add_run_end([&]() {
returnframe.run();
```
##### Welcome on **Planet Vulkan**. That's a lot to display a colored window.
<br/>
##### Welcome on **Planet Vulkan** - That's a lot to display a colored window!
<br/>
Phew! Take a closer look at the `build_cmd_bufs` function:
* We create a **command pool** and **command buffers** for each frame of the render target
* And set each command buffer to clear the frame image with some random color
The *VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT* flag specifies the reusage of command buffers.
<br/>
The *VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT* flag specifies the reusage of command buffers
`clean_cmd_bufs` frees all buffers and destroys the command pool - In case of swap chain restoration we simply recreate command buffers with a new random color - This happens for example on window resize
`clean_cmd_bufs` frees all buffers and destroys the command pool. In case of swap chain restoration we simply recreate command buffers with a new random color. This happens for example on window resize.
<br/>
After all, this is a very static example. Vulkan supports a more *dynamic* and common usage by resetting a command pool before recording new commands.
After all, this is a very static example ⇒ Vulkan supports a more *dynamic* and common usage by resetting a command pool before recording new commands
##### What's next? ⇒ Check some <a href="https://git.io/liblava-demo">demos</a> and clone a <a href="https://git.io/liblava-template">starter template</a> to try it out!
Run the **lava** executable to test the [Tutorial examples](tests/tests.cpp). Let it simply flow...
Run the **lava** executable to test the [Tutorial examples](tests/tests.cpp)
Let it simply flow...
<br/>
##### List all tests:
...
...
@@ -390,13 +455,19 @@ lava -t
7. gamepad
8.[imgui demo](#8-imgui-demo)
<br/>
##### Run test 2 for example:
```bash
lava 2
```
The **driver** starts the last test with no command line arguments.
<br/>
The **driver** starts the last test when you provide *no* command line arguments
<br/>
## Build
...
...
@@ -413,11 +484,15 @@ cmake ..
make
```
<br/>
## Install
You can use **liblava** as a *git submodule* in your project. For example like the [starter template](https://git.io/liblava-template).
You can use **liblava** as a *git submodule* in your project ⇒ Like in the [starter template](https://git.io/liblava-template) and [demo](https://git.io/liblava-demo)
<br/>
Alternatively, you can compile and install a specific version for multiple projects:
Alternatively - You can compile and install a specific version for multiple projects:
**[liblava](https://git.io/liblava) is a modern and easy-to-use library for the <a href="https://www.khronos.org/vulkan/" target="_blank">Vulkan</a>® API**
🌋 **[liblava](https://git.io/liblava) A modern and easy-to-use library for the <a href="https://www.khronos.org/vulkan/" target="_blank">Vulkan</a>® API**
**lava**• lean framework that provides **essentials** for **low-level graphics**<br/>specially well suited for **prototyping**, **tooling** and **education**
**lava**is a lean framework that provides **essentials** for **low-level graphics**<br/>and is specially well suited for **prototyping**, **tooling** and **education**
**liblava** is licensed under [MIT License](LICENSE.md) which allows you to use the software for any purpose you might like, including commercial and for-profit use!
**liblava** is licensed under [MIT License](LICENSE.md) which allows you to use the software for any purpose you might like, including commercial and for-profit use.
<br/>
However, this library includes several third-party **Open Source** libraries, which are licensed under their own respective licenses. They all allow static linking with closed source software.
However, this library includes several third-party **Open Source** libraries, which are licensed under their own respective licenses ⇒ They all allow static linking with closed source software
**All copies of liblava must include a copy of the MIT License terms and the copyright notice.**
**All copies of liblava must include a copy of the MIT License terms and the copyright notice**
<br/>
##### Vulkan and the Vulkan logo are trademarks of the <a href="http://www.khronos.org" target="_blank">Khronos Group Inc.</a>