| asset-src | ||
| assets | ||
| src | ||
| vendor | ||
| .clang-format | ||
| .clangd | ||
| .dir-locals.el | ||
| .gitignore | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| justfile | ||
| README.md | ||
Dice GUI
A simple dice rolling GUI app using Clay for layout, Ceramic elements and SDL3 rendering.
Compiling
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.
Code Standards
-
Keep program structure as simple as possible. No
class Applicationor other Java-isms. Prefer namespaces with static lifetime variables. -
Use STL where possible. Don't reinvent the wheel.
-
K&R brackets. With notable exceptions(1)
-
camelCase for variables, PascalCase for types and functions (that's what SDL and Clay do).
-
In class member functions, always use
this->to access member variables. -
constapplies to the name to it's left, so it goes after the type, notconst int x;butint const x. -
* and & flush with the declaration name.
Type const &Function(Type &inRef)
(1) Bracket exceptions:
- using scoped_lock in arbitrary blocks, prefer tailed lisp brackets
struct Data {
int x{ 0 }, y{ 0 };
};
void MyFunction(Data const &data) { // K&R here
DoAsynchronousThings();
{ std::scoped_lock lock{ myMutex };
myVariable++;
} // not quite lisp, lisp with a tail
DoMoreAsynchronousThings();
}