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

765 lines
46 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::RenderComponent 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_component.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_component-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">ecs::RenderComponent Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for ecs::RenderComponent:</div>
<div class="dyncontent">
<div class="center">
<img src="classecs_1_1_render_component.png" usemap="#ecs::RenderComponent_map" alt=""/>
<map id="ecs::RenderComponent_map" name="ecs::RenderComponent_map">
<area href="classecs_1_1_component.html" alt="ecs::Component" shape="rect" coords="0,0,142,24"/>
</map>
</div></div>
<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:a9b8099cc84f4ca11f9cfca7d80081d6b" id="r_a9b8099cc84f4ca11f9cfca7d80081d6b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9b8099cc84f4ca11f9cfca7d80081d6b">RenderComponent</a> ()</td></tr>
<tr class="separator:a9b8099cc84f4ca11f9cfca7d80081d6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa92950c4ebad0379f626493bda1a79bb" id="r_aa92950c4ebad0379f626493bda1a79bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa92950c4ebad0379f626493bda1a79bb">Initialize</a> () override</td></tr>
<tr class="separator:aa92950c4ebad0379f626493bda1a79bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cfff9944a89629f5f7a7d1451446f0d" id="r_a6cfff9944a89629f5f7a7d1451446f0d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6cfff9944a89629f5f7a7d1451446f0d">Update</a> (float deltaTime) override</td></tr>
<tr class="separator:a6cfff9944a89629f5f7a7d1451446f0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5014687c529c5dd29c1689da1dd64776" id="r_a5014687c529c5dd29c1689da1dd64776"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5014687c529c5dd29c1689da1dd64776">InitializeWithModel</a> (std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt; model)</td></tr>
<tr class="separator:a5014687c529c5dd29c1689da1dd64776"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0aeb040ec34ba3619f08269e5744597e" id="r_a0aeb040ec34ba3619f08269e5744597e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0aeb040ec34ba3619f08269e5744597e">InitializeFromFile</a> (ID3D11Device *device, ID3D11DeviceContext *deviceContext, const char *modelFilename, <a class="el" href="struct_texture_container.html">TextureContainer</a> &amp;textureContainer)</td></tr>
<tr class="separator:a0aeb040ec34ba3619f08269e5744597e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64e1e92929e2384d09c31b8d2afb258d" id="r_a64e1e92929e2384d09c31b8d2afb258d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a64e1e92929e2384d09c31b8d2afb258d">LoadTexturesFromPath</a> (std::vector&lt; std::wstring &gt; &amp;texturePaths, <a class="el" href="struct_texture_container.html">TextureContainer</a> &amp;texturesContainer, ID3D11Device *device, ID3D11DeviceContext *deviceContext)</td></tr>
<tr class="separator:a64e1e92929e2384d09c31b8d2afb258d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2797ae01f7f42594a0291529d0ec8ef0" id="r_a2797ae01f7f42594a0291529d0ec8ef0"><td class="memItemLeft" align="right" valign="top">std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2797ae01f7f42594a0291529d0ec8ef0">GetModel</a> () const</td></tr>
<tr class="separator:a2797ae01f7f42594a0291529d0ec8ef0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3a01e06c359132815a5a35ed950a19a" id="r_ab3a01e06c359132815a5a35ed950a19a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab3a01e06c359132815a5a35ed950a19a">SetModel</a> (std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt; model)</td></tr>
<tr class="separator:ab3a01e06c359132815a5a35ed950a19a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9bc77dc2ea430ec9008bda7993f766c" id="r_aa9bc77dc2ea430ec9008bda7993f766c"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa9bc77dc2ea430ec9008bda7993f766c">GetModelFilePath</a> () const</td></tr>
<tr class="separator:aa9bc77dc2ea430ec9008bda7993f766c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acac2902002c2ca0618c41525d1584088" id="r_acac2902002c2ca0618c41525d1584088"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acac2902002c2ca0618c41525d1584088">SetModelFilePath</a> (const std::string &amp;path)</td></tr>
<tr class="separator:acac2902002c2ca0618c41525d1584088"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad77b9089172b2567767aac2ac05118ea" id="r_ad77b9089172b2567767aac2ac05118ea"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad77b9089172b2567767aac2ac05118ea">IsVisible</a> () const</td></tr>
<tr class="separator:ad77b9089172b2567767aac2ac05118ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0beed54f3cfe42213e1767da1b36d46" id="r_ae0beed54f3cfe42213e1767da1b36d46"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae0beed54f3cfe42213e1767da1b36d46">SetVisible</a> (bool visible)</td></tr>
<tr class="separator:ae0beed54f3cfe42213e1767da1b36d46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d3c778be73e8cbb27b3ea102698a7f2" id="r_a8d3c778be73e8cbb27b3ea102698a7f2"><td class="memItemLeft" align="right" valign="top">ID3D11ShaderResourceView *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8d3c778be73e8cbb27b3ea102698a7f2">GetTexture</a> (<a class="el" href="namespaceecs.html#a6e9ad0276f69474fe9498437b7d1a8f2">TextureType</a> type, int index=0)</td></tr>
<tr class="separator:a8d3c778be73e8cbb27b3ea102698a7f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae01aca10690322ec92899e99bf5e244e" id="r_ae01aca10690322ec92899e99bf5e244e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae01aca10690322ec92899e99bf5e244e">GetIndexCount</a> () const</td></tr>
<tr class="separator:ae01aca10690322ec92899e99bf5e244e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61dc5966b89474a415e3d19d28760a64" id="r_a61dc5966b89474a415e3d19d28760a64"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a61dc5966b89474a415e3d19d28760a64">Render</a> (ID3D11DeviceContext *deviceContext)</td></tr>
<tr class="separator:a61dc5966b89474a415e3d19d28760a64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classecs_1_1_component"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classecs_1_1_component')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classecs_1_1_component.html">ecs::Component</a></td></tr>
<tr class="memitem:a8dbee43fa54890ad07145aa1160b0b09 inherit pub_methods_classecs_1_1_component" id="r_a8dbee43fa54890ad07145aa1160b0b09"><td class="memItemLeft" align="right" valign="top">
&#160;</td><td class="memItemRight" valign="bottom"><b>Component</b> (const <a class="el" href="classecs_1_1_component.html">Component</a> &amp;)=delete</td></tr>
<tr class="separator:a8dbee43fa54890ad07145aa1160b0b09 inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34000da33471994c2550e416505026ad inherit pub_methods_classecs_1_1_component" id="r_a34000da33471994c2550e416505026ad"><td class="memItemLeft" align="right" valign="top">
<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classecs_1_1_component.html">Component</a> &amp;)=delete</td></tr>
<tr class="separator:a34000da33471994c2550e416505026ad inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a213cfa3482dca1ffc458b9cf020b4814 inherit pub_methods_classecs_1_1_component" id="r_a213cfa3482dca1ffc458b9cf020b4814"><td class="memItemLeft" align="right" valign="top">
&#160;</td><td class="memItemRight" valign="bottom"><b>Component</b> (<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a213cfa3482dca1ffc458b9cf020b4814 inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8089d7e43f9ac2a6eedd3b0598c46694 inherit pub_methods_classecs_1_1_component" id="r_a8089d7e43f9ac2a6eedd3b0598c46694"><td class="memItemLeft" align="right" valign="top">
<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a8089d7e43f9ac2a6eedd3b0598c46694 inherit pub_methods_classecs_1_1_component"><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__component_8h_source.html#l00029">29</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a9b8099cc84f4ca11f9cfca7d80081d6b" name="a9b8099cc84f4ca11f9cfca7d80081d6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b8099cc84f4ca11f9cfca7d80081d6b">&#9670;&#160;</a></span>RenderComponent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ecs::RenderComponent::RenderComponent </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></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_component.html">RenderComponent</a> class. </p>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00034">34</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 34</span>: m_model(<span class="keyword">nullptr</span>), m_isVisible(<span class="keyword">true</span>) {}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae01aca10690322ec92899e99bf5e244e" name="ae01aca10690322ec92899e99bf5e244e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae01aca10690322ec92899e99bf5e244e">&#9670;&#160;</a></span>GetIndexCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int ecs::RenderComponent::GetIndexCount </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</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>Get the number of vertices in the model. This method retrieves the vertex count from the model. </p><dl class="section return"><dt>Returns</dt><dd>The number of vertices as an integer. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00174">174</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 174</span> {</div>
<div class="line"><span class="lineno"> 175</span> <span class="keywordflow">return</span> m_model ? m_model-&gt;GetIndexCount() : 0;</div>
<div class="line"><span class="lineno"> 176</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a2797ae01f7f42594a0291529d0ec8ef0" name="a2797ae01f7f42594a0291529d0ec8ef0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2797ae01f7f42594a0291529d0ec8ef0">&#9670;&#160;</a></span>GetModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt; ecs::RenderComponent::GetModel </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</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>Get the model associated with this <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a>. </p><dl class="section return"><dt>Returns</dt><dd>A shared pointer to the <a class="el" href="classmodel__class.html">model_class</a> instance. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00113">113</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 113</span>{ <span class="keywordflow">return</span> m_model; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa9bc77dc2ea430ec9008bda7993f766c" name="aa9bc77dc2ea430ec9008bda7993f766c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9bc77dc2ea430ec9008bda7993f766c">&#9670;&#160;</a></span>GetModelFilePath()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const std::string &amp; ecs::RenderComponent::GetModelFilePath </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</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>Get the file path of the model associated with this <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a>. </p><dl class="section return"><dt>Returns</dt><dd>The file path as a string. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00125">125</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 125</span>{ <span class="keywordflow">return</span> m_modelFilePath; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a8d3c778be73e8cbb27b3ea102698a7f2" name="a8d3c778be73e8cbb27b3ea102698a7f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d3c778be73e8cbb27b3ea102698a7f2">&#9670;&#160;</a></span>GetTexture()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ID3D11ShaderResourceView * ecs::RenderComponent::GetTexture </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceecs.html#a6e9ad0276f69474fe9498437b7d1a8f2">TextureType</a></td> <td class="paramname"><span class="paramname"><em>type</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>index</em></span><span class="paramdefsep"> = </span><span class="paramdefval">0</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>Get a texture of a specific type by index. This method retrieves the texture from the model based on the specified type and index. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">type</td><td>The type of texture to retrieve (Diffuse, Normal, Specular, Alpha). </td></tr>
<tr><td class="paramname">index</td><td>The index of the texture to retrieve (default is 0). </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the ID3D11ShaderResourceView of the texture, or nullptr if not found. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00152">152</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 152</span> {</div>
<div class="line"><span class="lineno"> 153</span> <span class="keywordflow">if</span> (!m_model) <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 154</span> </div>
<div class="line"><span class="lineno"> 155</span> <span class="keywordflow">switch</span> (type) {</div>
<div class="line"><span class="lineno"> 156</span> <span class="keywordflow">case</span> TextureType::Diffuse: </div>
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">return</span> m_model-&gt;GetTexture(::TextureType::Diffuse, index);</div>
<div class="line"><span class="lineno"> 158</span> <span class="keywordflow">case</span> TextureType::Normal: </div>
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">return</span> m_model-&gt;GetTexture(::TextureType::Normal, index);</div>
<div class="line"><span class="lineno"> 160</span> <span class="keywordflow">case</span> TextureType::Specular: </div>
<div class="line"><span class="lineno"> 161</span> <span class="keywordflow">return</span> m_model-&gt;GetTexture(::TextureType::Specular, index);</div>
<div class="line"><span class="lineno"> 162</span> <span class="keywordflow">case</span> TextureType::Alpha: </div>
<div class="line"><span class="lineno"> 163</span> <span class="keywordflow">return</span> m_model-&gt;GetTexture(::TextureType::Alpha, index);</div>
<div class="line"><span class="lineno"> 164</span> <span class="keywordflow">default</span>: </div>
<div class="line"><span class="lineno"> 165</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 166</span> }</div>
<div class="line"><span class="lineno"> 167</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa92950c4ebad0379f626493bda1a79bb" name="aa92950c4ebad0379f626493bda1a79bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa92950c4ebad0379f626493bda1a79bb">&#9670;&#160;</a></span>Initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::Initialize </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Virtual function to initialize the component. </p>
<p>Reimplemented from <a class="el" href="classecs_1_1_component.html#a9372874f51e5f63584d65fc378d39459">ecs::Component</a>.</p>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00037">37</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 37</span>{}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a0aeb040ec34ba3619f08269e5744597e" name="a0aeb040ec34ba3619f08269e5744597e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0aeb040ec34ba3619f08269e5744597e">&#9670;&#160;</a></span>InitializeFromFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::RenderComponent::InitializeFromFile </td>
<td>(</td>
<td class="paramtype">ID3D11Device *</td> <td class="paramname"><span class="paramname"><em>device</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></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">const char *</td> <td class="paramname"><span class="paramname"><em>modelFilename</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_texture_container.html">TextureContainer</a> &amp;</td> <td class="paramname"><span class="paramname"><em>textureContainer</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>Initialize the <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a> from a model file. This method checks if the model is already cached; if not, it loads the model from the specified file. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">device</td><td>The Direct3D device used for rendering. </td></tr>
<tr><td class="paramname">deviceContext</td><td>The Direct3D device context used for rendering. </td></tr>
<tr><td class="paramname">modelFilename</td><td>The path to the model file to load. </td></tr>
<tr><td class="paramname">textureContainer</td><td>The container for textures used by the model. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if initialization was successful, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00061">61</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 62</span> {</div>
<div class="line"><span class="lineno"> 63</span> <span class="comment">// V<>rifier si le mod<6F>le existe d<>j<EFBFBD> dans le cache</span></div>
<div class="line"><span class="lineno"> 64</span> std::string filename(modelFilename);</div>
<div class="line"><span class="lineno"> 65</span> <span class="keyword">auto</span> it = g_model_cache.find(filename);</div>
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">if</span> (it != g_model_cache.end()) {</div>
<div class="line"><span class="lineno"> 67</span> m_model = it-&gt;second;</div>
<div class="line"><span class="lineno"> 68</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 69</span> <span class="comment">// Cr<43>er un nouveau mod<6F>le</span></div>
<div class="line"><span class="lineno"> 70</span> <span class="keyword">auto</span> new_model = std::make_shared&lt;model_class&gt;();</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">if</span> (!new_model-&gt;Initialize(device, deviceContext, <span class="keyword">const_cast&lt;</span><span class="keywordtype">char</span>*<span class="keyword">&gt;</span>(modelFilename), textureContainer)) {</div>
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 73</span> }</div>
<div class="line"><span class="lineno"> 74</span> g_model_cache[filename] = new_model;</div>
<div class="line"><span class="lineno"> 75</span> m_model = new_model;</div>
<div class="line"><span class="lineno"> 76</span> }</div>
<div class="line"><span class="lineno"> 77</span> </div>
<div class="line"><span class="lineno"> 78</span> m_modelFilePath = modelFilename;</div>
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 80</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a5014687c529c5dd29c1689da1dd64776" name="a5014687c529c5dd29c1689da1dd64776"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5014687c529c5dd29c1689da1dd64776">&#9670;&#160;</a></span>InitializeWithModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::RenderComponent::InitializeWithModel </td>
<td>(</td>
<td class="paramtype">std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt;</td> <td class="paramname"><span class="paramname"><em>model</em></span></td><td>)</td>
<td></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>Initialize the <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a> with a model. This method allows the component to be initialized with an existing model instance. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">model</td><td>A shared pointer to the <a class="el" href="classmodel__class.html">model_class</a> instance to use. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if initialization was successful, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00046">46</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 46</span> {</div>
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">if</span> (!model) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 48</span> m_model = model;</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 50</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ad77b9089172b2567767aac2ac05118ea" name="ad77b9089172b2567767aac2ac05118ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad77b9089172b2567767aac2ac05118ea">&#9670;&#160;</a></span>IsVisible()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::RenderComponent::IsVisible </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</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>Check if the model is currently visible. </p><dl class="section return"><dt>Returns</dt><dd>True if the model is visible, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00137">137</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 137</span>{ <span class="keywordflow">return</span> m_isVisible; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a64e1e92929e2384d09c31b8d2afb258d" name="a64e1e92929e2384d09c31b8d2afb258d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64e1e92929e2384d09c31b8d2afb258d">&#9670;&#160;</a></span>LoadTexturesFromPath()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::RenderComponent::LoadTexturesFromPath </td>
<td>(</td>
<td class="paramtype">std::vector&lt; std::wstring &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>texturePaths</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_texture_container.html">TextureContainer</a> &amp;</td> <td class="paramname"><span class="paramname"><em>texturesContainer</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ID3D11Device *</td> <td class="paramname"><span class="paramname"><em>device</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ID3D11DeviceContext *</td> <td class="paramname"><span class="paramname"><em>deviceContext</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>Load textures from a list of file paths into the texture container. This method uses DirectX's WIC texture loader to load textures from the specified paths. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">texturePaths</td><td>A vector of file paths to the textures to load. </td></tr>
<tr><td class="paramname">texturesContainer</td><td>The container where the loaded textures will be stored. </td></tr>
<tr><td class="paramname">device</td><td>The Direct3D device used for rendering. </td></tr>
<tr><td class="paramname">deviceContext</td><td>The Direct3D device context used for rendering. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if all textures were loaded successfully, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00091">91</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 92</span> {</div>
<div class="line"><span class="lineno"> 93</span> HRESULT result;</div>
<div class="line"><span class="lineno"> 94</span> </div>
<div class="line"><span class="lineno"> 95</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><span class="lineno"> 96</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; texturePath : texturePaths) {</div>
<div class="line"><span class="lineno"> 97</span> ID3D11ShaderResourceView* texture = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 98</span> result = DirectX::CreateWICTextureFromFile(device, deviceContext, texturePath.c_str(), <span class="keyword">nullptr</span>, &amp;texture);</div>
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">if</span> (FAILED(result)) {</div>
<div class="line"><span class="lineno"> 100</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 101</span> }</div>
<div class="line"><span class="lineno"> 102</span> texturesContainer.AssignTexture(texturesContainer, texture, texturePath, i);</div>
<div class="line"><span class="lineno"> 103</span> i++;</div>
<div class="line"><span class="lineno"> 104</span> }</div>
<div class="line"><span class="lineno"> 105</span> </div>
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 107</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a61dc5966b89474a415e3d19d28760a64" name="a61dc5966b89474a415e3d19d28760a64"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61dc5966b89474a415e3d19d28760a64">&#9670;&#160;</a></span>Render()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::Render </td>
<td>(</td>
<td class="paramtype">ID3D11DeviceContext *</td> <td class="paramname"><span class="paramname"><em>deviceContext</em></span></td><td>)</td>
<td></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 the model using the provided device context. This method calls the Render method of the model if it is initialized and visible. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">deviceContext</td><td>The Direct3D device context used for rendering. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00183">183</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 183</span> {</div>
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> (m_model &amp;&amp; m_isVisible) {</div>
<div class="line"><span class="lineno"> 185</span> m_model-&gt;Render(deviceContext);</div>
<div class="line"><span class="lineno"> 186</span> }</div>
<div class="line"><span class="lineno"> 187</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab3a01e06c359132815a5a35ed950a19a" name="ab3a01e06c359132815a5a35ed950a19a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3a01e06c359132815a5a35ed950a19a">&#9670;&#160;</a></span>SetModel()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::SetModel </td>
<td>(</td>
<td class="paramtype">std::shared_ptr&lt; <a class="el" href="classmodel__class.html">model_class</a> &gt;</td> <td class="paramname"><span class="paramname"><em>model</em></span></td><td>)</td>
<td></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>Set the model for this <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a>. This method allows the component to be set with an existing model instance. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">model</td><td>A shared pointer to the <a class="el" href="classmodel__class.html">model_class</a> instance to set. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00119">119</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 119</span>{ m_model = model; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="acac2902002c2ca0618c41525d1584088" name="acac2902002c2ca0618c41525d1584088"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acac2902002c2ca0618c41525d1584088">&#9670;&#160;</a></span>SetModelFilePath()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::SetModelFilePath </td>
<td>(</td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>path</em></span></td><td>)</td>
<td></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>Set the file path of the model for this <a class="el" href="classecs_1_1_render_component.html">RenderComponent</a>. This method allows the component to be set with a specific model file path. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>The file path to set as a string. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00131">131</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 131</span>{ m_modelFilePath = path; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae0beed54f3cfe42213e1767da1b36d46" name="ae0beed54f3cfe42213e1767da1b36d46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0beed54f3cfe42213e1767da1b36d46">&#9670;&#160;</a></span>SetVisible()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::SetVisible </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>visible</em></span></td><td>)</td>
<td></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>Set the visibility of the model. This method allows the component to control whether the model should be rendered or not. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">visible</td><td>True to make the model visible, false to hide it. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00143">143</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 143</span>{ m_isVisible = visible; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a6cfff9944a89629f5f7a7d1451446f0d" name="a6cfff9944a89629f5f7a7d1451446f0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6cfff9944a89629f5f7a7d1451446f0d">&#9670;&#160;</a></span>Update()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::RenderComponent::Update </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>deltaTime</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Virtual function to update the component. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">deltaTime</td><td>Time since the last update. </td></tr>
</table>
</dd>
</dl>
<p>Reimplemented from <a class="el" href="classecs_1_1_component.html#a59c0f739c4ff19227e27ed7b9f6352e0">ecs::Component</a>.</p>
<p class="definition">Definition at line <a class="el" href="render__component_8h_source.html#l00038">38</a> of file <a class="el" href="render__component_8h_source.html">render_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 38</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/components/<a class="el" href="render__component_8h_source.html">render_component.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_component.html">RenderComponent</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>