Skip to content

Commit

Permalink
deploy: 1648596
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Aug 28, 2023
1 parent 04906ed commit 609fc79
Show file tree
Hide file tree
Showing 22 changed files with 84 additions and 73 deletions.
4 changes: 2 additions & 2 deletions classcubos_1_1core_1_1memory_1_1ReadGuard.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li><a href="#autotoc_md43">Usage example</a></li>
<li><a href="#autotoc_md52">Usage example</a></li>
<li>
Reference
<ul>
Expand All @@ -77,7 +77,7 @@ <h3>Contents</h3>
</li>
</ul>
</nav>
<p>This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.</p><section id="autotoc_md43"><h3><a href="#autotoc_md43">Usage example</a></h3><pre class="m-code"><span class="k">using</span><span class="w"> </span><span class="n">AssetMetaRead</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">core</span><span class="o">::</span><span class="n">memory</span><span class="o">::</span><span class="n">ReadGuard</span><span class="o">&lt;</span><span class="n">AssetMeta</span><span class="p">,</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">shared_lock</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">shared_mutex</span><span class="o">&gt;&gt;</span><span class="p">;</span></pre></section>
<p>This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.</p><section id="autotoc_md52"><h3><a href="#autotoc_md52">Usage example</a></h3><pre class="m-code"><span class="k">using</span><span class="w"> </span><span class="n">AssetMetaRead</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">core</span><span class="o">::</span><span class="n">memory</span><span class="o">::</span><span class="n">ReadGuard</span><span class="o">&lt;</span><span class="n">AssetMeta</span><span class="p">,</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">shared_lock</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">shared_mutex</span><span class="o">&gt;&gt;</span><span class="p">;</span></pre></section>
<section id="typeless-methods">
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
<dl class="m-doc">
Expand Down
6 changes: 3 additions & 3 deletions classcubos_1_1core_1_1memory_1_1Stream.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li><a href="#autotoc_md45">Motivation</a></li>
<li><a href="#autotoc_md54">Motivation</a></li>
<li>
Reference
<ul>
Expand All @@ -63,7 +63,7 @@ <h3>Contents</h3>
</li>
</ul>
</nav>
<section id="autotoc_md45"><h3><a href="#autotoc_md45">Motivation</a></h3><p>Why do we have our own streams? Well, the standard library streams are hard to use and extend, and very template heavy. Using our own streams allows us to abstract away more easily where the data is coming from, or going to, allowing us, for example, to embed files into the executable and not have to worry about the code that reads them.</p></section>
<section id="autotoc_md54"><h3><a href="#autotoc_md54">Motivation</a></h3><p>Why do we have our own streams? Well, the standard library streams are hard to use and extend, and very template heavy. Using our own streams allows us to abstract away more easily where the data is coming from, or going to, allowing us, for example, to embed files into the executable and not have to worry about the code that reads them.</p></section>
<section id="derived-classes">
<h2><a href="#derived-classes">Derived classes</a></h2>
<dl class="m-doc">
Expand Down Expand Up @@ -652,7 +652,7 @@ <h3>
</tr>
</tbody>
</table>
<h5 id="autotoc_md46">Usage</h5><pre class="m-code"><span class="n">stream</span><span class="p">.</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Hello, {}!</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;world&quot;</span><span class="p">);</span>
<h5 id="autotoc_md55">Usage</h5><pre class="m-code"><span class="n">stream</span><span class="p">.</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Hello, {}!</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;world&quot;</span><span class="p">);</span>
<span class="n">stream</span><span class="p">.</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;{} + {} = {}</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">);</span>
<span class="n">stream</span><span class="p">.</span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">{} {}</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">);</span><span class="w"> </span><span class="c1">// This will print &quot;{} 2&quot;</span></pre>
</div></section>
Expand Down
4 changes: 2 additions & 2 deletions classcubos_1_1core_1_1memory_1_1WriteGuard.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li><a href="#autotoc_md44">Usage example</a></li>
<li><a href="#autotoc_md53">Usage example</a></li>
<li>
Reference
<ul>
Expand All @@ -77,7 +77,7 @@ <h3>Contents</h3>
</li>
</ul>
</nav>
<p>This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.</p><section id="autotoc_md44"><h3><a href="#autotoc_md44">Usage example</a></h3><pre class="m-code"><span class="k">using</span><span class="w"> </span><span class="n">AssetMetaWrite</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">core</span><span class="o">::</span><span class="n">memory</span><span class="o">::</span><span class="n">WriteGuard</span><span class="o">&lt;</span><span class="n">AssetMeta</span><span class="p">,</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">unique_lock</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">shared_mutex</span><span class="o">&gt;&gt;</span><span class="p">;</span></pre></section>
<p>This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.</p><section id="autotoc_md53"><h3><a href="#autotoc_md53">Usage example</a></h3><pre class="m-code"><span class="k">using</span><span class="w"> </span><span class="n">AssetMetaWrite</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">core</span><span class="o">::</span><span class="n">memory</span><span class="o">::</span><span class="n">WriteGuard</span><span class="o">&lt;</span><span class="n">AssetMeta</span><span class="p">,</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">unique_lock</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">shared_mutex</span><span class="o">&gt;&gt;</span><span class="p">;</span></pre></section>
<section id="typeless-methods">
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
<dl class="m-doc">
Expand Down
13 changes: 12 additions & 1 deletion contribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ <h1>
Contribution guidelines
</h1>
<p>Guide on the project&#x27;s conventions and code style.</p>
<p><a name="md_docs_pages_4_contribution_main"></a></p><aside class="m-note m-info"><h4>Note</h4><p>Under construction.</p></aside>
<p><a name="md_docs_pages_4_contribution_main"></a></p><section id="autotoc_md36"><h2><a href="#autotoc_md36">Commits</a></h2><p>Commits should be concise and small, such that they are easy to review. Avoid at all costs including non-related changes in a commit - use <code>git add -p</code> or something similar to force yourself to review the changes you are commiting, and to avoid accidentally commiting unrelated changes.</p><p>Commits should follow <a href="https://www.conventionalcommits.org/">Conventional Commits</a> and be written in imperative mood. We use the scopes <code>core</code>, <code>engine</code> and <code>tools</code>. When making a commit which affects more than one of these scopes, you can ommit the scope.</p><p>If your description is too long, you can add a body to the commit message. The body should be separated from the description by a blank line.</p><p>Examples of good commit messages:</p><pre class="m-code">feat(core): add CUBOS_FAIL, CUBOS_UNREACHABLE and CUBOS_DEBUG_ASSERT
test(core): move filesystem tests to data/fs
fix(core): fix segfault when popping a sub context
feat(engine): implement system for sweeping the markers
docs(engine): add comments to colliders
chore: replace GoogleTest submodule with doctest</pre><p>Examples of bad commit messages:</p><pre class="m-code">fix: fix bug
make it work
feat(core): Add CUBOS_FAIL
docs(engine): added comments to colliders</pre></section><section id="autotoc_md37"><h2><a href="#autotoc_md37">Pull Requests</a></h2><p>Pull requests should be concise and small, and if needed, split into multiple smaller PRs so that they are easier to review. If your PR is still not finished, mark it as a draft. When working on new features, draft PRs should be created so that other contributors can have an idea of what is being worked on.</p><p>Any features added in a PR should be covered by tests and documentation, including new examples demonstrating the feature.</p></section><section id="autotoc_md38"><h2><a href="#autotoc_md38">Documentation</a></h2><p>We use <a href="https://www.doxygen.nl/index.html">Doxygen</a> for documentation, which means that the documentation is mostly written in the code itself. When adding new files, classes, functions, etc, make sure to at least add a triple slash comment (<code>///</code>) with a <code>@brief</code> section describing what it does, otherwise Doxygen will omit it from the documentation.</p><p>Make sure to document all function parameters, template parameters and return values. Take a look at other files to get a grasp of the documentation style we use.</p><p>When changing the code, the documentation should be updated accordingly.</p><section id="autotoc_md39"><h3><a href="#autotoc_md39">Plugins</a></h3><p>Engine plugins should document which components and resources they add, which tags and settings are used, and how to use them. Take a look at the documentation of other plugins such as the <a href="group__renderer-plugin.html" class="m-doc">renderer plugin</a> to get an idea of how it should look like.</p><p>Every type or function that is part of the public API of a plugin should be added to its corresponding <code>group</code> in the Doxygen documentation, using the <code>@ingroup</code> tag.</p></section></section><section id="autotoc_md40"><h2><a href="#autotoc_md40">Code Style</a></h2><section id="autotoc_md41"><h3><a href="#autotoc_md41">Casing</a></h3><p>We use <code>camelCase</code> for functions, methods, local variables and fields. Private fields are prefixed with <code>m</code> (e.g. <code>mMyField</code>). <code>PascalCase</code> is used for class names and constants. <code>UPPER_CASE</code> is used for macros. <code>snake_case</code> is used for namespaces, folders and files.</p></section><section id="autotoc_md42"><h3><a href="#autotoc_md42">Formatting</a></h3><p>Code is formatted using <a href="https://clang.llvm.org/docs/ClangFormat.html">clang format</a>. Although we have an action that runs clang format on every PR, it is recommended that you run it locally before commiting your changes, to make it easier for the reviewers to read your code.</p><p>We also check the code with <a href="https://clang.llvm.org/extra/clang-tidy/">clang tidy</a>, which is a static analysis tool which picks up many common mistakes and code smell. This runs on every commit you push to your branch.</p></section><section id="autotoc_md43"><h3><a href="#autotoc_md43">Macros</a></h3><p>Avoid using macros whenever possible - use <code>constexpr</code> variables or functions instead. If you do need to use a macro to make an implementation more readable, restrict the macro to the source file where it is used. Defining macros in header files is heavily discouraged.</p></section><section id="autotoc_md44"><h3><a href="#autotoc_md44">Namespaces</a></h3><p>Avoid <code>using namespace</code> in header files. In source files, prefer <code>using foo::bar::X</code> over <code>using namespace foo::bar</code>. If your code is under the namespace <code>foo::bar</code>, you can use <code>using namespace foo::bar</code> in the source files, to make the code more readable.</p><p>When closing a namespace the namespace name should be added as a comment. E.g.:</p><pre class="m-code"><span class="k">namespace</span><span class="w"> </span><span class="nn">foo</span>
<span class="p">{</span>
<span class="w"> </span><span class="p">...</span>
<span class="p">}</span><span class="w"> </span><span class="c1">// namespace foo</span></pre></section></section>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions group__asset-explorer-tool-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ <h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li><a href="#autotoc_md76">Events</a></li>
<li><a href="#autotoc_md77">Dependencies</a></li>
<li><a href="#autotoc_md85">Events</a></li>
<li><a href="#autotoc_md86">Dependencies</a></li>
<li>
Reference
<ul>
Expand All @@ -62,7 +62,7 @@ <h3>Contents</h3>
</li>
</ul>
</nav>
<section id="autotoc_md76"><h3><a href="#autotoc_md76">Events</a></h3><ul><li><a href="structcubos_1_1engine_1_1tools_1_1AssetSelectedEvent.html" class="m-doc">AssetSelectedEvent</a> - sent when an asset is selected in the explorer.</li></ul></section><section id="autotoc_md77"><h3><a href="#autotoc_md77">Dependencies</a></h3><ul><li><a href="group__imgui-plugin.html" class="m-doc">ImGui integration</a></li><li><a href="group__assets-plugin.html" class="m-doc">Assets</a></li></ul></section>
<section id="autotoc_md85"><h3><a href="#autotoc_md85">Events</a></h3><ul><li><a href="structcubos_1_1engine_1_1tools_1_1AssetSelectedEvent.html" class="m-doc">AssetSelectedEvent</a> - sent when an asset is selected in the explorer.</li></ul></section><section id="autotoc_md86"><h3><a href="#autotoc_md86">Dependencies</a></h3><ul><li><a href="group__imgui-plugin.html" class="m-doc">ImGui integration</a></li><li><a href="group__assets-plugin.html" class="m-doc">Assets</a></li></ul></section>
<section id="files">
<h2><a href="#files">Files</a></h2>
<dl class="m-doc">
Expand Down
12 changes: 6 additions & 6 deletions group__assets-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ <h1>
<nav class="m-block m-default">
<h3>Contents</h3>
<ul>
<li><a href="#autotoc_md47">Settings</a></li>
<li><a href="#autotoc_md48">Events</a></li>
<li><a href="#autotoc_md49">Resources</a></li>
<li><a href="#autotoc_md50">Startup tags</a></li>
<li><a href="#autotoc_md51">Tags</a></li>
<li><a href="#autotoc_md56">Settings</a></li>
<li><a href="#autotoc_md57">Events</a></li>
<li><a href="#autotoc_md58">Resources</a></li>
<li><a href="#autotoc_md59">Startup tags</a></li>
<li><a href="#autotoc_md60">Tags</a></li>
<li>
Reference
<ul>
Expand All @@ -66,7 +66,7 @@ <h3>Contents</h3>
</li>
</ul>
</nav>
<section id="autotoc_md47"><h3><a href="#autotoc_md47">Settings</a></h3><ul><li><code>assets.io.enabled</code> - whether asset I/O should be done (default: <code>true</code>).</li><li><code>assets.io.path</code> - path to the assets directory - will be mounted to <code>/assets/</code> (default: <code>assets/</code>).</li><li><code>assets.io.readOnly</code> - if true, the assets directory will be mounted as read-only (default: <code>true</code>).</li></ul></section><section id="autotoc_md48"><h3><a href="#autotoc_md48">Events</a></h3><ul><li>AssetEvent - (TODO) emitted when an asset is either loaded, modified or unloaded.</li></ul></section><section id="autotoc_md49"><h3><a href="#autotoc_md49">Resources</a></h3><ul><li><a href="classcubos_1_1engine_1_1Assets.html" class="m-doc">Assets</a> - the asset manager, used to access asset data.</li></ul></section><section id="autotoc_md50"><h3><a href="#autotoc_md50">Startup tags</a></h3><ul><li><code>cubos.assets.init</code> - initializes the assets manager and loads the meta files (after <code>cubos.settings</code>).</li><li><code>cubos.assets.bridge</code> - systes which add bridges to the asset manager should be tagged with this.</li><li><code>cubos.assets</code> - systems which load assets should be tagged with this.</li></ul></section><section id="autotoc_md51"><h3><a href="#autotoc_md51">Tags</a></h3><ul><li><code>cubos.assets.cleanup</code> - frees any assets no longer in use.</li></ul></section>
<section id="autotoc_md56"><h3><a href="#autotoc_md56">Settings</a></h3><ul><li><code>assets.io.enabled</code> - whether asset I/O should be done (default: <code>true</code>).</li><li><code>assets.io.path</code> - path to the assets directory - will be mounted to <code>/assets/</code> (default: <code>assets/</code>).</li><li><code>assets.io.readOnly</code> - if true, the assets directory will be mounted as read-only (default: <code>true</code>).</li></ul></section><section id="autotoc_md57"><h3><a href="#autotoc_md57">Events</a></h3><ul><li>AssetEvent - (TODO) emitted when an asset is either loaded, modified or unloaded.</li></ul></section><section id="autotoc_md58"><h3><a href="#autotoc_md58">Resources</a></h3><ul><li><a href="classcubos_1_1engine_1_1Assets.html" class="m-doc">Assets</a> - the asset manager, used to access asset data.</li></ul></section><section id="autotoc_md59"><h3><a href="#autotoc_md59">Startup tags</a></h3><ul><li><code>cubos.assets.init</code> - initializes the assets manager and loads the meta files (after <code>cubos.settings</code>).</li><li><code>cubos.assets.bridge</code> - systes which add bridges to the asset manager should be tagged with this.</li><li><code>cubos.assets</code> - systems which load assets should be tagged with this.</li></ul></section><section id="autotoc_md60"><h3><a href="#autotoc_md60">Tags</a></h3><ul><li><code>cubos.assets.cleanup</code> - frees any assets no longer in use.</li></ul></section>
<section id="files">
<h2><a href="#files">Files</a></h2>
<dl class="m-doc">
Expand Down
Loading

0 comments on commit 609fc79

Please sign in to comment.