From b5a5d9b1d4725f3001486c9bbd69263ed0918303 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 5 Oct 2024 14:57:26 +0200 Subject: update code style --- contributing.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contributing.md') diff --git a/contributing.md b/contributing.md index eec5bc0..2ff411a 100644 --- a/contributing.md +++ b/contributing.md @@ -22,6 +22,14 @@ - When using libraries of which the header include order is important, make sure to separate the include statements using a blank line (clang-format may sort include statements, but does not sort across empty lines). +- All engine-related code is implemented under the `crepe` namespace, + user-facing APIs under `crepe::api` (the folder structure should also reflect + this). +- `using namespace` may not be used in header files, only in source files. +- Do not (indirectly) include private dependency headers in API header files, + as these are no longer accessible when the engine is installed +- Getter and setter functions are appropriately prefixed with `get_` and + `set_`. ## CMakeLists specific -- cgit v1.2.3 From 08d0b07c19edfe8c81dfe4e21c0d4c1ef128b628 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 9 Oct 2024 14:23:35 +0200 Subject: update contributing.md --- contributing.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'contributing.md') diff --git a/contributing.md b/contributing.md index 2ff411a..9f87ec5 100644 --- a/contributing.md +++ b/contributing.md @@ -30,6 +30,27 @@ as these are no longer accessible when the engine is installed - Getter and setter functions are appropriately prefixed with `get_` and `set_`. +- Doxygen commands are used with a backslash instead of an at-sign (i.e. + `\brief` instead of `@brief`) +- A singleton's instance is always accessed using a getter function that + instantiates its own class as a static variable within the getter function + scope, instead of storing the instance as a member variable directly: + + ```cpp + class Bad { + static Bad instance; + Bad & get_instance() { return instance; } + }; + + class Good { + Good & get_instance() { + static Good instance; + return instance; + } + }; + ``` +- Member variable default values should be directly defined in the class + declaration instead of using the constructor. ## CMakeLists specific -- cgit v1.2.3