khaotic-engine-Reborn/doxygen_docs/html/classecs_1_1_render_system.html

537 lines
38 KiB
HTML
Raw Blame History

<!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.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Khaotic Engine Reborn: ecs::RenderSystem Class Reference</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="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<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.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">Khaotic Engine Reborn
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;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&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classecs_1_1_render_system.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classecs_1_1_render_system-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">ecs::RenderSystem Class Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4db69fd99c18112dcbaa931a01bb9780" id="r_a4db69fd99c18112dcbaa931a01bb9780"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4db69fd99c18112dcbaa931a01bb9780">RenderSystem</a> (ID3D11DeviceContext *deviceContext, <a class="el" href="classshader__manager__class.html">shader_manager_class</a> *shaderManager)</td></tr>
<tr class="separator:a4db69fd99c18112dcbaa931a01bb9780"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef4d62c3ef06a880712d183a2848de2f" id="r_aef4d62c3ef06a880712d183a2848de2f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aef4d62c3ef06a880712d183a2848de2f">RenderEntity</a> (std::shared_ptr&lt; <a class="el" href="classecs_1_1_entity.html">Entity</a> &gt; entity, const DirectX::XMMATRIX &amp;viewMatrix, const DirectX::XMMATRIX &amp;projectionMatrix, const DirectX::XMFLOAT4 *diffuseColors, const DirectX::XMFLOAT4 *lightPositions, const DirectX::XMFLOAT4 *ambientColors, const DirectX::XMFLOAT3 &amp;cameraPosition, const DirectX::XMFLOAT4 &amp;sunlightDiffuse, const DirectX::XMFLOAT4 &amp;sunlightAmbient, const DirectX::XMFLOAT3 &amp;sunlightDirection, float sunlightIntensity)</td></tr>
<tr class="separator:aef4d62c3ef06a880712d183a2848de2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d65c73dad3be4070153c3f568d5a139" id="r_a8d65c73dad3be4070153c3f568d5a139"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8d65c73dad3be4070153c3f568d5a139">RenderAllEntities</a> (<a class="el" href="classecs_1_1_entity_manager.html">EntityManager</a> *entityManager, const DirectX::XMMATRIX &amp;viewMatrix, const DirectX::XMMATRIX &amp;projectionMatrix, const DirectX::XMFLOAT4 *diffuseColors, const DirectX::XMFLOAT4 *lightPositions, const DirectX::XMFLOAT4 *ambientColors, const DirectX::XMFLOAT3 &amp;cameraPos, const DirectX::XMFLOAT4 &amp;sunlightDiffuse, const DirectX::XMFLOAT4 &amp;sunlightAmbient, const DirectX::XMFLOAT3 &amp;sunlightDirection, float sunlightIntensity)</td></tr>
<tr class="separator:a8d65c73dad3be4070153c3f568d5a139"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="render__system_8h_source.html#l00011">11</a> of file <a class="el" href="render__system_8h_source.html">render_system.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a4db69fd99c18112dcbaa931a01bb9780" name="a4db69fd99c18112dcbaa931a01bb9780"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4db69fd99c18112dcbaa931a01bb9780">&#9670;&#160;</a></span>RenderSystem()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ecs::RenderSystem::RenderSystem </td>
<td>(</td>
<td class="paramtype">ID3D11DeviceContext *</td> <td class="paramname"><span class="paramname"><em>deviceContext</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classshader__manager__class.html">shader_manager_class</a> *</td> <td class="paramname"><span class="paramname"><em>shaderManager</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Builder for the <a class="el" href="classecs_1_1_render_system.html">RenderSystem</a> class. This class is responsible for rendering entities with the necessary components. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">deviceContext</td><td></td></tr>
<tr><td class="paramname">shaderManager</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="render__system_8h_source.html#l00019">19</a> of file <a class="el" href="render__system_8h_source.html">render_system.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 20</span> : m_deviceContext(deviceContext), m_shaderManager(shaderManager) {}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8d65c73dad3be4070153c3f568d5a139" name="a8d65c73dad3be4070153c3f568d5a139"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d65c73dad3be4070153c3f568d5a139">&#9670;&#160;</a></span>RenderAllEntities()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int ecs::RenderSystem::RenderAllEntities </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classecs_1_1_entity_manager.html">EntityManager</a> *</td> <td class="paramname"><span class="paramname"><em>entityManager</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>viewMatrix</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>projectionMatrix</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>diffuseColors</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>lightPositions</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>ambientColors</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT3 &amp;</td> <td class="paramname"><span class="paramname"><em>cameraPos</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightDiffuse</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightAmbient</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT3 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightDirection</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>sunlightIntensity</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Render all entities in the <a class="el" href="classecs_1_1_entity_manager.html">EntityManager</a> that have the necessary components. This method iterates through all entities and renders them if they have the required components. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">entityManager</td><td>The <a class="el" href="classecs_1_1_entity_manager.html">EntityManager</a> containing the entities to render. </td></tr>
<tr><td class="paramname">viewMatrix</td><td>The view matrix for rendering. </td></tr>
<tr><td class="paramname">projectionMatrix</td><td>The projection matrix for rendering. </td></tr>
<tr><td class="paramname">diffuseColors</td><td>Array of diffuse colors for lighting. </td></tr>
<tr><td class="paramname">lightPositions</td><td>Array of light positions for lighting. </td></tr>
<tr><td class="paramname">ambientColors</td><td>Array of ambient colors for lighting. </td></tr>
<tr><td class="paramname">cameraPos</td><td>The position of the camera in world space. </td></tr>
<tr><td class="paramname">sunlightDiffuse</td><td>The diffuse color of sunlight. </td></tr>
<tr><td class="paramname">sunlightAmbient</td><td>The ambient color of sunlight. </td></tr>
<tr><td class="paramname">sunlightDirection</td><td>The direction of sunlight in world space. </td></tr>
<tr><td class="paramname">sunlightIntensity</td><td>The intensity of sunlight. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of entities rendered successfully. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__system_8h_source.html#l00214">214</a> of file <a class="el" href="render__system_8h_source.html">render_system.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 224</span> {</div>
<div class="line"><span class="lineno"> 225</span> </div>
<div class="line"><span class="lineno"> 226</span> <span class="keywordtype">int</span> renderCount = 0;</div>
<div class="line"><span class="lineno"> 227</span> </div>
<div class="line"><span class="lineno"> 228</span> <span class="comment">// R<>cup<75>rer toutes les entit<69>s qui ont les composants RenderComponent et TransformComponent</span></div>
<div class="line"><span class="lineno"> 229</span> <span class="keyword">auto</span> entities = entityManager-&gt;GetEntitiesWithComponent&lt;RenderComponent&gt;();</div>
<div class="line"><span class="lineno"> 230</span> </div>
<div class="line"><span class="lineno"> 231</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; entity : entities) {</div>
<div class="line"><span class="lineno"> 232</span> <span class="keyword">auto</span> render = entity-&gt;GetComponent&lt;RenderComponent&gt;();</div>
<div class="line"><span class="lineno"> 233</span> </div>
<div class="line"><span class="lineno"> 234</span> <span class="comment">// V<>rifier si l&#39;entit<EFBFBD> a un TransformComponent</span></div>
<div class="line"><span class="lineno"> 235</span> <span class="keyword">auto</span> transform = entity-&gt;GetComponent&lt;TransformComponent&gt;();</div>
<div class="line"><span class="lineno"> 236</span> <span class="keywordflow">if</span> (!transform) <span class="keywordflow">continue</span>;</div>
<div class="line"><span class="lineno"> 237</span> </div>
<div class="line"><span class="lineno"> 238</span> <span class="comment">// V<>rifier si le mod<6F>le est visible</span></div>
<div class="line"><span class="lineno"> 239</span> <span class="keywordflow">if</span> (!render-&gt;IsVisible()) <span class="keywordflow">continue</span>;</div>
<div class="line"><span class="lineno"> 240</span> </div>
<div class="line"><span class="lineno"> 241</span> <span class="comment">// Effectuer le rendu</span></div>
<div class="line"><span class="lineno"> 242</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#aef4d62c3ef06a880712d183a2848de2f">RenderEntity</a>(entity, viewMatrix, projectionMatrix, </div>
<div class="line"><span class="lineno"> 243</span> diffuseColors, lightPositions, ambientColors,cameraPos,</div>
<div class="line"><span class="lineno"> 244</span> sunlightDiffuse, sunlightAmbient, sunlightDirection,</div>
<div class="line"><span class="lineno"> 245</span> sunlightIntensity)) {</div>
<div class="line"><span class="lineno"> 246</span> renderCount++;</div>
<div class="line"><span class="lineno"> 247</span> }</div>
<div class="line"><span class="lineno"> 248</span> }</div>
<div class="line"><span class="lineno"> 249</span> </div>
<div class="line"><span class="lineno"> 250</span> <span class="keywordflow">return</span> renderCount;</div>
<div class="line"><span class="lineno"> 251</span> }</div>
<div class="ttc" id="aclassecs_1_1_render_system_html_aef4d62c3ef06a880712d183a2848de2f"><div class="ttname"><a href="#aef4d62c3ef06a880712d183a2848de2f">ecs::RenderSystem::RenderEntity</a></div><div class="ttdeci">bool RenderEntity(std::shared_ptr&lt; Entity &gt; entity, const DirectX::XMMATRIX &amp;viewMatrix, const DirectX::XMMATRIX &amp;projectionMatrix, const DirectX::XMFLOAT4 *diffuseColors, const DirectX::XMFLOAT4 *lightPositions, const DirectX::XMFLOAT4 *ambientColors, const DirectX::XMFLOAT3 &amp;cameraPosition, const DirectX::XMFLOAT4 &amp;sunlightDiffuse, const DirectX::XMFLOAT4 &amp;sunlightAmbient, const DirectX::XMFLOAT3 &amp;sunlightDirection, float sunlightIntensity)</div><div class="ttdef"><b>Definition</b> <a href="render__system_8h_source.html#l00038">render_system.h:38</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="aef4d62c3ef06a880712d183a2848de2f" name="aef4d62c3ef06a880712d183a2848de2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef4d62c3ef06a880712d183a2848de2f">&#9670;&#160;</a></span>RenderEntity()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::RenderSystem::RenderEntity </td>
<td>(</td>
<td class="paramtype">std::shared_ptr&lt; <a class="el" href="classecs_1_1_entity.html">Entity</a> &gt;</td> <td class="paramname"><span class="paramname"><em>entity</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>viewMatrix</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>projectionMatrix</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>diffuseColors</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>lightPositions</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 *</td> <td class="paramname"><span class="paramname"><em>ambientColors</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT3 &amp;</td> <td class="paramname"><span class="paramname"><em>cameraPosition</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightDiffuse</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT4 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightAmbient</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const DirectX::XMFLOAT3 &amp;</td> <td class="paramname"><span class="paramname"><em>sunlightDirection</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>sunlightIntensity</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Render an entity with the necessary components. This method checks if the entity has the required components and renders it using the appropriate shader. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">entity</td><td>The entity to render. </td></tr>
<tr><td class="paramname">viewMatrix</td><td>The view matrix for rendering. </td></tr>
<tr><td class="paramname">projectionMatrix</td><td>The projection matrix for rendering. </td></tr>
<tr><td class="paramname">diffuseColors</td><td>Array of diffuse colors for lighting. </td></tr>
<tr><td class="paramname">lightPositions</td><td>Array of light positions for lighting. </td></tr>
<tr><td class="paramname">ambientColors</td><td>Array of ambient colors for lighting. </td></tr>
<tr><td class="paramname">cameraPosition</td><td>The position of the camera in world space. </td></tr>
<tr><td class="paramname">sunlightDiffuse</td><td>The diffuse color of sunlight. </td></tr>
<tr><td class="paramname">sunlightAmbient</td><td>The ambient color of sunlight. </td></tr>
<tr><td class="paramname">sunlightDirection</td><td>The direction of sunlight in world space. </td></tr>
<tr><td class="paramname">sunlightIntensity</td><td>The intensity of sunlight. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if rendering was successful, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__system_8h_source.html#l00038">38</a> of file <a class="el" href="render__system_8h_source.html">render_system.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
<div class="line"><span class="lineno"> 49</span> </div>
<div class="line"><span class="lineno"> 50</span> <span class="comment">// V<>rifier si l&#39;entit<EFBFBD> a tous les composants n<>cessaires</span></div>
<div class="line"><span class="lineno"> 51</span> <span class="keyword">auto</span> transform = entity-&gt;GetComponent&lt;TransformComponent&gt;();</div>
<div class="line"><span class="lineno"> 52</span> <span class="keyword">auto</span> render = entity-&gt;GetComponent&lt;RenderComponent&gt;();</div>
<div class="line"><span class="lineno"> 53</span> <span class="keyword">auto</span> shader = entity-&gt;GetComponent&lt;ShaderComponent&gt;();</div>
<div class="line"><span class="lineno"> 54</span> </div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">if</span> (!transform || !render || !shader || !render-&gt;GetModel())</div>
<div class="line"><span class="lineno"> 56</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 57</span> </div>
<div class="line"><span class="lineno"> 58</span> <span class="comment">// Calculer la matrice monde</span></div>
<div class="line"><span class="lineno"> 59</span> XMMATRIX scaleMatrix = transform-&gt;GetScaleMatrix();</div>
<div class="line"><span class="lineno"> 60</span> XMMATRIX rotateMatrix = transform-&gt;GetRotateMatrix();</div>
<div class="line"><span class="lineno"> 61</span> XMMATRIX translateMatrix = transform-&gt;GetTranslateMatrix();</div>
<div class="line"><span class="lineno"> 62</span> </div>
<div class="line"><span class="lineno"> 63</span> XMMATRIX worldMatrix = XMMatrixMultiply(</div>
<div class="line"><span class="lineno"> 64</span> XMMatrixMultiply(scaleMatrix, rotateMatrix),</div>
<div class="line"><span class="lineno"> 65</span> translateMatrix</div>
<div class="line"><span class="lineno"> 66</span> );</div>
<div class="line"><span class="lineno"> 67</span> </div>
<div class="line"><span class="lineno"> 68</span> <span class="comment">// Rendre le mod<6F>le</span></div>
<div class="line"><span class="lineno"> 69</span> render-&gt;Render(m_deviceContext);</div>
<div class="line"><span class="lineno"> 70</span> </div>
<div class="line"><span class="lineno"> 71</span> <span class="comment">// S<>lectionner le shader appropri<72></span></div>
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">switch</span> (shader-&gt;GetActiveShader()) {</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">case</span> ShaderType::ALPHA_MAPPING:</div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_alpha_map_shader(</div>
<div class="line"><span class="lineno"> 75</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 76</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 77</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 78</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 79</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 80</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 81</span> render-&gt;GetTexture(TextureType::Diffuse, 1),</div>
<div class="line"><span class="lineno"> 82</span> render-&gt;GetTexture(TextureType::Alpha, 0)</div>
<div class="line"><span class="lineno"> 83</span> );</div>
<div class="line"><span class="lineno"> 84</span> </div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">case</span> ShaderType::CEL_SHADING:</div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_cel_shading_shader(</div>
<div class="line"><span class="lineno"> 87</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 88</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 89</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 90</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 91</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 92</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 93</span> sunlightDiffuse,</div>
<div class="line"><span class="lineno"> 94</span> sunlightAmbient,</div>
<div class="line"><span class="lineno"> 95</span> sunlightDirection,</div>
<div class="line"><span class="lineno"> 96</span> sunlightIntensity</div>
<div class="line"><span class="lineno"> 97</span> );</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">case</span> ShaderType::NORMAL_MAPPING:</div>
<div class="line"><span class="lineno"> 100</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_normal_map_shader(</div>
<div class="line"><span class="lineno"> 101</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 102</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 103</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 104</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 105</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 106</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 107</span> render-&gt;GetTexture(TextureType::Normal, 0),</div>
<div class="line"><span class="lineno"> 108</span> sunlightDirection,</div>
<div class="line"><span class="lineno"> 109</span> sunlightDiffuse</div>
<div class="line"><span class="lineno"> 110</span> );</div>
<div class="line"><span class="lineno"> 111</span> </div>
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">case</span> ShaderType::SPECULAR_MAPPING:</div>
<div class="line"><span class="lineno"> 113</span> </div>
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_spec_map_shader(</div>
<div class="line"><span class="lineno"> 115</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 116</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 117</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 118</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 119</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 120</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 121</span> render-&gt;GetTexture(TextureType::Normal, 0),</div>
<div class="line"><span class="lineno"> 122</span> render-&gt;GetTexture(TextureType::Specular, 0),</div>
<div class="line"><span class="lineno"> 123</span> sunlightDirection,</div>
<div class="line"><span class="lineno"> 124</span> sunlightDiffuse,</div>
<div class="line"><span class="lineno"> 125</span> cameraPosition,</div>
<div class="line"><span class="lineno"> 126</span> sunlightDiffuse, <span class="comment">// Couleur speculaire (<28> ajuster)</span></div>
<div class="line"><span class="lineno"> 127</span> 16.0f <span class="comment">// Puissance speculaire (<28> ajuster)</span></div>
<div class="line"><span class="lineno"> 128</span> );</div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">case</span> ShaderType::LIGHTING:</div>
<div class="line"><span class="lineno"> 131</span> {</div>
<div class="line"><span class="lineno"> 132</span> <span class="comment">// Cr<43>er des copies locales non constantes des tableaux</span></div>
<div class="line"><span class="lineno"> 133</span> DirectX::XMFLOAT4 localDiffuseColors[4];</div>
<div class="line"><span class="lineno"> 134</span> DirectX::XMFLOAT4 localLightPositions[4];</div>
<div class="line"><span class="lineno"> 135</span> DirectX::XMFLOAT4 localAmbientColors[4];</div>
<div class="line"><span class="lineno"> 136</span> </div>
<div class="line"><span class="lineno"> 137</span> <span class="comment">// Copier les donn<6E>es</span></div>
<div class="line"><span class="lineno"> 138</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 4; i++) {</div>
<div class="line"><span class="lineno"> 139</span> localDiffuseColors[i] = diffuseColors[i];</div>
<div class="line"><span class="lineno"> 140</span> localLightPositions[i] = lightPositions[i];</div>
<div class="line"><span class="lineno"> 141</span> localAmbientColors[i] = ambientColors[i];</div>
<div class="line"><span class="lineno"> 142</span> }</div>
<div class="line"><span class="lineno"> 143</span> </div>
<div class="line"><span class="lineno"> 144</span> <span class="keywordflow">return</span> m_shaderManager-&gt;renderlight_shader(</div>
<div class="line"><span class="lineno"> 145</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 146</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 147</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 148</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 149</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 150</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 151</span> localDiffuseColors,</div>
<div class="line"><span class="lineno"> 152</span> localLightPositions,</div>
<div class="line"><span class="lineno"> 153</span> localAmbientColors</div>
<div class="line"><span class="lineno"> 154</span> );</div>
<div class="line"><span class="lineno"> 155</span> }</div>
<div class="line"><span class="lineno"> 156</span> </div>
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">case</span> ShaderType::SUNLIGHT:</div>
<div class="line"><span class="lineno"> 158</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_sunlight_shader(</div>
<div class="line"><span class="lineno"> 159</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 160</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 161</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 162</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 163</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 164</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 165</span> sunlightDiffuse,</div>
<div class="line"><span class="lineno"> 166</span> sunlightAmbient,</div>
<div class="line"><span class="lineno"> 167</span> sunlightDirection,</div>
<div class="line"><span class="lineno"> 168</span> sunlightIntensity</div>
<div class="line"><span class="lineno"> 169</span> );</div>
<div class="line"><span class="lineno"> 170</span> </div>
<div class="line"><span class="lineno"> 171</span> <span class="keywordflow">case</span> ShaderType::SKYBOX:</div>
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_skybox_shader(</div>
<div class="line"><span class="lineno"> 173</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 174</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 175</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 176</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 177</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 178</span> render-&gt;GetTexture(TextureType::Diffuse, 0),</div>
<div class="line"><span class="lineno"> 179</span> sunlightDiffuse,</div>
<div class="line"><span class="lineno"> 180</span> sunlightAmbient,</div>
<div class="line"><span class="lineno"> 181</span> sunlightDirection,</div>
<div class="line"><span class="lineno"> 182</span> sunlightIntensity</div>
<div class="line"><span class="lineno"> 183</span> );</div>
<div class="line"><span class="lineno"> 184</span> </div>
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">case</span> ShaderType::TEXTURE:</div>
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">default</span>:</div>
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">return</span> m_shaderManager-&gt;render_texture_shader(</div>
<div class="line"><span class="lineno"> 188</span> m_deviceContext,</div>
<div class="line"><span class="lineno"> 189</span> render-&gt;GetIndexCount(),</div>
<div class="line"><span class="lineno"> 190</span> worldMatrix,</div>
<div class="line"><span class="lineno"> 191</span> viewMatrix,</div>
<div class="line"><span class="lineno"> 192</span> projectionMatrix,</div>
<div class="line"><span class="lineno"> 193</span> render-&gt;GetTexture(TextureType::Diffuse, 0)</div>
<div class="line"><span class="lineno"> 194</span> );</div>
<div class="line"><span class="lineno"> 195</span> }</div>
<div class="line"><span class="lineno"> 196</span> }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>enginecustom/src/inc/system/ecs/systems/<a class="el" href="render__system_8h_source.html">render_system.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespaceecs.html">ecs</a></li><li class="navelem"><a class="el" href="classecs_1_1_render_system.html">RenderSystem</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>