169 lines
9.8 KiB
HTML
169 lines
9.8 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.13.2"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>EnTT: Crash Course: configuration</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">EnTT<span id="projectnumber"> 3.15.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',false);
|
|
$(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){ initResizable(false); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div><!-- top -->
|
|
<div id="doc-content">
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">Crash Course: configuration</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p><a class="anchor" id="crash-course-configuration"></a></p>
|
|
<h1><a class="anchor" id="table-of-contents"></a>
|
|
Table of Contents</h1>
|
|
<ul>
|
|
<li><a class="el" href="#introduction">Introduction</a></li>
|
|
<li><a class="el" href="#definitions">Definitions</a><ul>
|
|
<li><a class="el" href="#entt_noexception">ENTT_NOEXCEPTION</a></li>
|
|
<li><a class="el" href="#entt_use_atomic">ENTT_USE_ATOMIC</a></li>
|
|
<li><a class="el" href="#entt_id_type">ENTT_ID_TYPE</a></li>
|
|
<li><a class="el" href="#entt_sparse_page">ENTT_SPARSE_PAGE</a></li>
|
|
<li><a class="el" href="#entt_packed_page">ENTT_PACKED_PAGE</a></li>
|
|
<li><a class="el" href="#entt_assert">ENTT_ASSERT</a><ul>
|
|
<li><a class="el" href="#entt_assert_constexpr">ENTT_ASSERT_CONSTEXPR</a></li>
|
|
<li><a class="el" href="#entt_disable_assert">ENTT_DISABLE_ASSERT</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="el" href="#entt_no_eto">ENTT_NO_ETO</a></li>
|
|
<li><a class="el" href="#entt_standard_cpp">ENTT_STANDARD_CPP</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h1><a class="anchor" id="introduction"></a>
|
|
Introduction</h1>
|
|
<p><code>EnTT</code> has become almost completely customizable over time, in many respects. These variables are just one of the many ways to customize how it works.<br />
|
|
In the vast majority of cases, users will have no interest in changing the default parameters. For all other cases, the list of possible configurations with which it is possible to adjust the behavior of the library at runtime can be found below.</p>
|
|
<h1><a class="anchor" id="definitions"></a>
|
|
Definitions</h1>
|
|
<p>All options are intended as parameters to the compiler (or user-defined macros within the compilation units, if preferred).<br />
|
|
Each parameter can result in internal library definitions. It is not recommended to try to also modify these definitions, since there is no guarantee that they will remain stable over time unlike the options below.</p>
|
|
<h2><a class="anchor" id="entt_noexception"></a>
|
|
ENTT_NOEXCEPTION</h2>
|
|
<p>Define this variable without assigning any value to it to turn off exception handling in <code>EnTT</code>.<br />
|
|
This is roughly equivalent to setting the compiler flag <code>-fno-exceptions</code> but is also limited to this library only.</p>
|
|
<h2><a class="anchor" id="entt_use_atomic"></a>
|
|
ENTT_USE_ATOMIC</h2>
|
|
<p>In general, <code>EnTT</code> does not offer primitives to support multi-threading. Many of the features can be split over multiple threads without any explicit control and the user is the one who knows if a synchronization point is required.<br />
|
|
However, some features are not easily accessible to users and are made thread-safe by means of this definition.</p>
|
|
<h2><a class="anchor" id="entt_id_type"></a>
|
|
ENTT_ID_TYPE</h2>
|
|
<p><code><a class="el" href="namespaceentt.html#a620d583c0e6d64acf3d394524bb72303" title="Alias declaration for type identifiers.">entt::id_type</a></code> is directly controlled by this definition and widely used within the library.<br />
|
|
By default, its type is <code>std::uint32_t</code>. However, users can define a different default type if necessary.</p>
|
|
<h2><a class="anchor" id="entt_sparse_page"></a>
|
|
ENTT_SPARSE_PAGE</h2>
|
|
<p>It is known that the ECS module of <code>EnTT</code> is based on <em>sparse sets</em>. What is less known perhaps is that the sparse arrays are paged to reduce memory usage.<br />
|
|
Default size of pages (that is, the number of elements they contain) is 4096 but users can adjust it if appropriate. In all cases, the chosen value <b>must</b> be a power of 2.</p>
|
|
<h2><a class="anchor" id="entt_packed_page"></a>
|
|
ENTT_PACKED_PAGE</h2>
|
|
<p>As it happens with sparse arrays, packed arrays are also paginated. However, in this case the aim is not to reduce memory usage but to have pointer stability upon component creation.<br />
|
|
Default size of pages (that is, the number of elements they contain) is 1024 but users can adjust it if appropriate. In all cases, the chosen value <b>must</b> be a power of 2.</p>
|
|
<h2><a class="anchor" id="entt_assert"></a>
|
|
ENTT_ASSERT</h2>
|
|
<p>For performance reasons, <code>EnTT</code> does not use exceptions or any other control structures. In fact, it offers many features that result in undefined behavior if not used correctly.<br />
|
|
To get around this, the library relies on a lot of asserts for the purpose of detecting errors in debug builds. By default, it uses <code>assert</code> internally. Users are allowed to overwrite its behavior by setting this variable.</p>
|
|
<h3><a class="anchor" id="entt_assert_constexpr"></a>
|
|
ENTT_ASSERT_CONSTEXPR</h3>
|
|
<p>Usually, an assert within a <code>constexpr</code> function is not a big deal. However, in case of extreme customizations, it might be useful to differentiate.<br />
|
|
For this purpose, <code>EnTT</code> introduces an admittedly badly named variable to make the job easier in this regard. By default, this variable forwards its arguments to <code>ENTT_ASSERT</code>.</p>
|
|
<h3><a class="anchor" id="entt_disable_assert"></a>
|
|
ENTT_DISABLE_ASSERT</h3>
|
|
<p>Assertions may in turn affect performance to an extent when enabled. Whether <code>ENTT_ASSERT</code> and <code>ENTT_ASSERT_CONSTEXPR</code> are redefined or not, all asserts can be disabled at once by means of this definition.<br />
|
|
Note that <code>ENTT_DISABLE_ASSERT</code> takes precedence over the redefinition of the other variables and is therefore meant to disable all controls no matter what.</p>
|
|
<h2><a class="anchor" id="entt_no_eto"></a>
|
|
ENTT_NO_ETO</h2>
|
|
<p>In order to reduce memory consumption and increase performance, empty types are never instantiated nor stored by the ECS module of <code>EnTT</code>.<br />
|
|
Use this variable to treat these types like all others and therefore to create a dedicated storage for them.</p>
|
|
<h2><a class="anchor" id="entt_standard_cpp"></a>
|
|
ENTT_STANDARD_CPP</h2>
|
|
<p><code>EnTT</code> mixes non-standard language features with others that are perfectly compliant to offer some of its functionalities.<br />
|
|
This definition prevents the library from using non-standard techniques, that is, functionalities that are not fully compliant with the standard C++.<br />
|
|
While there are no known portability issues at the time of this writing, this should make the library fully portable anyway if needed. </p>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
|
|
</small></address>
|
|
</div><!-- doc-content -->
|
|
</body>
|
|
</html>
|