aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/dru_cpp-source.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/dru_cpp-source.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/dru_cpp-source.html521
1 files changed, 521 insertions, 0 deletions
diff --git a/docs/doxygen/nel/dru_cpp-source.html b/docs/doxygen/nel/dru_cpp-source.html
new file mode 100644
index 00000000..7fcd8718
--- /dev/null
+++ b/docs/doxygen/nel/dru_cpp-source.html
@@ -0,0 +1,521 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+ <TITLE>nevrax.org : docs</TITLE>
+ <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
+
+<!-- uplinks -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ </TR>
+</TABLE>
+
+<!-- banner Nevrax -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
+ <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
+</TABLE>
+
+<!-- main table -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+ <!------ Begin Box ------>
+ <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
+ <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
+ <TABLE cellspacing=0 cellpadding=1 border=0>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr>
+ </TABLE>
+ </TD></TR></TABLE></TD></TR></TABLE>
+ <!------ End Box ------>
+
+ </TD>
+ <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+<!-- title -->
+<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
+<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
+</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
+</td></tr></table>
+&nbsp;
+
+<!-- block -->
+<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD>
+ <TD><B>Documentation</B></TD>
+ <TD ALIGN=RIGHT>&nbsp;</td>
+</tr></table>
+<!-- Generated by Doxygen 1.2.2 on Wed May 30 22:01:08 2001 -->
+<center>
+<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
+<hr><h1>dru.cpp</h1><a href="dru_cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
+00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.
+</font>00008 <font class="comment"> *
+</font>00009 <font class="comment"> * This file is part of NEVRAX NEL.
+</font>00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify
+</font>00011 <font class="comment"> * it under the terms of the GNU General Public License as published by
+</font>00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)
+</font>00013 <font class="comment"> * any later version.
+</font>00014 <font class="comment">
+</font>00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but
+</font>00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of
+</font>00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+</font>00018 <font class="comment"> * General Public License for more details.
+</font>00019 <font class="comment">
+</font>00020 <font class="comment"> * You should have received a copy of the GNU General Public License
+</font>00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the
+</font>00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+</font>00023 <font class="comment"> * MA 02111-1307, USA.
+</font>00024 <font class="comment"> */</font>
+00025
+00026 <font class="preprocessor">#include "<a class="code" href="types_nl_h.html">nel/misc/types_nl.h</a>"</font>
+00027
+00028 <font class="preprocessor">#include "<a class="code" href="dru_h.html">nel/3d/dru.h</a>"</font>
+00029 <font class="preprocessor">#include "<a class="code" href="driver_h.html">nel/3d/driver.h</a>"</font>
+00030 <font class="preprocessor">#include "<a class="code" href="material_h.html">nel/3d/material.h</a>"</font>
+00031 <font class="preprocessor">#include "<a class="code" href="vertex_buffer_h.html">nel/3d/vertex_buffer.h</a>"</font>
+00032 <font class="preprocessor">#include "<a class="code" href="primitive_block_h.html">nel/3d/primitive_block.h</a>"</font>
+00033
+00034
+00035 <font class="preprocessor">#ifdef NL_OS_WINDOWS
+</font>00036 <font class="preprocessor"></font>
+00037 <font class="preprocessor">#include &lt;windows.h&gt;</font>
+00038
+00039 <font class="preprocessor">#else // NL_OS_WINDOWS
+</font>00040 <font class="preprocessor"></font>
+00041 <font class="preprocessor">#include &lt;dlfcn.h&gt;</font>
+00042
+00043 <font class="preprocessor">#endif // NL_OS_WINDOWS
+</font>00044 <font class="preprocessor"></font>
+00045 <font class="keyword">namespace</font> NL3D
+00046 {
+00047
+00048
+00049 <font class="keyword">typedef</font> IDriver* (*IDRV_CREATE_PROC)(<font class="keywordtype">void</font>);
+<a name="l00050"></a><a class="code" href="namespace_NL3D.html#a128">00050</a> <font class="keyword">const</font> <font class="keywordtype">char</font> *IDRV_CREATE_PROC_NAME = <font class="stringliteral">"NL3D_createIDriverInstance"</font>;
+00051
+00052 <font class="keyword">typedef</font> <a class="code" href="types_nl_h.html#a9">uint32</a> (*IDRV_VERSION_PROC)(<font class="keywordtype">void</font>);
+<a name="l00053"></a><a class="code" href="namespace_NL3D.html#a130">00053</a> <font class="keyword">const</font> <font class="keywordtype">char</font> *IDRV_VERSION_PROC_NAME = <font class="stringliteral">"NL3D_interfaceVersion"</font>;
+00054
+00055
+00056 <font class="comment">// ***************************************************************************</font>
+<a name="l00057"></a><a class="code" href="class_NL3D__CDRU.html#d0">00057</a> IDriver *CDRU::createGlDriver() <font class="keywordflow">throw</font> (EDru)
+00058 {
+00059 IDRV_CREATE_PROC createDriver = NULL;
+00060 IDRV_VERSION_PROC versionDriver = NULL;
+00061
+00062 <font class="preprocessor">#ifdef NL_OS_WINDOWS
+</font>00063 <font class="preprocessor"></font>
+00064 <font class="comment">// WINDOWS code.</font>
+00065 HINSTANCE hInst;
+00066
+00067 hInst=LoadLibrary(NL3D_DLL_NAME);
+00068
+00069 <font class="keywordflow">if</font> (!hInst)
+00070 {
+00071 <font class="keywordflow">throw</font> EDruOpenglDriverNotFound();
+00072 }
+00073
+00074 createDriver = (IDRV_CREATE_PROC) GetProcAddress (hInst, IDRV_CREATE_PROC_NAME);
+00075 <font class="keywordflow">if</font> (createDriver == NULL)
+00076 {
+00077 <font class="keywordflow">throw</font> EDruOpenglDriverCorrupted();
+00078 }
+00079
+00080 versionDriver = (IDRV_VERSION_PROC) GetProcAddress (hInst, IDRV_VERSION_PROC_NAME);
+00081 <font class="keywordflow">if</font> (versionDriver != NULL)
+00082 {
+00083 <font class="keywordflow">if</font> (versionDriver()&lt;IDriver::InterfaceVersion)
+00084 <font class="keywordflow">throw</font> EDruOpenglDriverOldVersion();
+00085 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (versionDriver()&gt;IDriver::InterfaceVersion)
+00086 <font class="keywordflow">throw</font> EDruOpenglDriverUnknownVersion();
+00087 }
+00088
+00089 <font class="preprocessor">#elif defined (NL_OS_UNIX)
+</font>00090 <font class="preprocessor"></font>
+00091 <font class="keywordtype">void</font> *handle = dlopen(NL3D_DLL_NAME, RTLD_NOW);
+00092
+00093 <font class="keywordflow">if</font> (handle == NULL)
+00094 {
+00095 <a class="code" href="debug_h.html#a2">nlwarning</a> (<font class="stringliteral">"when loading dynamic library '%s': %s"</font>, NL3D_DLL_NAME, dlerror());
+00096 <font class="keywordflow">throw</font> EDruOpenglDriverNotFound();
+00097 }
+00098
+00099 <font class="comment">/* Not ANSI. Might produce a warning */</font>
+00100 createDriver = (IDRV_CREATE_PROC) dlsym (handle, IDRV_CREATE_PROC_NAME);
+00101 <font class="keywordflow">if</font> (createDriver == NULL)
+00102 {
+00103 <a class="code" href="debug_h.html#a2">nlwarning</a> (<font class="stringliteral">"when getting function in dynamic library '%s': %s"</font>, NL3D_DLL_NAME, dlerror());
+00104 <font class="keywordflow">throw</font> EDruOpenglDriverCorrupted();
+00105 }
+00106
+00107 versionDriver = (IDRV_VERSION_PROC) dlsym (handle, IDRV_VERSION_PROC_NAME);
+00108 <font class="keywordflow">if</font> (versionDriver != NULL)
+00109 {
+00110 <font class="keywordflow">if</font> (versionDriver()&lt;IDriver::InterfaceVersion)
+00111 <font class="keywordflow">throw</font> EDruOpenglDriverOldVersion();
+00112 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (versionDriver()&gt;IDriver::InterfaceVersion)
+00113 <font class="keywordflow">throw</font> EDruOpenglDriverUnknownVersion();
+00114 }
+00115
+00116 <font class="preprocessor">#else // NL_OS_LINUX
+</font>00117 <font class="preprocessor"></font><font class="preprocessor">#error "Dynamic DLL loading not implemented!"
+</font>00118 <font class="preprocessor"></font><font class="preprocessor">#endif // NL_OS_LINUX
+</font>00119 <font class="preprocessor"></font>
+00120 IDriver *ret= createDriver();
+00121 <font class="keywordflow">if</font> (ret == NULL)
+00122 {
+00123 <font class="keywordflow">throw</font> EDruOpenglDriverCantCreateDriver();
+00124 }
+00125 <font class="keywordflow">return</font> ret;
+00126 }
+00127
+00128
+00129 <font class="comment">// ***************************************************************************</font>
+<a name="l00130"></a><a class="code" href="class_NL3D__CDRU.html#d1">00130</a> <font class="keywordtype">void</font> CDRU::drawBitmap (<font class="keywordtype">float</font> x, <font class="keywordtype">float</font> y, <font class="keywordtype">float</font> width, <font class="keywordtype">float</font> height, ITexture&amp; texture, IDriver&amp; driver, CViewport viewport, <font class="keywordtype">bool</font> blend)<font class="keyword">
+</font>00131 <font class="keyword"></font>{
+00132 CMatrix mtx;
+00133 mtx.identity();
+00134 driver.setupViewport (viewport);
+00135 driver.setupViewMatrix (mtx);
+00136 driver.setupModelMatrix (mtx);
+00137 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00138
+00139 <font class="keyword">static</font> CMaterial mat;
+00140 mat.initUnlit ();
+00141 mat.setTexture (0, &amp;texture);
+00142 mat.setBlend(blend);
+00143
+00144 <font class="keyword">static</font> CVertexBuffer vb;
+00145 vb.setVertexFormat (IDRV_VF_XYZ|IDRV_VF_UV[0]);
+00146 vb.setNumVertices (4);
+00147 vb.setVertexCoord (0, CVector (x, 0, y));
+00148 vb.setVertexCoord (1, CVector (x+width, 0, y));
+00149 vb.setVertexCoord (2, CVector (x+width, 0, y+height));
+00150 vb.setVertexCoord (3, CVector (x, 0, y+height));
+00151 vb.setTexCoord (0, 0, 0.f, 1.f);
+00152 vb.setTexCoord (1, 0, 1.f, 1.f);
+00153 vb.setTexCoord (2, 0, 1.f, 0.f);
+00154 vb.setTexCoord (3, 0, 0.f, 0.f);
+00155 driver.activeVertexBuffer(vb);
+00156
+00157 CPrimitiveBlock pb;
+00158 pb.setNumQuad (1);
+00159 pb.setQuad (0, 0, 1, 2, 3);
+00160
+00161 driver.render(pb, mat);
+00162 }
+00163
+00164
+00165 <font class="comment">// ***************************************************************************</font>
+<a name="l00166"></a><a class="code" href="class_NL3D__CDRU.html#d2">00166</a> <font class="keywordtype">void</font> CDRU::drawLine (<font class="keywordtype">float</font> x0, <font class="keywordtype">float</font> y0, <font class="keywordtype">float</font> x1, <font class="keywordtype">float</font> y1, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00167 <font class="keyword"></font>{
+00168 CMatrix mtx;
+00169 mtx.identity();
+00170 driver.setupViewport (viewport);
+00171 driver.setupViewMatrix (mtx);
+00172 driver.setupModelMatrix (mtx);
+00173 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00174
+00175 <font class="keyword">static</font> CMaterial mat;
+00176 mat.initUnlit ();
+00177 mat.setSrcBlend(CMaterial::srcalpha);
+00178 mat.setDstBlend(CMaterial::invsrcalpha);
+00179 mat.setBlend(<font class="keyword">true</font>);
+00180 mat.setColor(col);
+00181
+00182 <font class="keyword">static</font> CVertexBuffer vb;
+00183 vb.setVertexFormat (IDRV_VF_XYZ);
+00184 vb.setNumVertices (2);
+00185 vb.setVertexCoord (0, CVector (x0, 0, y0));
+00186 vb.setVertexCoord (1, CVector (x1, 0, y1));
+00187 driver.activeVertexBuffer(vb);
+00188
+00189 CPrimitiveBlock pb;
+00190 pb.setNumLine (1);
+00191 pb.setLine (0, 0, 1);
+00192
+00193 driver.render(pb, mat);
+00194 }
+00195
+00196
+00197 <font class="comment">// ***************************************************************************</font>
+<a name="l00198"></a><a class="code" href="class_NL3D__CDRU.html#d3">00198</a> <font class="keywordtype">void</font> CDRU::drawTriangle (<font class="keywordtype">float</font> x0, <font class="keywordtype">float</font> y0, <font class="keywordtype">float</font> x1, <font class="keywordtype">float</font> y1, <font class="keywordtype">float</font> x2, <font class="keywordtype">float</font> y2, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00199 <font class="keyword"></font>{
+00200 CMatrix mtx;
+00201 mtx.identity();
+00202 driver.setupViewport (viewport);
+00203 driver.setupViewMatrix (mtx);
+00204 driver.setupModelMatrix (mtx);
+00205 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00206
+00207 <font class="keyword">static</font> CMaterial mat;
+00208 mat.initUnlit();
+00209 mat.setSrcBlend(CMaterial::srcalpha);
+00210 mat.setDstBlend(CMaterial::invsrcalpha);
+00211 mat.setBlend(<font class="keyword">true</font>);
+00212 mat.setColor(col);
+00213
+00214 <font class="keyword">static</font> CVertexBuffer vb;
+00215 vb.setVertexFormat (IDRV_VF_XYZ);
+00216 vb.setNumVertices (3);
+00217 vb.setVertexCoord (0, CVector (x0, 0, y0));
+00218 vb.setVertexCoord (1, CVector (x1, 0, y1));
+00219 vb.setVertexCoord (2, CVector (x2, 0, y2));
+00220 driver.activeVertexBuffer(vb);
+00221
+00222 CPrimitiveBlock pb;
+00223 pb.setNumTri (1);
+00224 pb.setTri (0, 0, 1, 2);
+00225
+00226 driver.render(pb, mat);
+00227 }
+00228
+00229
+00230
+00231 <font class="comment">// ***************************************************************************</font>
+<a name="l00232"></a><a class="code" href="class_NL3D__CDRU.html#d4">00232</a> <font class="keywordtype">void</font> CDRU::drawQuad (<font class="keywordtype">float</font> x0, <font class="keywordtype">float</font> y0, <font class="keywordtype">float</font> x1, <font class="keywordtype">float</font> y1, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00233 <font class="keyword"></font>{
+00234 CMatrix mtx;
+00235 mtx.identity();
+00236 driver.setupViewport (viewport);
+00237 driver.setupViewMatrix (mtx);
+00238 driver.setupModelMatrix (mtx);
+00239 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00240
+00241 <font class="keyword">static</font> CMaterial mat;
+00242 mat.initUnlit();
+00243 mat.setSrcBlend(CMaterial::srcalpha);
+00244 mat.setDstBlend(CMaterial::invsrcalpha);
+00245 mat.setBlend(<font class="keyword">true</font>);
+00246 mat.setColor(col);
+00247
+00248 <font class="keyword">static</font> CVertexBuffer vb;
+00249 vb.setVertexFormat (IDRV_VF_XYZ);
+00250 vb.setNumVertices (4);
+00251 vb.setVertexCoord (0, CVector (x0, 0, y0));
+00252 vb.setVertexCoord (1, CVector (x1, 0, y0));
+00253 vb.setVertexCoord (2, CVector (x1, 0, y1));
+00254 vb.setVertexCoord (3, CVector (x0, 0, y1));
+00255
+00256 driver.activeVertexBuffer(vb);
+00257
+00258 CPrimitiveBlock pb;
+00259 pb.setNumQuad (1);
+00260 pb.setQuad (0, 0, 1, 2, 3);
+00261
+00262 driver.render(pb, mat);
+00263 }
+00264
+00265
+00266 <font class="comment">// ***************************************************************************</font>
+<a name="l00267"></a><a class="code" href="class_NL3D__CDRU.html#d6">00267</a> <font class="keywordtype">void</font> CDRU::drawQuad (<font class="keywordtype">float</font> xcenter, <font class="keywordtype">float</font> ycenter, <font class="keywordtype">float</font> radius, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00268 <font class="keyword"></font>{
+00269 CMatrix mtx;
+00270 mtx.identity();
+00271 driver.setupViewport (viewport);
+00272 driver.setupViewMatrix (mtx);
+00273 driver.setupModelMatrix (mtx);
+00274 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00275
+00276 <font class="keyword">static</font> CMaterial mat;
+00277 mat.initUnlit();
+00278 mat.setSrcBlend(CMaterial::srcalpha);
+00279 mat.setDstBlend(CMaterial::invsrcalpha);
+00280 mat.setBlend(<font class="keyword">true</font>);
+00281 mat.setColor(col);
+00282
+00283 <font class="keyword">static</font> CVertexBuffer vb;
+00284 vb.setVertexFormat (IDRV_VF_XYZ);
+00285 vb.setNumVertices (4);
+00286 vb.setVertexCoord (0, CVector (xcenter-radius, 0, ycenter-radius));
+00287 vb.setVertexCoord (1, CVector (xcenter+radius, 0, ycenter-radius));
+00288 vb.setVertexCoord (2, CVector (xcenter+radius, 0, ycenter+radius));
+00289 vb.setVertexCoord (3, CVector (xcenter-radius, 0, ycenter+radius));
+00290
+00291 driver.activeVertexBuffer(vb);
+00292
+00293 CPrimitiveBlock pb;
+00294 pb.setNumQuad (1);
+00295 pb.setQuad (0, 0, 1, 2, 3);
+00296
+00297 driver.render(pb, mat);
+00298 }
+00299
+00300
+00301 <font class="comment">// ***************************************************************************</font>
+<a name="l00302"></a><a class="code" href="class_NL3D__CDRU.html#d7">00302</a> <font class="keywordtype">void</font> CDRU::drawWiredQuad (<font class="keywordtype">float</font> x0, <font class="keywordtype">float</font> y0, <font class="keywordtype">float</font> x1, <font class="keywordtype">float</font> y1, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00303 <font class="keyword"></font>{
+00304 <font class="comment">// v-left</font>
+00305 CDRU::drawLine(x0,y0,x0,y1 ,driver,col,viewport);
+00306 <font class="comment">// v-right</font>
+00307 CDRU::drawLine(x1,y0,x1,y1 ,driver,col,viewport);
+00308 <font class="comment">// h-up</font>
+00309 CDRU::drawLine(x0,y1,x1,y1,driver,col,viewport);
+00310 <font class="comment">// h-bottom</font>
+00311 CDRU::drawLine(x0,y0,x1,y0,driver,col,viewport);
+00312 }
+00313
+00314
+00315 <font class="comment">// ***************************************************************************</font>
+<a name="l00316"></a><a class="code" href="class_NL3D__CDRU.html#d8">00316</a> <font class="keywordtype">void</font> CDRU::drawWiredQuad (<font class="keywordtype">float</font> xcenter, <font class="keywordtype">float</font> ycenter, <font class="keywordtype">float</font> radius, IDriver&amp; driver, CRGBA col, CViewport viewport)<font class="keyword">
+</font>00317 <font class="keyword"></font>{
+00318 <font class="comment">// v-left</font>
+00319 CDRU::drawLine(xcenter-radius,ycenter-radius,xcenter-radius,ycenter+radius,driver,col,viewport);
+00320 <font class="comment">// v-right</font>
+00321 CDRU::drawLine(xcenter+radius,ycenter-radius,xcenter+radius,ycenter+radius,driver,col,viewport);
+00322 <font class="comment">// h-up</font>
+00323 CDRU::drawLine(xcenter-radius,ycenter+radius,xcenter+radius,ycenter+radius,driver,col,viewport);
+00324 <font class="comment">// h-bottom</font>
+00325 CDRU::drawLine(xcenter-radius,ycenter-radius,xcenter+radius,ycenter-radius,driver,col,viewport);
+00326 }
+00327
+00328
+00329 <font class="comment">// ***************************************************************************</font>
+<a name="l00330"></a><a class="code" href="class_NL3D__CDRU.html#d9">00330</a> <font class="keywordtype">void</font> CDRU::drawTrianglesUnlit(<font class="keyword">const</font> <a class="code" href="class_NLMISC__CTriangleUV.html">NLMISC::CTriangleUV</a> *trilist, sint ntris, CMaterial &amp;mat, IDriver&amp; driver)<font class="keyword">
+</font>00331 <font class="keyword"></font>{
+00332 <font class="keyword">static</font> CVertexBuffer vb;
+00333 vb.setVertexFormat (IDRV_VF_XYZ | IDRV_VF_UV[0]);
+00334 vb.setNumVertices (ntris*3);
+00335
+00336 <font class="keyword">static</font> CPrimitiveBlock pb;
+00337 pb.setNumTri(ntris);
+00338
+00339 <font class="keywordflow">for</font>(sint i=0;i&lt;ntris;i++)
+00340 {
+00341 vb.setVertexCoord (i*3+0, trilist[i].V0);
+00342 vb.setVertexCoord (i*3+1, trilist[i].V1);
+00343 vb.setVertexCoord (i*3+2, trilist[i].V2);
+00344 vb.setTexCoord (i*3+0, 0, trilist[i].Uv0);
+00345 vb.setTexCoord (i*3+1, 0, trilist[i].Uv1);
+00346 vb.setTexCoord (i*3+2, 0, trilist[i].Uv2);
+00347 pb.setTri(i, i*3+0, i*3+1, i*3+2);
+00348 }
+00349
+00350 driver.activeVertexBuffer(vb);
+00351 driver.render(pb, mat);
+00352 }
+00353
+00354
+00355 <font class="comment">// ***************************************************************************</font>
+<a name="l00356"></a><a class="code" href="class_NL3D__CDRU.html#d10">00356</a> <font class="keywordtype">void</font> CDRU::drawTrianglesUnlit(<font class="keyword">const</font> std::vector&lt;NLMISC::CTriangleUV&gt; &amp;trilist, CMaterial &amp;mat, IDriver&amp; driver)<font class="keyword">
+</font>00357 <font class="keyword"></font>{
+00358 <font class="keywordflow">if</font>(trilist.<a class="code" href="lexlang_cpp.html#a56">size</a>()==0)
+00359 <font class="keywordflow">return</font>;
+00360
+00361 CDRU::drawTrianglesUnlit( &amp;(*trilist.begin()), trilist.<a class="code" href="lexlang_cpp.html#a56">size</a>(), mat, driver);
+00362 }
+00363
+00364
+00365 <font class="comment">// ***************************************************************************</font>
+<a name="l00366"></a><a class="code" href="class_NL3D__CDRU.html#d11">00366</a> <font class="keywordtype">void</font> CDRU::drawLinesUnlit(<font class="keyword">const</font> <a class="code" href="class_NLMISC__CLine.html">NLMISC::CLine</a> *linelist, sint nlines, CMaterial &amp;mat, IDriver&amp; driver)<font class="keyword">
+</font>00367 <font class="keyword"></font>{
+00368 <font class="keyword">static</font> CVertexBuffer vb;
+00369 vb.setVertexFormat (IDRV_VF_XYZ);
+00370 vb.setNumVertices (nlines*2);
+00371
+00372 <font class="keyword">static</font> CPrimitiveBlock pb;
+00373 pb.setNumLine(nlines);
+00374
+00375 <font class="keywordflow">for</font>(sint i=0;i&lt;nlines;i++)
+00376 {
+00377 vb.setVertexCoord (i*2+0, linelist[i].V0);
+00378 vb.setVertexCoord (i*2+1, linelist[i].V1);
+00379 pb.setLine(i, i*2+0, i*2+1);
+00380 }
+00381
+00382 driver.activeVertexBuffer(vb);
+00383 driver.render(pb, mat);
+00384 }
+00385 <font class="comment">// ***************************************************************************</font>
+<a name="l00386"></a><a class="code" href="class_NL3D__CDRU.html#d12">00386</a> <font class="keywordtype">void</font> CDRU::drawLinesUnlit(<font class="keyword">const</font> std::vector&lt;NLMISC::CLine&gt; &amp;linelist, CMaterial &amp;mat, IDriver&amp; driver)<font class="keyword">
+</font>00387 <font class="keyword"></font>{
+00388 <font class="keywordflow">if</font>(linelist.<a class="code" href="lexlang_cpp.html#a56">size</a>()==0)
+00389 <font class="keywordflow">return</font>;
+00390 CDRU::drawLinesUnlit( &amp;(*linelist.begin()), linelist.<a class="code" href="lexlang_cpp.html#a56">size</a>(), mat, driver);
+00391 }
+00392 <font class="comment">// ***************************************************************************</font>
+<a name="l00393"></a><a class="code" href="class_NL3D__CDRU.html#d13">00393</a> <font class="keywordtype">void</font> CDRU::drawLine(<font class="keyword">const</font> CVector &amp;a, <font class="keyword">const</font> CVector &amp;b, CRGBA color, IDriver&amp; driver)<font class="keyword">
+</font>00394 <font class="keyword"></font>{
+00395 <font class="keyword">static</font> <a class="code" href="class_NLMISC__CLine.html">NLMISC::CLine</a> line;
+00396 <font class="keyword">static</font> CMaterial mat;
+00397 <font class="keyword">static</font> <font class="keywordtype">bool</font> inited= <font class="keyword">false</font>;
+00398
+00399 <font class="comment">// Setup material.</font>
+00400 <font class="keywordflow">if</font>(!inited)
+00401 {
+00402 inited= <font class="keyword">true</font>;
+00403 mat.initUnlit();
+00404 }
+00405 mat.setColor(color);
+00406
+00407
+00408 line.V0= a;
+00409 line.V1= b;
+00410 CDRU::drawLinesUnlit(&amp;line, 1, mat, driver);
+00411 }
+00412 <font class="comment">// ***************************************************************************</font>
+<a name="l00413"></a><a class="code" href="class_NL3D__CDRU.html#d5">00413</a> <font class="keywordtype">void</font> CDRU::drawQuad (<font class="keywordtype">float</font> x0, <font class="keywordtype">float</font> y0, <font class="keywordtype">float</font> x1, <font class="keywordtype">float</font> y1, CRGBA col0, CRGBA col1, CRGBA col2, CRGBA col3, IDriver&amp; driver, CViewport viewport)<font class="keyword">
+</font>00414 <font class="keyword"></font>{
+00415 CMatrix mtx;
+00416 mtx.identity();
+00417 driver.setupViewport (viewport);
+00418 driver.setupViewMatrix (mtx);
+00419 driver.setupModelMatrix (mtx);
+00420 driver.setFrustum (0.f, 1.f, 0.f, 1.f, -1.f, 1.f, <font class="keyword">false</font>);
+00421
+00422 <font class="keyword">static</font> CMaterial mat;
+00423 mat.initUnlit();
+00424 mat.setSrcBlend(CMaterial::srcalpha);
+00425 mat.setDstBlend(CMaterial::invsrcalpha);
+00426 mat.setBlend(<font class="keyword">true</font>);
+00427
+00428 <font class="keyword">static</font> CVertexBuffer vb;
+00429 vb.setVertexFormat (IDRV_VF_XYZ|IDRV_VF_COLOR);
+00430 vb.setNumVertices (4);
+00431 vb.setVertexCoord (0, CVector (x0, 0, y0));
+00432 vb.setColor (0, col0);
+00433 vb.setVertexCoord (1, CVector (x1, 0, y0));
+00434 vb.setColor (1, col1);
+00435 vb.setVertexCoord (2, CVector (x1, 0, y1));
+00436 vb.setColor (2, col2);
+00437 vb.setVertexCoord (3, CVector (x0, 0, y1));
+00438 vb.setColor (3, col3);
+00439
+00440 driver.activeVertexBuffer(vb);
+00441
+00442 CPrimitiveBlock pb;
+00443 pb.setNumQuad (1);
+00444 pb.setQuad (0, 0, 1, 2, 3);
+00445
+00446 driver.render(pb, mat);
+00447 }
+00448
+00449
+00450
+00451 } <font class="comment">// NL3D</font>
+00452
+</div></pre>
+
+<!-- footer -->
+<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
+</TD>
+<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>