diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a03686.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03686.html | 1406 |
1 files changed, 1406 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03686.html b/docs/doxygen/nel/a03686.html new file mode 100644 index 00000000..eea30f96 --- /dev/null +++ b/docs/doxygen/nel/a03686.html @@ -0,0 +1,1406 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NL3D::CVegetableVBAllocator class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NL3D::CVegetableVBAllocator Class Reference</h1><code>#include <<a class="el" href="a06709.html">vegetablevb_allocator.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A VB allocator (landscape like). Big difference is that here, we do not really matter about reallocation because both software and hardware VB are present. Also, VertexProgram MUST be supported by driver here. NB: unlike Landscape VBAllocator, the VertexProgram is not managed by this class. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00058">58</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>VB mgt .</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_0">allocateVertexBufferAndFillVBHard</a> (<a class="el" href="a04558.html#a11">uint32</a> numVertices)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_1">deleteVertexBufferHard</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">delete only the Vertexbuffer hard. <a href="#NL3D_1_1CVegetableVBAllocatorz1140_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_2">setupVBFormat</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">_AGPBufferPtr</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03321.html">NLMISC::CRefPtr</a>< <a class="el" href="a02434.html">IDriver</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum vertices in BufferHard allowed for this VBAllocator. <a href="#NL3D_1_1CVegetableVBAllocatorz1140_6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03321.html">NLMISC::CRefPtr</a>< <a class="el" href="a03694.html">IVertexBufferHard</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a></td></tr> + +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">TVBType</a> { <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw2">VBTypeLighted</a> = 0, +<a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw3">VBTypeUnlit</a>, +<a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw1">VBTypeCount</a> + }</td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatora0">clear</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatora1">CVegetableVBAllocator</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CVegetableVBAllocatora1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatora2">init</a> (<a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">TVBType</a> vbType, <a class="el" href="a04558.html#a15">uint</a> maxVertexInBufferHard)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatora3">updateDriver</a> (<a class="el" href="a02434.html">IDriver</a> *driver)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatora4">~CVegetableVBAllocator</a> ()</td></tr> + +<tr><td colspan="2"><div class="groupHeader">Buffer access.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_0">activate</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_1">bufferLocked</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_2">flushVertex</a> (<a class="el" href="a04558.html#a15">uint</a> i)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If VBHard ok, copy the vertex in AGP. Warning: buffer must be locked! <a href="#NL3D_1_1CVegetableVBAllocatorz1138_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03692.html">CVertexBuffer</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_3">getSoftwareVertexBuffer</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_4">getVertexPointer</a> (<a class="el" href="a04558.html#a15">uint</a> i)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get the software VB pointer to the ith index. valid only beetween 2 <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_0">allocateVertex()</a>. <a href="#NL3D_1_1CVegetableVBAllocatorz1138_4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_5">lockBuffer</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">if any, lock the AGP buffer. <a href="#NL3D_1_1CVegetableVBAllocatorz1138_5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_6">unlockBuffer</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">if any, unlock the AGP buffer. <a href="#NL3D_1_1CVegetableVBAllocatorz1138_6"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Allocation.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_0">allocateVertex</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_1">deleteVertex</a> (<a class="el" href="a04558.html#a15">uint</a> vid)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete free vertices in VB. (AGP or RAM). <a href="#NL3D_1_1CVegetableVBAllocatorz1136_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_2">exceedMaxVertexInBufferHard</a> (<a class="el" href="a04558.html#a15">uint</a> numAddVerts) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_3">getNumUserVerticesAllocated</a> () const </td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">TVBType</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr1">_Type</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a15">uint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03687.html">CVertexInfo</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">_VertexInfos</a></td></tr> + +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorw0" doxytag="NL3D::CVegetableVBAllocator::TVBType" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> enum <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">NL3D::CVegetableVBAllocator::TVBType</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw2" doxytag="VBTypeLighted" ></a>VBTypeLighted</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw3" doxytag="VBTypeUnlit" ></a>VBTypeUnlit</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw1" doxytag="VBTypeCount" ></a>VBTypeCount</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a06709.html#l00062">62</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. +<p> +<div class="fragment"><pre>00062 {<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw2">VBTypeLighted</a>=0, <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw3">VBTypeUnlit</a>, <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw1">VBTypeCount</a>}; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatora1" doxytag="NL3D::CVegetableVBAllocator::CVegetableVBAllocator" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NL3D::CVegetableVBAllocator::CVegetableVBAllocator </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00055">55</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00158">_AGPBufferPtr</a>, <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06708.html#l00051">NL3D_VEGETABLE_VERTEX_FREE_MEMORY_RESERVE</a>, and <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw3">VBTypeUnlit</a>. +<p> +<div class="fragment"><pre>00056 { +00057 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr1">_Type</a>= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw3">VBTypeUnlit</a>; +00058 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>= 0; +00059 +00060 <span class="comment">// Init free list</span> +00061 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.reserve(NL3D_VEGETABLE_VERTEX_FREE_MEMORY_RESERVE); +00062 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>= 0; +00063 +00064 <span class="comment">// Init vbhard</span> +00065 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>= <span class="keyword">false</span>; +00066 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a>= <span class="keyword">false</span>; +00067 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">_AGPBufferPtr</a>= NULL; +00068 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatora4" doxytag="NL3D::CVegetableVBAllocator::~CVegetableVBAllocator" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NL3D::CVegetableVBAllocator::~<a class="el" href="a03686.html">CVegetableVBAllocator</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00083">83</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06708.html#l00126">clear()</a>. +<p> +<div class="fragment"><pre>00084 { +00085 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatora0">clear</a>(); +00086 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_0" doxytag="NL3D::CVegetableVBAllocator::activate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::activate </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +activate the VB or the VBHard in Driver setuped. nlassert if driver is NULL or if buffer is locked. +<p> +Definition at line <a class="el" href="a06708.html#l00266">266</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01713">NL3D::CVegetableManager::render()</a>, and <a class="el" href="a06688.html#l00077">NL3D::CVegetableBlendLayerModel::render()</a>. +<p> +<div class="fragment"><pre>00267 { +00268 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver); +00269 <a class="code" href="a04199.html#a6">nlassert</a>(!_BufferLocked); +00270 +00271 <span class="comment">// Activate VB.</span> +00272 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>) +00273 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->activeVertexBufferHard(_VBHard); +00274 <span class="keywordflow">else</span> +00275 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->activeVertexBuffer(_VB); +00276 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1136_0" doxytag="NL3D::CVegetableVBAllocator::allocateVertex" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CVegetableVBAllocator::allocateVertex </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Allocate free vertices in VB. (RAM and AGP if possible). work with locked or unlocked buffer. if VBHard reallocation occurs, VB is unlocked, destroyed, reallocated, and refilled. +<p> +Definition at line <a class="el" href="a06708.html#l00185">185</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, <a class="el" href="a06708.html#l00044">NL3D_VEGETABLE_VERTEX_ALLOCATE_SECURITY</a>, <a class="el" href="a06708.html#l00048">NL3D_VEGETABLE_VERTEX_ALLOCATE_START</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, and <a class="el" href="a06698.html#l01496">NL3D::CVegetableManager::swapIgRdrPassHardMode()</a>. +<p> +<div class="fragment"><pre>00186 { +00187 <span class="comment">// if no more free, allocate.</span> +00188 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.size()==0 ) +00189 { +00190 <span class="comment">// enlarge capacity.</span> +00191 <a class="code" href="a04558.html#a15">uint</a> newResize; +00192 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>==0) +00193 newResize= <a class="code" href="a05285.html#a1">NL3D_VEGETABLE_VERTEX_ALLOCATE_START</a>; +00194 <span class="keywordflow">else</span> +00195 newResize= <a class="code" href="a05285.html#a0">NL3D_VEGETABLE_VERTEX_ALLOCATE_SECURITY</a>; +00196 <span class="comment">// try to not overlap _MaxVertexInBufferHard limit, to avoid VBufferHard to be disabled.</span> +00197 <span class="keywordflow">if</span>(_NumVerticesAllocated<_MaxVertexInBufferHard && _NumVerticesAllocated+newResize > <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>) +00198 { +00199 newResize= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a> - <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>; +00200 } +00201 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>+= newResize; +00202 <span class="comment">// re-allocate VB.</span> +00203 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_0">allocateVertexBufferAndFillVBHard</a>(_NumVerticesAllocated); +00204 <span class="comment">// resize infos on vertices.</span> +00205 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">_VertexInfos</a>.resize(_NumVerticesAllocated); +00206 +00207 <span class="comment">// Fill list of free elements.</span> +00208 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<newResize;i++) +00209 { +00210 <span class="comment">// create a new entry which points to this vertex.</span> +00211 <span class="comment">// the list is made so allocation is in growing order.</span> +00212 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.push_back( _NumVerticesAllocated - (i+1) ); +00213 +00214 <span class="comment">// Mark as free the new vertices. (Debug).</span> +00215 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">_VertexInfos</a>[<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a> - (i+1)].Free= <span class="keyword">true</span>; +00216 } +00217 } +00218 +00219 <span class="comment">// get a vertex (pop_back).</span> +00220 <a class="code" href="a04558.html#a15">uint</a> <span class="keywordtype">id</span>= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.back(); +00221 <span class="comment">// delete this vertex free entry.</span> +00222 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.pop_back(); +00223 +00224 <span class="comment">// check and Mark as not free the vertex. (Debug).</span> +00225 <a class="code" href="a04199.html#a6">nlassert</a>(<span class="keywordtype">id</span><_NumVerticesAllocated); +00226 <a class="code" href="a04199.html#a6">nlassert</a>(_VertexInfos[<span class="keywordtype">id</span>].Free); +00227 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">_VertexInfos</a>[<span class="keywordtype">id</span>].Free= <span class="keyword">false</span>; +00228 +00229 +00230 <span class="keywordflow">return</span> <span class="keywordtype">id</span>; +00231 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_0" doxytag="NL3D::CVegetableVBAllocator::allocateVertexBufferAndFillVBHard" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::allocateVertexBufferAndFillVBHard </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>numVertices</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00306">306</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00158">_AGPBufferPtr</a>, <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06709.html#l00120">bufferLocked()</a>, <a class="el" href="a06711.html#l00504">NL3D::CVertexBuffer::getUVRouting()</a>, <a class="el" href="a06711.html#l00483">NL3D::CVertexBuffer::getValueTypePointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a06711.html#l00473">NL3D::CVertexBuffer::getVertexSize()</a>, <a class="el" href="a06708.html#l00144">lockBuffer()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a06708.html#l00158">unlockBuffer()</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00185">allocateVertex()</a>, and <a class="el" href="a06708.html#l00089">updateDriver()</a>. +<p> +<div class="fragment"><pre>00307 { +00308 <span class="comment">// resize the Soft VB.</span> +00309 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.setNumVertices(numVertices); +00310 +00311 <span class="comment">// no allocation must be done if the Driver is not setuped, or if the driver has been deleted by refPtr.</span> +00312 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver); +00313 +00314 <span class="comment">// must unlock VBhard before.</span> +00315 <span class="keywordtype">bool</span> wasLocked= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_1">bufferLocked</a>(); +00316 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_6">unlockBuffer</a>(); +00317 +00318 <span class="comment">// try to allocate a vbufferhard if possible.</span> +00319 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a> ) +00320 { +00321 <span class="comment">// delete possible old _VBHard.</span> +00322 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>!=NULL) +00323 { +00324 <span class="comment">// VertexBufferHard lifetime < Driver lifetime.</span> +00325 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver!=NULL); +00326 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->deleteVertexBufferHard(_VBHard); +00327 } +00328 +00329 <span class="comment">// try to create new one, in AGP Ram</span> +00330 <span class="comment">// If too many vertices wanted, abort VBHard.</span> +00331 <span class="keywordflow">if</span>(numVertices <= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>) +00332 { +00333 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->createVertexBufferHard(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexFormat(), <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getValueTypePointer(), numVertices, IDriver::VBHardAGP, <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getUVRouting()); +00334 <span class="comment">// Set Name For lock Profiling.</span> +00335 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>) +00336 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>->setName(<span class="stringliteral">"VegetableVB"</span>); +00337 } +00338 <span class="keywordflow">else</span> +00339 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>= NULL; +00340 +00341 <span class="comment">// If KO, never try again.</span> +00342 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>==NULL) +00343 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>= <span class="keyword">false</span>; +00344 <span class="keywordflow">else</span> +00345 { +00346 <span class="comment">// else, fill this AGP VBuffer Hard.</span> +00347 <span class="comment">// lock before the AGP buffer</span> +00348 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_5">lockBuffer</a>(); +00349 +00350 <span class="comment">// copy all the vertices to AGP.</span> +00351 memcpy(_AGPBufferPtr, <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexCoordPointer(0), <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexSize() * numVertices); +00352 +00353 <span class="comment">// If was not locked before, unlock this VB</span> +00354 <span class="keywordflow">if</span>(!wasLocked) +00355 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_6">unlockBuffer</a>(); +00356 } +00357 } +00358 +00359 <span class="comment">//nlinfo("VEGET: Alloc %d verts. %s", numVertices, _VBHardOk?"VBHard":"VBSoft");</span> +00360 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_1" doxytag="NL3D::CVegetableVBAllocator::bufferLocked" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NL3D::CVegetableVBAllocator::bufferLocked </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +activate the VB or the VBHard in Driver setuped. nlassert if driver is NULL or if buffer is locked. +<p> +Definition at line <a class="el" href="a06709.html#l00120">120</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>. +<p> +<div class="fragment"><pre>00120 {<span class="keywordflow">return</span> <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatora0" doxytag="NL3D::CVegetableVBAllocator::clear" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::clear </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00126">126</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06710.html#l00424">NL3D::CVertexBuffer::deleteAllVertices()</a>, and <a class="el" href="a06708.html#l00287">deleteVertexBufferHard()</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00083">~CVegetableVBAllocator()</a>. +<p> +<div class="fragment"><pre>00127 { +00128 <span class="comment">// clear list.</span> +00129 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.clear(); +00130 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>= 0; +00131 +00132 <span class="comment">// delete the VB.</span> +00133 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_1">deleteVertexBufferHard</a>(); +00134 <span class="comment">// really delete the VB soft too</span> +00135 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.deleteAllVertices(); +00136 +00137 <span class="comment">// clear other states.</span> +00138 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>= NULL; +00139 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>= <span class="keyword">false</span>; +00140 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1136_1" doxytag="NL3D::CVegetableVBAllocator::deleteVertex" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::deleteVertex </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>vid</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Delete free vertices in VB. (AGP or RAM). +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00234">234</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l00706">NL3D::CVegetableManager::deleteIg()</a>, and <a class="el" href="a06698.html#l01496">NL3D::CVegetableManager::swapIgRdrPassHardMode()</a>. +<p> +<div class="fragment"><pre>00235 { +00236 <span class="comment">// check and Mark as free the vertex. (Debug).</span> +00237 <a class="code" href="a04199.html#a6">nlassert</a>(vid<_NumVerticesAllocated); +00238 <a class="code" href="a04199.html#a6">nlassert</a>(!_VertexInfos[vid].Free); +00239 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">_VertexInfos</a>[vid].Free= <span class="keyword">true</span>; +00240 +00241 <span class="comment">// Add this vertex to the free list.</span> +00242 <span class="comment">// create a new entry which points to this vertex.</span> +00243 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.push_back( vid ); +00244 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_1" doxytag="NL3D::CVegetableVBAllocator::deleteVertexBufferHard" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::deleteVertexBufferHard </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +delete only the Vertexbuffer hard. +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00287">287</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06708.html#l00158">unlockBuffer()</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00126">clear()</a>, and <a class="el" href="a06708.html#l00089">updateDriver()</a>. +<p> +<div class="fragment"><pre>00288 { +00289 <span class="comment">// must unlock VBhard before.</span> +00290 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_6">unlockBuffer</a>(); +00291 +00292 <span class="comment">// test (refptr) if the object still exist in memory.</span> +00293 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>!=NULL) +00294 { +00295 <span class="comment">// A vbufferhard should still exist only if driver still exist.</span> +00296 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver!=NULL); +00297 +00298 <span class="comment">// delete it from driver.</span> +00299 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->deleteVertexBufferHard(_VBHard); +00300 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>= NULL; +00301 } +00302 +00303 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1136_2" doxytag="NL3D::CVegetableVBAllocator::exceedMaxVertexInBufferHard" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NL3D::CVegetableVBAllocator::exceedMaxVertexInBufferHard </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>numAddVerts</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +if I add numAddVerts vertices, will it overide _MaxVertexInBufferHard ?? +<p> +Definition at line <a class="el" href="a06708.html#l00178">178</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06708.html#l00171">getNumUserVerticesAllocated()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>. +<p> +<div class="fragment"><pre>00179 { +00180 <span class="keywordflow">return</span> (<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_3">getNumUserVerticesAllocated</a>() + numAddVerts) > <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>; +00181 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_2" doxytag="NL3D::CVegetableVBAllocator::flushVertex" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::flushVertex </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>i</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +If VBHard ok, copy the vertex in AGP. Warning: buffer must be locked! +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00253">253</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00158">_AGPBufferPtr</a>, <a class="el" href="a06708.html#l00247">getVertexPointer()</a>, <a class="el" href="a06711.html#l00473">NL3D::CVertexBuffer::getVertexSize()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05646.html#l01124">src</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06698.html#l01496">NL3D::CVegetableManager::swapIgRdrPassHardMode()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>. +<p> +<div class="fragment"><pre>00254 { +00255 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>) +00256 { +00257 <a class="code" href="a04199.html#a6">nlassert</a>(_VBHard && _BufferLocked); +00258 <span class="comment">// copy the VB soft to the VBHard.</span> +00259 <span class="keywordtype">void</span> *<a class="code" href="a04223.html#a652">src</a>= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_4">getVertexPointer</a>(i); +00260 <span class="keywordtype">void</span> *dst= <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">_AGPBufferPtr</a> + i*<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexSize(); +00261 memcpy(dst, src, <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexSize()); +00262 } +00263 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1136_3" doxytag="NL3D::CVegetableVBAllocator::getNumUserVerticesAllocated" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CVegetableVBAllocator::getNumUserVerticesAllocated </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return number of vertices allocated with <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_0">allocateVertex()</a> (NB: do not return the actual number of vertices allocated in VBuffer, but the number of vertices asked to be allocated). +<p> +Definition at line <a class="el" href="a06708.html#l00171">171</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00178">exceedMaxVertexInBufferHard()</a>, and <a class="el" href="a06698.html#l01713">NL3D::CVegetableManager::render()</a>. +<p> +<div class="fragment"><pre>00172 { +00173 <span class="comment">// get the number of vertices which are allocated by allocateVertex().</span> +00174 <span class="keywordflow">return</span> <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a> - <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">_VertexFreeMemory</a>.size(); +00175 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_3" doxytag="NL3D::CVegetableVBAllocator::getSoftwareVertexBuffer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a03692.html">CVertexBuffer</a>& NL3D::CVegetableVBAllocator::getSoftwareVertexBuffer </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +activate the VB or the VBHard in Driver setuped. nlassert if driver is NULL or if buffer is locked. +<p> +Definition at line <a class="el" href="a06709.html#l00112">112</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06698.html#l01496">NL3D::CVegetableManager::swapIgRdrPassHardMode()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>. +<p> +<div class="fragment"><pre>00112 {<span class="keywordflow">return</span> <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_4" doxytag="NL3D::CVegetableVBAllocator::getVertexPointer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void * NL3D::CVegetableVBAllocator::getVertexPointer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>i</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +get the software VB pointer to the ith index. valid only beetween 2 <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1136_0">allocateVertex()</a>. +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00247">247</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06708.html#l00253">flushVertex()</a>, <a class="el" href="a06698.html#l01496">NL3D::CVegetableManager::swapIgRdrPassHardMode()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>. +<p> +<div class="fragment"><pre>00248 { +00249 <span class="keywordflow">return</span> <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.getVertexCoordPointer(i); +00250 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatora2" doxytag="NL3D::CVegetableVBAllocator::init" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::init </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">TVBType</a> </td> + <td class="mdname" nowrap> <em>vbType</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>maxVertexInBufferHard</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +init the VB allocator, with the good type. must do it first. maxVertexInBufferHard is the maximum vertex allowed to reside in AGP mem. if More are allocated, then VBHard is disabled, and replaced with software VB (slower!), for ever. +<p> +Definition at line <a class="el" href="a06708.html#l00072">72</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06708.html#l00364">setupVBFormat()</a>, <a class="el" href="a05646.html#l00244">type</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06698.html#l00058">NL3D::CVegetableManager::CVegetableManager()</a>. +<p> +<div class="fragment"><pre>00073 { +00074 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr1">_Type</a>= <a class="code" href="a04223.html#a581">type</a>; +00075 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>= maxVertexInBufferHard; +00076 +00077 <span class="comment">// According to _Type, build VB format, and create VertexProgram</span> +00078 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_2">setupVBFormat</a>(); +00079 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_5" doxytag="NL3D::CVegetableVBAllocator::lockBuffer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::lockBuffer </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +if any, lock the AGP buffer. +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00144">144</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00158">_AGPBufferPtr</a>, <a class="el" href="a05981.html#l00096">uint8</a>, and <a class="el" href="a06708.html#l00158">unlockBuffer()</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, and <a class="el" href="a06698.html#l01622">NL3D::CVegetableManager::lockBuffers()</a>. +<p> +<div class="fragment"><pre>00145 { +00146 <span class="comment">// force unlock</span> +00147 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1138_6">unlockBuffer</a>(); +00148 +00149 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>) +00150 { +00151 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">_AGPBufferPtr</a>= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>->lock(); +00152 } +00153 +00154 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a>= <span class="keyword">true</span>; +00155 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_2" doxytag="NL3D::CVegetableVBAllocator::setupVBFormat" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::setupVBFormat </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00364">364</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06710.html#l00338">NL3D::CVertexBuffer::addValueEx()</a>, <a class="el" href="a06710.html#l00271">NL3D::CVertexBuffer::clearValueEx()</a>, <a class="el" href="a06710.html#l00369">NL3D::CVertexBuffer::initEx()</a>, <a class="el" href="a06709.html#l00044">NL3D_VEGETABLE_VPPOS_BENDINFO</a>, <a class="el" href="a06709.html#l00045">NL3D_VEGETABLE_VPPOS_CENTER</a>, <a class="el" href="a06709.html#l00041">NL3D_VEGETABLE_VPPOS_COLOR0</a>, <a class="el" href="a06709.html#l00042">NL3D_VEGETABLE_VPPOS_COLOR1</a>, <a class="el" href="a06709.html#l00040">NL3D_VEGETABLE_VPPOS_NORMAL</a>, <a class="el" href="a06709.html#l00039">NL3D_VEGETABLE_VPPOS_POS</a>, <a class="el" href="a06709.html#l00043">NL3D_VEGETABLE_VPPOS_TEX0</a>, and <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw2">VBTypeLighted</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00072">init()</a>. +<p> +<div class="fragment"><pre>00365 { +00366 <span class="comment">// Build the Vertex Format.</span> +00367 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.clearValueEx(); +00368 +00369 <span class="comment">// if lighted, need world space normal and AmbientColor for each vertex.</span> +00370 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr1">_Type</a> == <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0NL3D_1_1CVegetableVBAllocatorw2">VBTypeLighted</a> ) +00371 { +00372 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_POS, CVertexBuffer::Float3); <span class="comment">// v[0]</span> +00373 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_NORMAL, CVertexBuffer::Float3); <span class="comment">// v[2]</span> +00374 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_BENDINFO, CVertexBuffer::Float3); <span class="comment">// v[9]</span> +00375 } +00376 <span class="comment">// If unlit</span> +00377 <span class="keywordflow">else</span> +00378 { +00379 <span class="comment">// slightly different VertexProgram, v[0].w== BendWeight, and v[9].x== v[0].norm()</span> +00380 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_POS, CVertexBuffer::Float4); <span class="comment">// v[0]</span> +00381 <span class="comment">// Unlit VP has BlendDistance in v[9].w</span> +00382 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_BENDINFO, CVertexBuffer::Float4); <span class="comment">// v[9]</span> +00383 } +00384 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_COLOR0, CVertexBuffer::UChar4); <span class="comment">// v[3]</span> +00385 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_COLOR1, CVertexBuffer::UChar4); <span class="comment">// v[4]</span> +00386 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_TEX0, CVertexBuffer::Float2); <span class="comment">// v[8]</span> +00387 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.addValueEx(NL3D_VEGETABLE_VPPOS_CENTER, CVertexBuffer::Float3); <span class="comment">// v[10]</span> +00388 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">_VB</a>.initEx(); +00389 +00390 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1138_6" doxytag="NL3D::CVegetableVBAllocator::unlockBuffer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::unlockBuffer </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +if any, unlock the AGP buffer. +<p> + +<p> +Definition at line <a class="el" href="a06708.html#l00158">158</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00158">_AGPBufferPtr</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, <a class="el" href="a06708.html#l00287">deleteVertexBufferHard()</a>, <a class="el" href="a06708.html#l00144">lockBuffer()</a>, and <a class="el" href="a06698.html#l01633">NL3D::CVegetableManager::unlockBuffers()</a>. +<p> +<div class="fragment"><pre>00159 { +00160 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a>) +00161 { +00162 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>) +00163 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>->unlock(); +00164 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">_BufferLocked</a>= <span class="keyword">false</span>; +00165 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">_AGPBufferPtr</a>= NULL; +00166 } +00167 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatora3" doxytag="NL3D::CVegetableVBAllocator::updateDriver" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CVegetableVBAllocator::updateDriver </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>driver</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +setup driver, and test for possible VBHard reallocation. if reallocation, refill the VBHard to do anytime you're not sure of change of the driver/vbHard state.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>driver</em> </td><td>must not be NULL.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a06708.html#l00089">89</a> of file <a class="el" href="a06708.html">vegetablevb_allocator.cpp</a>. +<p> +References <a class="el" href="a06709.html#l00160">_MaxVertexInBufferHard</a>, <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, <a class="el" href="a06708.html#l00287">deleteVertexBufferHard()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01569">NL3D::CVegetableManager::updateDriver()</a>. +<p> +<div class="fragment"><pre>00090 { +00091 <span class="comment">// test change of driver.</span> +00092 <a class="code" href="a04199.html#a6">nlassert</a>(driver && !_BufferLocked); +00093 <span class="comment">// If change of driver</span> +00094 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>==NULL || driver!=<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a> ) +00095 { +00096 <span class="comment">// delete old VBHard.</span> +00097 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_1">deleteVertexBufferHard</a>(); +00098 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>= driver; +00099 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>= (<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">_MaxVertexInBufferHard</a>>0) && (<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->supportVertexBufferHard()); +00100 <span class="comment">/* Because so much lock/unlock are performed during a frame (refine/clip etc...).</span> +00101 <span class="comment"> we must disable VBHard for ATI Gl extension.</span> +00102 <span class="comment"> NB: CLandscape don't do this and fast copy the entire VB each frame.</span> +00103 <span class="comment"> This is not possible for vegetables because the VB describe all Vegetable around the camera, not only</span> +00104 <span class="comment"> what is in frustrum. Hence a fast copy each frame would copy far too much unseen vertices (4x).</span> +00105 <span class="comment"> */</span> +00106 <span class="keywordflow">if</span>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->slowUnlockVertexBufferHard()) +00107 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a>= <span class="keyword">false</span>; +00108 +00109 <span class="comment">// Driver must support VP.</span> +00110 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">_Driver</a>->isVertexProgramSupported()); +00111 +00112 <span class="comment">// must reallocate the VertexBuffer.</span> +00113 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>>0 ) +00114 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_0">allocateVertexBufferAndFillVBHard</a>(_NumVerticesAllocated); +00115 } +00116 <span class="keywordflow">else</span> +00117 { +00118 <span class="comment">// if VBHard possible, and if vbHardDeleted but space needed, reallocate.</span> +00119 <span class="keywordflow">if</span>( <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">_VBHardOk</a> && <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">_VBHard</a>==NULL && <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">_NumVerticesAllocated</a>>0 ) +00120 <a class="code" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_0">allocateVertexBufferAndFillVBHard</a>(_NumVerticesAllocated); +00121 } +00122 +00123 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_3" doxytag="NL3D::CVegetableVBAllocator::_AGPBufferPtr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a>* <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_3">NL3D::CVegetableVBAllocator::_AGPBufferPtr</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00158">158</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, <a class="el" href="a06708.html#l00055">CVegetableVBAllocator()</a>, <a class="el" href="a06708.html#l00253">flushVertex()</a>, <a class="el" href="a06708.html#l00144">lockBuffer()</a>, and <a class="el" href="a06708.html#l00158">unlockBuffer()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_4" doxytag="NL3D::CVegetableVBAllocator::_BufferLocked" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_4">NL3D::CVegetableVBAllocator::_BufferLocked</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00157">157</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_5" doxytag="NL3D::CVegetableVBAllocator::_Driver" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03321.html">NLMISC::CRefPtr</a><<a class="el" href="a02434.html">IDriver</a>> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_5">NL3D::CVegetableVBAllocator::_Driver</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00153">153</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_6" doxytag="NL3D::CVegetableVBAllocator::_MaxVertexInBufferHard" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_6">NL3D::CVegetableVBAllocator::_MaxVertexInBufferHard</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Maximum vertices in BufferHard allowed for this VBAllocator. +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00160">160</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. +<p> +Referenced by <a class="el" href="a06708.html#l00185">allocateVertex()</a>, <a class="el" href="a06708.html#l00306">allocateVertexBufferAndFillVBHard()</a>, <a class="el" href="a06708.html#l00055">CVegetableVBAllocator()</a>, <a class="el" href="a06708.html#l00178">exceedMaxVertexInBufferHard()</a>, <a class="el" href="a06708.html#l00072">init()</a>, and <a class="el" href="a06708.html#l00089">updateDriver()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorr0" doxytag="NL3D::CVegetableVBAllocator::_NumVerticesAllocated" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr0">NL3D::CVegetableVBAllocator::_NumVerticesAllocated</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00143">143</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorr1" doxytag="NL3D::CVegetableVBAllocator::_Type" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorw0">TVBType</a> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr1">NL3D::CVegetableVBAllocator::_Type</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00138">138</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_7" doxytag="NL3D::CVegetableVBAllocator::_VB" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03692.html">CVertexBuffer</a> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_7">NL3D::CVegetableVBAllocator::_VB</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00150">150</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_8" doxytag="NL3D::CVegetableVBAllocator::_VBHard" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03321.html">NLMISC::CRefPtr</a><<a class="el" href="a03694.html">IVertexBufferHard</a>> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_8">NL3D::CVegetableVBAllocator::_VBHard</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00156">156</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorz1140_9" doxytag="NL3D::CVegetableVBAllocator::_VBHardOk" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorz1140_9">NL3D::CVegetableVBAllocator::_VBHardOk</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00155">155</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorr2" doxytag="NL3D::CVegetableVBAllocator::_VertexFreeMemory" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a04558.html#a15">uint</a>> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr2">NL3D::CVegetableVBAllocator::_VertexFreeMemory</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00141">141</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CVegetableVBAllocatorr3" doxytag="NL3D::CVegetableVBAllocator::_VertexInfos" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a03687.html">CVertexInfo</a>> <a class="el" href="a03686.html#NL3D_1_1CVegetableVBAllocatorr3">NL3D::CVegetableVBAllocator::_VertexInfos</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06709.html#l00142">142</a> of file <a class="el" href="a06709.html">vegetablevb_allocator.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06709.html">vegetablevb_allocator.h</a><li><a class="el" href="a06708.html">vegetablevb_allocator.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:22:56 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |