<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Mercator: Shader.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Mercator</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">Shader.h</div> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This file may be redistributed and modified only under the terms of</span> <a name="l00002"></a>00002 <span class="comment">// the GNU General Public License (See COPYING for details).</span> <a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2003 Alistair Riddoch</span> <a name="l00004"></a>00004 <a name="l00005"></a>00005 <span class="preprocessor">#ifndef MERCATOR_SHADER_H</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define MERCATOR_SHADER_H</span> <a name="l00007"></a>00007 <span class="preprocessor"></span> <a name="l00008"></a>00008 <span class="preprocessor">#include <string></span> <a name="l00009"></a>00009 <span class="preprocessor">#include <map></span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="keyword">namespace </span>Mercator { <a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="keyword">class </span>Surface; <a name="l00014"></a>00014 <span class="keyword">class </span>Segment; <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="comment">// FIXME - PLACEHOLDER</span> <a name="l00017"></a>00017 <span class="comment">// This class itereates over the buffer in a segment using the data it contains</span> <a name="l00018"></a>00018 <span class="comment">// to populate a RGBA colour buffer based on the terrain height data. ie it is</span> <a name="l00019"></a>00019 <span class="comment">// used to define the texture blending for a given surface</span> <a name="l00020"></a>00020 <a name="l00029"></a><a class="code" href="classMercator_1_1Shader.html">00029</a> <span class="keyword">class </span><a class="code" href="classMercator_1_1Shader.html" title="Base class for Shader objects which create surface data for use when rendering terrain.">Shader</a> { <a name="l00030"></a>00030 <span class="keyword">private</span>: <a name="l00032"></a><a class="code" href="classMercator_1_1Shader.html#afe9bf17286deabb099732d4287a3fbea">00032</a> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Shader.html#afe9bf17286deabb099732d4287a3fbea" title="Flag to control whether this Shader produces color data.">m_color</a>; <a name="l00034"></a><a class="code" href="classMercator_1_1Shader.html#a2b5350bc03bf41a873ca938221a23198">00034</a> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Shader.html#a2b5350bc03bf41a873ca938221a23198" title="Flag to control whether this Shader produces alpha data.">m_alpha</a>; <a name="l00035"></a>00035 <span class="keyword">protected</span>: <a name="l00036"></a>00036 <span class="keyword">explicit</span> <a class="code" href="classMercator_1_1Shader.html#a4918b9de55212b4221683e2b985491cd" title="Protected constructor for classes which inherit from this one.">Shader</a>(<span class="keywordtype">bool</span> color = <span class="keyword">false</span>, <span class="keywordtype">bool</span> alpha = <span class="keyword">true</span>); <a name="l00037"></a>00037 <span class="keyword">public</span>: <a name="l00038"></a>00038 <span class="keyword">virtual</span> <a class="code" href="classMercator_1_1Shader.html#a5bcc651d08707e2124536036e82d8ce5" title="Destructor does nothing interesting.">~Shader</a>(); <a name="l00039"></a>00039 <a name="l00041"></a><a class="code" href="classMercator_1_1Shader.html#a775166b2e13eff4473f4d6cbbc2bc242">00041</a> <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Shader.html#a775166b2e13eff4473f4d6cbbc2bc242" title="Accessor for color flag.">getColor</a>()<span class="keyword"> const </span>{ <a name="l00042"></a>00042 <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Shader.html#afe9bf17286deabb099732d4287a3fbea" title="Flag to control whether this Shader produces color data.">m_color</a>; <a name="l00043"></a>00043 } <a name="l00044"></a>00044 <a name="l00046"></a><a class="code" href="classMercator_1_1Shader.html#ad95856ffe918db07358abddd81feb4bc">00046</a> <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Shader.html#ad95856ffe918db07358abddd81feb4bc" title="Accessor for alpha flag.">getAlpha</a>()<span class="keyword"> const </span>{ <a name="l00047"></a>00047 <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Shader.html#a2b5350bc03bf41a873ca938221a23198" title="Flag to control whether this Shader produces alpha data.">m_alpha</a>; <a name="l00048"></a>00048 } <a name="l00049"></a>00049 <a name="l00050"></a>00050 <a class="code" href="classMercator_1_1Surface.html" title="Data store for terrain surface data.">Surface</a> * <a class="code" href="classMercator_1_1Shader.html#a0dea70d66bcc68dd955548c24d0acc44" title="Create a new Surface which matches the requirements of this shader.">newSurface</a>(<span class="keyword">const</span> <a class="code" href="classMercator_1_1Segment.html" title="Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...">Segment</a> &) <span class="keyword">const</span>; <a name="l00051"></a>00051 <a name="l00057"></a>00057 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Shader.html#a6a69ca4a474c18f1038cc9a75a419855" title="Check whether this Shader has any effect on the given Segment.">checkIntersect</a>(<span class="keyword">const</span> <a class="code" href="classMercator_1_1Segment.html" title="Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...">Segment</a> &) <span class="keyword">const</span> = 0; <a name="l00058"></a>00058 <a name="l00060"></a>00060 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classMercator_1_1Shader.html#a3f8a84ec28757623c24488ae79c8947d" title="Populate a Surface with data.">shade</a>(<a class="code" href="classMercator_1_1Surface.html" title="Data store for terrain surface data.">Surface</a> &) <span class="keyword">const</span> = 0; <a name="l00061"></a>00061 <a name="l00063"></a><a class="code" href="classMercator_1_1Shader.html#a1e99426c6c90afbb8c54114bb692b861">00063</a> <span class="keyword">typedef</span> std::map<std::string, float> <a class="code" href="classMercator_1_1Shader.html#a1e99426c6c90afbb8c54114bb692b861" title="STL map of parameter values for a shader constructor.">Parameters</a>; <a name="l00064"></a>00064 }; <a name="l00065"></a>00065 <a name="l00066"></a>00066 } <span class="comment">// namespace Mercator</span> <a name="l00067"></a>00067 <a name="l00068"></a>00068 <span class="preprocessor">#endif // MERCATOR_SHADER_H</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated for Mercator by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>