irrlicht/doc/html/_c_index_buffer_8h_source.html

343 lines
39 KiB
HTML
Raw Normal View History

2020-05-16 23:31:28 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Irrlicht 3D Engine: CIndexBuffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Irrlicht 3D Engine
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('_c_index_buffer_8h.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">CIndexBuffer.h</div> </div>
</div>
<div class="contents">
<a href="_c_index_buffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2008-2012 Nikolaus Gebhardt</span>
<a name="l00002"></a>00002 <span class="comment">// This file is part of the &quot;Irrlicht Engine&quot;.</span>
<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
<a name="l00004"></a>00004
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __C_INDEX_BUFFER_H_INCLUDED__</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __C_INDEX_BUFFER_H_INCLUDED__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="_i_index_buffer_8h.html">IIndexBuffer.h</a>&quot;</span>
<a name="l00009"></a>00009
<a name="l00010"></a>00010 <span class="keyword">namespace </span>irr
<a name="l00011"></a>00011 {
<a name="l00012"></a>00012 <span class="keyword">namespace </span>scene
<a name="l00013"></a>00013 {
<a name="l00014"></a>00014
<a name="l00015"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html">00015</a> <span class="keyword">class </span><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html">CIndexBuffer</a> : <span class="keyword">public</span> <a class="code" href="classirr_1_1scene_1_1_i_index_buffer.html">IIndexBuffer</a>
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="keyword">class </span>IIndexList
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 <span class="keyword">public</span>:
<a name="l00021"></a>00021 <span class="keyword">virtual</span> ~IIndexList(){};
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a6f243e5fc6c478285aadc5d8c6ebae7a">stride</a>() <span class="keyword">const</span> =0;
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac6f5f8f1c8741b6039077c31c53cbbec">size</a>() <span class="keyword">const</span> =0;
<a name="l00025"></a>00025 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a3fdb8665fbbd7fe9c40f94d368bc8d9d">push_back</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> &amp;element) =0;
<a name="l00026"></a>00026 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a97bf183244a664c3b1f63133140479f9">operator []</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index) <span class="keyword">const</span> =0;
<a name="l00027"></a>00027 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a618dca4b3df1c4c18792d62a186a3691">getLast</a>() =0;
<a name="l00028"></a>00028 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a21908d54817ac0b5d96d4d65bd6e41c6">setValue</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> value) =0;
<a name="l00029"></a>00029 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#afa9ccdc63427b7496ad5fa0e777a475b">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow) =0;
<a name="l00030"></a>00030 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a7e8d513c3a60c88614589ef01c7df899">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size) =0;
<a name="l00031"></a>00031 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aedce7afd922a9c3bfaa9a3f3c93e6198">allocated_size</a>() <span class="keyword">const</span> =0;
<a name="l00032"></a>00032 <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a93a372d3b9d2459d0ab0a59b2190fa95">pointer</a>() =0;
<a name="l00033"></a>00033 <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55">video::E_INDEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a06f9706426d7d3e964ce5b6900097b1a">getType</a>() <span class="keyword">const</span> =0;
<a name="l00034"></a>00034 };
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00037"></a>00037 <span class="keyword">class </span>CSpecificIndexList : <span class="keyword">public</span> IIndexList
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="keyword">public</span>:
<a name="l00040"></a>00040 <a class="code" href="classirr_1_1core_1_1array.html">core::array&lt;T&gt;</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>;
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a6f243e5fc6c478285aadc5d8c6ebae7a">stride</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">sizeof</span>(T);}
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac6f5f8f1c8741b6039077c31c53cbbec">size</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.size();}
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a3fdb8665fbbd7fe9c40f94d368bc8d9d">push_back</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> &amp;element)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <span class="comment">// push const ref due to compiler problem with gcc 4.6, big endian</span>
<a name="l00049"></a>00049 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.push_back((<span class="keyword">const</span> T&amp;)element);
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a97bf183244a664c3b1f63133140479f9">operator []</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index)<span class="keyword"> const</span>
<a name="l00053"></a>00053 <span class="keyword"> </span>{
<a name="l00054"></a>00054 <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)(<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>[index]);
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a618dca4b3df1c4c18792d62a186a3691">getLast</a>() {<span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a>)<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.getLast();}
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a21908d54817ac0b5d96d4d65bd6e41c6">setValue</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> value)
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>[index]=(T)value;
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#afa9ccdc63427b7496ad5fa0e777a475b">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow)
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.set_used(usedNow);
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a7e8d513c3a60c88614589ef01c7df899">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size)
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.reallocate(new_size);
<a name="l00072"></a>00072 }
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aedce7afd922a9c3bfaa9a3f3c93e6198">allocated_size</a>()<span class="keyword"> const</span>
<a name="l00075"></a>00075 <span class="keyword"> </span>{
<a name="l00076"></a>00076 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.allocated_size();
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a93a372d3b9d2459d0ab0a59b2190fa95">pointer</a>() {<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>.pointer();}
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55">video::E_INDEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a06f9706426d7d3e964ce5b6900097b1a">getType</a>()<span class="keyword"> const</span>
<a name="l00082"></a>00082 <span class="keyword"> </span>{
<a name="l00083"></a>00083 <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(T)==<span class="keyword">sizeof</span>(<a class="code" href="namespaceirr.html#ae9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a>))
<a name="l00084"></a>00084 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55a1c79610ea1191e124887efa16626f299">video::EIT_16BIT</a>;
<a name="l00085"></a>00085 <span class="keywordflow">else</span>
<a name="l00086"></a>00086 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55a25301351f157bc317bde492d41c72f84">video::EIT_32BIT</a>;
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088 };
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="keyword">public</span>:
<a name="l00091"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">00091</a> IIndexList *<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>;
<a name="l00092"></a>00092
<a name="l00093"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a5e2dad1d1636733545d479b80c895773">00093</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a5e2dad1d1636733545d479b80c895773">CIndexBuffer</a>(<a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55">video::E_INDEX_TYPE</a> IndexType) :<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>(0), <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">MappingHint</a>(<a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27a6eaae9a4147dfc68ce11fa12b9ce3c0d" title="Don&#39;t store on the hardware.">EHM_NEVER</a>), <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">ChangedID</a>(1)
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a78d1fdec24ac2adbc40583c8519d5e18">setType</a>(IndexType);
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097
<a name="l00098"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a4464e3256fc320dec95ad3465955fe86">00098</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a5e2dad1d1636733545d479b80c895773">CIndexBuffer</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1scene_1_1_i_index_buffer.html">IIndexBuffer</a> &amp;IndexBufferCopy) :<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>(0), <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">MappingHint</a>(<a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27a6eaae9a4147dfc68ce11fa12b9ce3c0d" title="Don&#39;t store on the hardware.">EHM_NEVER</a>), <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">ChangedID</a>(1)
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a78d1fdec24ac2adbc40583c8519d5e18">setType</a>(IndexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_index_buffer.html#aa1821d0c45e4d869fc884de37b5fdcaf">getType</a>());
<a name="l00101"></a>00101 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a7e8d513c3a60c88614589ef01c7df899">reallocate</a>(IndexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_index_buffer.html#a0f6d6c8286ca764076463500b4c6f37c">size</a>());
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> n=0;n&lt;IndexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_index_buffer.html#a0f6d6c8286ca764076463500b4c6f37c">size</a>();++n)
<a name="l00104"></a>00104 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a3fdb8665fbbd7fe9c40f94d368bc8d9d">push_back</a>(IndexBufferCopy[n]);
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106
<a name="l00107"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ab7ab858913acbead555395d9f155ba01">00107</a> <span class="keyword">virtual</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ab7ab858913acbead555395d9f155ba01">~CIndexBuffer</a>()
<a name="l00108"></a>00108 {
<a name="l00109"></a>00109 <span class="keyword">delete</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>;
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111
<a name="l00112"></a>00112 <span class="comment">//virtual void setType(video::E_INDEX_TYPE IndexType);</span>
<a name="l00113"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a78d1fdec24ac2adbc40583c8519d5e18">00113</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a78d1fdec24ac2adbc40583c8519d5e18">setType</a>(<a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55">video::E_INDEX_TYPE</a> IndexType)
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115 IIndexList *NewIndices=0;
<a name="l00116"></a>00116
<a name="l00117"></a>00117 <span class="keywordflow">switch</span> (IndexType)
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55a1c79610ea1191e124887efa16626f299">video::EIT_16BIT</a>:
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121 NewIndices=<span class="keyword">new</span> CSpecificIndexList&lt;u16&gt;;
<a name="l00122"></a>00122 <span class="keywordflow">break</span>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55a25301351f157bc317bde492d41c72f84">video::EIT_32BIT</a>:
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 NewIndices=<span class="keyword">new</span> CSpecificIndexList&lt;u32&gt;;
<a name="l00127"></a>00127 <span class="keywordflow">break</span>;
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>)
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 NewIndices-&gt;reallocate( <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;size() );
<a name="l00134"></a>00134
<a name="l00135"></a>00135 <span class="keywordflow">for</span>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> n=0;n&lt;<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;size();++n)
<a name="l00136"></a>00136 NewIndices-&gt;push_back((*<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>)[n]);
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="keyword">delete</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>=NewIndices;
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143
<a name="l00144"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a45eddec838d183d66fd4305c18f83821">00144</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a45eddec838d183d66fd4305c18f83821">getData</a>() {<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;pointer();}
<a name="l00145"></a>00145
<a name="l00146"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a06f9706426d7d3e964ce5b6900097b1a">00146</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#af152a1edea2579f0517e0049525acb55">video::E_INDEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a06f9706426d7d3e964ce5b6900097b1a">getType</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;getType();}
<a name="l00147"></a>00147
<a name="l00148"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a6f243e5fc6c478285aadc5d8c6ebae7a">00148</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a6f243e5fc6c478285aadc5d8c6ebae7a">stride</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;stride();}
<a name="l00149"></a>00149
<a name="l00150"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac6f5f8f1c8741b6039077c31c53cbbec">00150</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac6f5f8f1c8741b6039077c31c53cbbec">size</a>()<span class="keyword"> const</span>
<a name="l00151"></a>00151 <span class="keyword"> </span>{
<a name="l00152"></a>00152 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;size();
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154
<a name="l00155"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a3fdb8665fbbd7fe9c40f94d368bc8d9d">00155</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a3fdb8665fbbd7fe9c40f94d368bc8d9d">push_back</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> &amp;element)
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;push_back(element);
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00160"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a97bf183244a664c3b1f63133140479f9">00160</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a97bf183244a664c3b1f63133140479f9">operator []</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index)<span class="keyword"> const</span>
<a name="l00161"></a>00161 <span class="keyword"> </span>{
<a name="l00162"></a>00162 <span class="keywordflow">return</span> (*<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>)[index];
<a name="l00163"></a>00163 }
<a name="l00164"></a>00164
<a name="l00165"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a618dca4b3df1c4c18792d62a186a3691">00165</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a618dca4b3df1c4c18792d62a186a3691">getLast</a>()
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;getLast();
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169
<a name="l00170"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a21908d54817ac0b5d96d4d65bd6e41c6">00170</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a21908d54817ac0b5d96d4d65bd6e41c6">setValue</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> value)
<a name="l00171"></a>00171 {
<a name="l00172"></a>00172 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;setValue(index, value);
<a name="l00173"></a>00173 }
<a name="l00174"></a>00174
<a name="l00175"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#afa9ccdc63427b7496ad5fa0e777a475b">00175</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#afa9ccdc63427b7496ad5fa0e777a475b">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow)
<a name="l00176"></a>00176 {
<a name="l00177"></a>00177 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;set_used(usedNow);
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179
<a name="l00180"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a7e8d513c3a60c88614589ef01c7df899">00180</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a7e8d513c3a60c88614589ef01c7df899">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size)
<a name="l00181"></a>00181 {
<a name="l00182"></a>00182 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;reallocate(new_size);
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184
<a name="l00185"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aedce7afd922a9c3bfaa9a3f3c93e6198">00185</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aedce7afd922a9c3bfaa9a3f3c93e6198">allocated_size</a>()<span class="keyword"> const</span>
<a name="l00186"></a>00186 <span class="keyword"> </span>{
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;allocated_size();
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189
<a name="l00190"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a93a372d3b9d2459d0ab0a59b2190fa95">00190</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a93a372d3b9d2459d0ab0a59b2190fa95">pointer</a>()
<a name="l00191"></a>00191 {
<a name="l00192"></a>00192 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae05b8519653dddd2cb6b4378cc43cf5b">Indices</a>-&gt;pointer();
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194
<a name="l00196"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae0fe796f0eba464d33eb1ba1877c065e">00196</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27">E_HARDWARE_MAPPING</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ae0fe796f0eba464d33eb1ba1877c065e" title="get the current hardware mapping hint">getHardwareMappingHint</a>()<span class="keyword"> const</span>
<a name="l00197"></a>00197 <span class="keyword"> </span>{
<a name="l00198"></a>00198 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">MappingHint</a>;
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200
<a name="l00202"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac90306be32369c40745d0f2b6c494cb8">00202</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#ac90306be32369c40745d0f2b6c494cb8" title="set the hardware mapping hint, for driver">setHardwareMappingHint</a>( <a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27">E_HARDWARE_MAPPING</a> NewMappingHint )
<a name="l00203"></a>00203 {
<a name="l00204"></a>00204 <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">MappingHint</a>=NewMappingHint;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206
<a name="l00208"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a4a0eab4c6c698b8d56fe5c8478a73de8">00208</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a4a0eab4c6c698b8d56fe5c8478a73de8" title="flags the mesh as changed, reloads hardware buffers">setDirty</a>()
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 ++<a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">ChangedID</a>;
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212
<a name="l00214"></a>00214
<a name="l00215"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a4f2565bd2d6fbfa5dd17f5da1eef6e6c">00215</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#a4f2565bd2d6fbfa5dd17f5da1eef6e6c" title="Get the currently used ID for identification of changes.">getChangedID</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">ChangedID</a>;}
<a name="l00216"></a>00216
<a name="l00217"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">00217</a> <a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27">E_HARDWARE_MAPPING</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#aacb589263f410987f19e3f9459771e9e">MappingHint</a>;
<a name="l00218"></a><a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">00218</a> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1scene_1_1_c_index_buffer.html#af42b7407621d5a78d9d518d9e3b96f58">ChangedID</a>;
<a name="l00219"></a>00219 };
<a name="l00220"></a>00220
<a name="l00221"></a>00221
<a name="l00222"></a>00222 } <span class="comment">// end namespace scene</span>
<a name="l00223"></a>00223 } <span class="comment">// end namespace irr</span>
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="preprocessor">#endif</span>
<a name="l00226"></a>00226 <span class="preprocessor"></span>
</pre></div></div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="_c_index_buffer_8h.html">CIndexBuffer.h</a> </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<li class="footer">
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht
Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Sat Jul 9 2016 18:18:17 for Irrlicht 3D Engine by
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
</ul>
</div>
</body>
</html>