irrlicht/doc/docu/_c_vertex_buffer_8h_source.html

327 lines
38 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: CVertexBuffer.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_vertex_buffer_8h.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">CVertexBuffer.h</div> </div>
</div>
<div class="contents">
<a href="_c_vertex_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_VERTEX_BUFFER_H_INCLUDED__</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __C_VERTEX_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_vertex_buffer_8h.html">IVertexBuffer.h</a>&quot;</span>
<a name="l00009"></a>00009
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="keyword">namespace </span>irr
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013 <span class="keyword">namespace </span>scene
<a name="l00014"></a>00014 {
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html">00016</a> <span class="keyword">class </span><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html">CVertexBuffer</a> : <span class="keyword">public</span> <a class="code" href="classirr_1_1scene_1_1_i_vertex_buffer.html">IVertexBuffer</a>
<a name="l00017"></a>00017 {
<a name="l00018"></a>00018 <span class="keyword">class </span>IVertexList
<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> ~IVertexList(){};
<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_vertex_buffer.html#ab305ac3ee0c058791b0eb6a50232386e">stride</a>() <span class="keyword">const</span> =0;
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <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_vertex_buffer.html#abfe7f69d79a2f5724df21cdb2321257e">size</a>() <span class="keyword">const</span> =0;
<a name="l00026"></a>00026
<a name="l00027"></a>00027 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a7abb02f71ff8f7c99b79bfabca776b6e">push_back</a> (<span class="keyword">const</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a> &amp;element) =0;
<a name="l00028"></a>00028 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ac70ac1ba337405df3b58ea32377daee2">operator []</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index) <span class="keyword">const</span> =0;
<a name="l00029"></a>00029 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad3f007946704cc43a1c40cd7d875e060">getLast</a>() =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_vertex_buffer.html#a45fc7f9836d302b2103640eb12bf75bc">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow) =0;
<a name="l00031"></a>00031 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a507db8fc7d49a013dbdfe30e7b43dbfb">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size) =0;
<a name="l00032"></a>00032 <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_vertex_buffer.html#a4d94ab0ed64b3056226b2ffb79af9eff">allocated_size</a>() <span class="keyword">const</span> =0;
<a name="l00033"></a>00033 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>* <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a3a22a8bc7d2f348038bf69821ccfd617">pointer</a>() =0;
<a name="l00034"></a>00034 <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac" title="Enumeration for all vertex types there are.">video::E_VERTEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#abbcf17e96150ae1f64b885cac99e6d0b">getType</a>() <span class="keyword">const</span> =0;
<a name="l00035"></a>00035 };
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00038"></a>00038 <span class="keyword">class </span>CSpecificVertexList : <span class="keyword">public</span> IVertexList
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00041"></a>00041 <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_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>;
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <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_vertex_buffer.html#ab305ac3ee0c058791b0eb6a50232386e">stride</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">sizeof</span>(T);}
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <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_vertex_buffer.html#abfe7f69d79a2f5724df21cdb2321257e">size</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.size();}
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a7abb02f71ff8f7c99b79bfabca776b6e">push_back</a> (<span class="keyword">const</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a> &amp;element)
<a name="l00048"></a>00048 {<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.push_back((T&amp;)element);}
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ac70ac1ba337405df3b58ea32377daee2">operator []</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index)<span class="keyword"> const</span>
<a name="l00051"></a>00051 <span class="keyword"> </span>{<span class="keywordflow">return</span> (<a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp;)<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>[index];}
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad3f007946704cc43a1c40cd7d875e060">getLast</a>()
<a name="l00054"></a>00054 {<span class="keywordflow">return</span> (<a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp;)<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.getLast();}
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a45fc7f9836d302b2103640eb12bf75bc">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow)
<a name="l00057"></a>00057 {<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.set_used(usedNow);}
<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_vertex_buffer.html#a507db8fc7d49a013dbdfe30e7b43dbfb">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size)
<a name="l00060"></a>00060 {<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.reallocate(new_size);}
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <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_vertex_buffer.html#a4d94ab0ed64b3056226b2ffb79af9eff">allocated_size</a>()<span class="keyword"> const</span>
<a name="l00063"></a>00063 <span class="keyword"> </span>{
<a name="l00064"></a>00064 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.allocated_size();
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>* <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a3a22a8bc7d2f348038bf69821ccfd617">pointer</a>() {<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>.pointer();}
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac" title="Enumeration for all vertex types there are.">video::E_VERTEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#abbcf17e96150ae1f64b885cac99e6d0b">getType</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> T().getType();}
<a name="l00070"></a>00070 };
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="keyword">public</span>:
<a name="l00073"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">00073</a> IVertexList *<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>;
<a name="l00074"></a>00074
<a name="l00075"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad4bf5332e648536ac72a23a5fa0cd15d">00075</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad4bf5332e648536ac72a23a5fa0cd15d">CVertexBuffer</a>(<a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac" title="Enumeration for all vertex types there are.">video::E_VERTEX_TYPE</a> vertexType) : <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>(0),
<a name="l00076"></a>00076 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">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_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">ChangedID</a>(1)
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ace3a49ffecc7c99884bd0faa87670c15">setType</a>(vertexType);
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080
<a name="l00081"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#acf57c82352598d4a13e0389e7f73074a">00081</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad4bf5332e648536ac72a23a5fa0cd15d">CVertexBuffer</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1scene_1_1_i_vertex_buffer.html">IVertexBuffer</a> &amp;VertexBufferCopy) :
<a name="l00082"></a>00082 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>(0), <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">MappingHint</a>(<a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27a6eaae9a4147dfc68ce11fa12b9ce3c0d" title="Don&#39;t store on the hardware.">EHM_NEVER</a>),
<a name="l00083"></a>00083 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">ChangedID</a>(1)
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ace3a49ffecc7c99884bd0faa87670c15">setType</a>(VertexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_vertex_buffer.html#a2ab45f42d92d3fd65a25fecb95b7efc7">getType</a>());
<a name="l00086"></a>00086 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a507db8fc7d49a013dbdfe30e7b43dbfb">reallocate</a>(VertexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_vertex_buffer.html#a566e42d179469d49eb5df7e3b26f84e4">size</a>());
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> n=0;n&lt;VertexBufferCopy.<a class="code" href="classirr_1_1scene_1_1_i_vertex_buffer.html#a566e42d179469d49eb5df7e3b26f84e4">size</a>();++n)
<a name="l00089"></a>00089 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a7abb02f71ff8f7c99b79bfabca776b6e">push_back</a>(VertexBufferCopy[n]);
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091
<a name="l00092"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#adcaeef7c88a4cc126cc8a675acbc43a1">00092</a> <span class="keyword">virtual</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#adcaeef7c88a4cc126cc8a675acbc43a1">~CVertexBuffer</a>()
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 <span class="keyword">delete</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096
<a name="l00097"></a>00097
<a name="l00098"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ace3a49ffecc7c99884bd0faa87670c15">00098</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ace3a49ffecc7c99884bd0faa87670c15">setType</a>(<a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac" title="Enumeration for all vertex types there are.">video::E_VERTEX_TYPE</a> vertexType)
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100 IVertexList *NewVertices=0;
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <span class="keywordflow">switch</span> (vertexType)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca98c8b791280bbf9252c4f4a37e91a416" title="Standard vertex type used by the Irrlicht engine, video::S3DVertex.">video::EVT_STANDARD</a>:
<a name="l00105"></a>00105 {
<a name="l00106"></a>00106 NewVertices=<span class="keyword">new</span> CSpecificVertexList&lt;video::S3DVertex&gt;;
<a name="l00107"></a>00107 <span class="keywordflow">break</span>;
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca7b5127a706ee33eb4385d702da007016" title="Vertex with two texture coordinates, video::S3DVertex2TCoords.">video::EVT_2TCOORDS</a>:
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111 NewVertices=<span class="keyword">new</span> CSpecificVertexList&lt;video::S3DVertex2TCoords&gt;;
<a name="l00112"></a>00112 <span class="keywordflow">break</span>;
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca8c50b5b2c88f08709d640fecc83dfb9b" title="Vertex with a tangent and binormal vector, video::S3DVertexTangents.">video::EVT_TANGENTS</a>:
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116 NewVertices=<span class="keyword">new</span> CSpecificVertexList&lt;video::S3DVertexTangents&gt;;
<a name="l00117"></a>00117 <span class="keywordflow">break</span>;
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 NewVertices-&gt;reallocate( <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;size() );
<a name="l00123"></a>00123
<a name="l00124"></a>00124 <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_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;size();++n)
<a name="l00125"></a>00125 NewVertices-&gt;push_back((*<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>)[n]);
<a name="l00126"></a>00126
<a name="l00127"></a>00127 <span class="keyword">delete</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>;
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>=NewVertices;
<a name="l00131"></a>00131 }
<a name="l00132"></a>00132
<a name="l00133"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a6c56b06182ba765e66e1eb71e26c59e4">00133</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a6c56b06182ba765e66e1eb71e26c59e4">getData</a>() {<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;pointer();}
<a name="l00134"></a>00134
<a name="l00135"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#abbcf17e96150ae1f64b885cac99e6d0b">00135</a> <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac" title="Enumeration for all vertex types there are.">video::E_VERTEX_TYPE</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#abbcf17e96150ae1f64b885cac99e6d0b">getType</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;getType();}
<a name="l00136"></a>00136
<a name="l00137"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ab305ac3ee0c058791b0eb6a50232386e">00137</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_vertex_buffer.html#ab305ac3ee0c058791b0eb6a50232386e">stride</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;stride();}
<a name="l00138"></a>00138
<a name="l00139"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#abfe7f69d79a2f5724df21cdb2321257e">00139</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_vertex_buffer.html#abfe7f69d79a2f5724df21cdb2321257e">size</a>()<span class="keyword"> const</span>
<a name="l00140"></a>00140 <span class="keyword"> </span>{
<a name="l00141"></a>00141 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;size();
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143
<a name="l00144"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a7abb02f71ff8f7c99b79bfabca776b6e">00144</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a7abb02f71ff8f7c99b79bfabca776b6e">push_back</a> (<span class="keyword">const</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a> &amp;element)
<a name="l00145"></a>00145 {
<a name="l00146"></a>00146 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;push_back(element);
<a name="l00147"></a>00147 }
<a name="l00148"></a>00148
<a name="l00149"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ac70ac1ba337405df3b58ea32377daee2">00149</a> <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ac70ac1ba337405df3b58ea32377daee2">operator []</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index)<span class="keyword"> const</span>
<a name="l00150"></a>00150 <span class="keyword"> </span>{
<a name="l00151"></a>00151 <span class="keywordflow">return</span> (*<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>)[index];
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153
<a name="l00154"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad3f007946704cc43a1c40cd7d875e060">00154</a> <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>&amp; <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad3f007946704cc43a1c40cd7d875e060">getLast</a>()
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;getLast();
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00159"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a45fc7f9836d302b2103640eb12bf75bc">00159</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a45fc7f9836d302b2103640eb12bf75bc">set_used</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> usedNow)
<a name="l00160"></a>00160 {
<a name="l00161"></a>00161 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;set_used(usedNow);
<a name="l00162"></a>00162 }
<a name="l00163"></a>00163
<a name="l00164"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a507db8fc7d49a013dbdfe30e7b43dbfb">00164</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a507db8fc7d49a013dbdfe30e7b43dbfb">reallocate</a>(<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> new_size)
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;reallocate(new_size);
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168
<a name="l00169"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a4d94ab0ed64b3056226b2ffb79af9eff">00169</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_vertex_buffer.html#a4d94ab0ed64b3056226b2ffb79af9eff">allocated_size</a>()<span class="keyword"> const</span>
<a name="l00170"></a>00170 <span class="keyword"> </span>{
<a name="l00171"></a>00171 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;allocated_size();
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173
<a name="l00174"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a3a22a8bc7d2f348038bf69821ccfd617">00174</a> <span class="keyword">virtual</span> <a class="code" href="structirr_1_1video_1_1_s3_d_vertex.html" title="standard vertex used by the Irrlicht engine.">video::S3DVertex</a>* <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a3a22a8bc7d2f348038bf69821ccfd617">pointer</a>()
<a name="l00175"></a>00175 {
<a name="l00176"></a>00176 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0b86125fc6697ec8f0bd900b159c34ff">Vertices</a>-&gt;pointer();
<a name="l00177"></a>00177 }
<a name="l00178"></a>00178
<a name="l00180"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a6c366d27c24dac566eea8942c394514d">00180</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_vertex_buffer.html#a6c366d27c24dac566eea8942c394514d" title="get the current hardware mapping hint">getHardwareMappingHint</a>()<span class="keyword"> const</span>
<a name="l00181"></a>00181 <span class="keyword"> </span>{
<a name="l00182"></a>00182 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">MappingHint</a>;
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184
<a name="l00186"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a6e547be081039dc9b8c3eafecc21c71b">00186</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a6e547be081039dc9b8c3eafecc21c71b" 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="l00187"></a>00187 {
<a name="l00188"></a>00188 <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">MappingHint</a>=NewMappingHint;
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190
<a name="l00192"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad33248bf26982ff803cca1b3715ce612">00192</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#ad33248bf26982ff803cca1b3715ce612" title="flags the mesh as changed, reloads hardware buffers">setDirty</a>()
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194 ++<a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">ChangedID</a>;
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196
<a name="l00198"></a>00198
<a name="l00199"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a0844a1bc60637c8882a9ef85b450ebb3">00199</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_vertex_buffer.html#a0844a1bc60637c8882a9ef85b450ebb3" 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_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">ChangedID</a>;}
<a name="l00200"></a>00200
<a name="l00201"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">00201</a> <a class="code" href="namespaceirr_1_1scene.html#ac7d8ee8d77da75f2580bb9bb17231c27">E_HARDWARE_MAPPING</a> <a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#a858dfe64886c3332f52d461b52d68081">MappingHint</a>;
<a name="l00202"></a><a class="code" href="classirr_1_1scene_1_1_c_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">00202</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_vertex_buffer.html#aaa37f912e8c19841d75744ecbf52a242">ChangedID</a>;
<a name="l00203"></a>00203 };
<a name="l00204"></a>00204
<a name="l00205"></a>00205
<a name="l00206"></a>00206 } <span class="comment">// end namespace scene</span>
<a name="l00207"></a>00207 } <span class="comment">// end namespace irr</span>
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <span class="preprocessor">#endif</span>
<a name="l00210"></a>00210 <span class="preprocessor"></span>
</pre></div></div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="_c_vertex_buffer_8h.html">CVertexBuffer.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 Tue Jan 19 2016 16:08:45 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>