Compare commits
No commits in common. "454abfce1e34f1e82af1ce35e761fb85d2032193" and "0f9ae51ca0462349e02c7fc966b36da198dfe18c" have entirely different histories.
454abfce1e
...
0f9ae51ca0
|
|
@ -2,4 +2,3 @@
|
||||||
(indent-tabs-mode . t)
|
(indent-tabs-mode . t)
|
||||||
(tab-width . 4)
|
(tab-width . 4)
|
||||||
(lsp-enable-on-type-formatting nil)))
|
(lsp-enable-on-type-formatting nil)))
|
||||||
((c-mode . ((mode . c++))))
|
|
||||||
|
|
|
||||||
94
README.md
94
README.md
|
|
@ -1,14 +1,94 @@
|
||||||
# Dice GUI
|
# Clay SDL3 Template
|
||||||
|
|
||||||
A simple dice rolling GUI app using Clay for layout, Ceramic elements and SDL3 rendering.
|
## Using Template
|
||||||
|
|
||||||
# Compiling
|
### Just use [`just`](https://just.systems/man/en/)
|
||||||
|
|
||||||
Either `git clone --recursive` or remember to `git submodule update --init --recursive`. Then `cmake -S. -Bbuild` and `cmake --build build`. Which compiles `bin/dice-gui`, which you can run.
|
Run `just set-project-name {project name}` first.
|
||||||
|
|
||||||
# Code Standards
|
And remember to `git remote set-url origin {repo}`.
|
||||||
|
|
||||||
* Keep program structure as simple as possible. No `class Application` or other Java-isms. Prefer namespaces with static lifetime variables.
|
### Otherwise
|
||||||
|
|
||||||
|
Modify the CMakeLists.txt manually, just replace CHANGEME with whatever your binary should be called.
|
||||||
|
|
||||||
|
## Compiling
|
||||||
|
|
||||||
|
> Remember to `git submodule update --init --recursive`!
|
||||||
|
|
||||||
|
### Just again
|
||||||
|
|
||||||
|
`just configure` runs cmake configuration and generates a `compile_commands.json`.
|
||||||
|
|
||||||
|
`just build` runs the cmake build.
|
||||||
|
|
||||||
|
### CMake works too, I guess
|
||||||
|
|
||||||
|
`cmake -S. -Bbuild`
|
||||||
|
|
||||||
|
`cmake --build build`
|
||||||
|
|
||||||
|
Same as always
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
### thread_pool.h/cpp
|
||||||
|
|
||||||
|
Thread pool used for parallel GoL generation ticking.
|
||||||
|
|
||||||
|
### application.h/cpp
|
||||||
|
|
||||||
|
UI and layout logic.
|
||||||
|
|
||||||
|
### style.h/cpp
|
||||||
|
|
||||||
|
Reusable UI styling
|
||||||
|
|
||||||
|
### resources.h/cpp
|
||||||
|
|
||||||
|
Font loading.
|
||||||
|
|
||||||
|
### elements.h/cpp
|
||||||
|
|
||||||
|
Reusable UI elements
|
||||||
|
|
||||||
|
### input.h/cpp
|
||||||
|
|
||||||
|
Handling of input events.
|
||||||
|
|
||||||
|
### main.cpp:
|
||||||
|
|
||||||
|
Entrypoint, setup, and main application loop.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
* CMake 3.21 or higher
|
||||||
|
|
||||||
|
* Compiler capable of C++23 and C23.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
### SDL3
|
||||||
|
|
||||||
|
Included as git submodule at `vendor/SDL3/` and dynamically linked.
|
||||||
|
|
||||||
|
### SDL3_ttf
|
||||||
|
|
||||||
|
Included as git submodule at `vendor/SDL3_ttf/` and dynamically linked.
|
||||||
|
|
||||||
|
### Clay
|
||||||
|
|
||||||
|
Included as files in `vendor/clay/clay.h`; Single header library.
|
||||||
|
|
||||||
|
### Clay SDL3 renderer
|
||||||
|
|
||||||
|
Included as files in `vendor/renderer/` and compiled as part of the project.
|
||||||
|
|
||||||
|
> Note: Mildly modified from the official Clay_SDL3_renderer to enable more advanced styling.
|
||||||
|
|
||||||
|
## Code Standards
|
||||||
|
|
||||||
|
* Keep program structure as simple as possible. No `class Application {` class or other Java-isms. Prefer namespaces with static lifetime variables.
|
||||||
|
|
||||||
* Use STL where possible. Don't reinvent the wheel.
|
* Use STL where possible. Don't reinvent the wheel.
|
||||||
|
|
||||||
|
|
@ -18,7 +98,7 @@ Either `git clone --recursive` or remember to `git submodule update --init --rec
|
||||||
|
|
||||||
* In class member functions, always use `this->` to access member variables.
|
* In class member functions, always use `this->` to access member variables.
|
||||||
|
|
||||||
* `const` applies to the name to it's left, so it goes after the type, not `const int x;` but `int const x`.
|
* const applies to the name to it's left, so it goes after the type, not `const int x;` but `int const x`.
|
||||||
|
|
||||||
* \* and & flush with the declaration name. `Type const &Function(Type &inRef)`
|
* \* and & flush with the declaration name. `Type const &Function(Type &inRef)`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue