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
+24 -1
View File
@@ -63,5 +63,28 @@ If you want to specify compiler settings and options which are not defined in a
cmake --build build
#+end_src
* TODO Example
* Usage
All there is to do in order to get an initial window on screen is to create an instance of [[file:lib/app/AppGLFW.hpp][=AppGLFW=]] (or one of its child classes) and start it.
#+begin_src C++
unique_ptr<ILog> logger = make_unique<SpdLogger>("logfile.log", "loggername");
ImageResourcePool image_pool;
auto app {DefaultApp(*logger, image_pool)};
app.Start();
#+end_src
This will get the default application on screen which looks like
[[file:doc/figures/default-app.png]]
The [[file:examples/][examples]] directory aims to showcase a few usage examples of this project.
** [[file:examples/simple/][simple]]
This is the most straight-forward usage of Pixelarium. It simply instantiates a [[file:lib/app/DefaultApp.hpp][=DefaultApp=]] and runs it.
** [[file:examples/custom_0/][custom_0]]
This is meant to showcase that [[file:lib/app/DefaultApp.hpp][=DefaultApp=]] ([[file:lib/app/AppGLFW.hpp][=AppGLFW=]] as well) is meant to be customized via inheritance.