Enhance examples (#17)

* enhance examples

* doc enhancement

* mv pool to stack

* missing ; and doc update

fix readme example image link
This commit is contained in:
m-aXimilian
2025-10-11 17:23:58 +02:00
committed by Maximilian Kueffner
parent 244b00fa5c
commit 356f966d01
14 changed files with 172 additions and 36 deletions
+25
View File
@@ -52,5 +52,30 @@ If you want to specify compiler settings and options which are not defined in a
cmake -B build -S .
cmake --build build
# Usage
The [examples](https://github.com/m-aXimilian/pixelarium/tree/fd400bf545ade029696c21119a50cf4bb67ffbac/examples) directory aims to showcase a few usage examples of this project.
All there is to do in order to get an initial window on screen is to create an instance of [`AppGLFW`](https://github.com/m-aXimilian/pixelarium/blob/fd400bf545ade029696c21119a50cf4bb67ffbac/lib/app/AppGLFW.hpp) (or one of its child classes) and start it.
```cpp
unique_ptr<ILog> logger = make_unique<SpdLogger>("logfile.log", "loggername");
ImageResourcePool image_pool;
auto app {DefaultApp(*logger, image_pool)};
app.Start();
```
![Default App Screenshot](default-app.png)
## simple
This is the most straight-forward usage of Pixelarium. It simply instantiates a [`DefaultApp`](https://github.com/m-aXimilian/pixelarium/blob/fd400bf545ade029696c21119a50cf4bb67ffbac/lib/app/DefaultApp.hpp) and runs it.
## custom_0
This is meant to showcase that [`DefaultApp`]((https://github.com/m-aXimilian/pixelarium/blob/fd400bf545ade029696c21119a50cf4bb67ffbac/lib/app/DefaultApp.hpp)) ([`AppGLFW`](https://github.com/m-aXimilian/pixelarium/blob/fd400bf545ade029696c21119a50cf4bb67ffbac/lib/app/AppGLFW.hpp) as well) can be customized via inheritance.