aboutsummaryrefslogtreecommitdiffstats
path: root/dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html
diff options
context:
space:
mode:
authorunknown <paulx161@umn.edu>2021-02-03 14:22:28 -0600
committerunknown <paulx161@umn.edu>2021-02-03 14:22:28 -0600
commit9b83919815f6a6ce5d73da1c28483970d0ca5589 (patch)
tree4558864445dccc1605e5315e0bb11c46d2018da1 /dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html
parentAdded worksheet and support code for assignment 2 (diff)
downloadcsci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.gz
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.bz2
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.lz
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.xz
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.zst
csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.zip
added dev/MinGfx/
Diffstat (limited to 'dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html')
-rw-r--r--dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html465
1 files changed, 465 insertions, 0 deletions
diff --git a/dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html b/dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html
new file mode 100644
index 0000000..3787d3d
--- /dev/null
+++ b/dev/MinGfx/docs/html/classmingfx_1_1_default_shader.html
@@ -0,0 +1,465 @@
+<!-- HTML header for doxygen 1.8.9.1-->
+<!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"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.9.1"/>
+<title>MinGfx Toolkit: mingfx::DefaultShader Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="search/search.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="search/searchdata.js"></script>
+<script type="text/javascript" src="search/search.js"></script>
+<script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ extensions: ["tex2jax.js"],
+ jax: ["input/TeX","output/HTML-CSS"],
+});
+</script>
+<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td style="padding-left: 0.5em;">
+ <div id="projectname">MinGfx Toolkit
+ &#160;<span id="projectnumber">1.0</span>
+ </div>
+ <div id="projectbrief">A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.9.1 -->
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
+var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
+/* @license-end */
+</script>
+<script type="text/javascript" src="menudata.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
+$(function() {
+ initMenu('',true,false,'search.php','Search');
+ $(document).ready(function() { init_search(); });
+});
+/* @license-end */</script>
+<div id="main-nav"></div>
+<!-- window showing the filter options -->
+<div id="MSearchSelectWindow"
+ onmouseover="return searchBox.OnSearchSelectShow()"
+ onmouseout="return searchBox.OnSearchSelectHide()"
+ onkeydown="return searchBox.OnSearchSelectKey(event)">
+</div>
+
+<!-- iframe showing the search results (closed by default) -->
+<div id="MSearchResultsWindow">
+<iframe src="javascript:void(0)" frameborder="0"
+ name="MSearchResults" id="MSearchResults">
+</iframe>
+</div>
+
+<div id="nav-path" class="navpath">
+ <ul>
+<li class="navelem"><a class="el" href="namespacemingfx.html">mingfx</a></li><li class="navelem"><a class="el" href="classmingfx_1_1_default_shader.html">DefaultShader</a></li> </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+ <div class="summary">
+<a href="#nested-classes">Classes</a> &#124;
+<a href="#pub-methods">Public Member Functions</a> &#124;
+<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
+<a href="classmingfx_1_1_default_shader-members.html">List of all members</a> </div>
+ <div class="headertitle">
+<div class="title">mingfx::DefaultShader Class Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>A simple GLSL shader for textured per-fragment Phong shading with multiple light sources. </p>
+<p>This can be used to draw 3D models stored in a <a class="el" href="classmingfx_1_1_mesh.html" title="A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.">mingfx::Mesh</a> data structure or you can use it with your own geometry data structures. Lighting properties are stored within the class itself since these are considered part of the shading model. Material properties are considered properties of the meshes or other materials you wish to draw so these are stored outside of the class and passed into the <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a> or <a class="el" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0" title="Only needed if you do not want to draw a Mesh. This does all of the same setup for drawing that the D...">UseProgram()</a> functions.</p>
+<p>An example of using <a class="el" href="classmingfx_1_1_default_shader.html" title="A simple GLSL shader for textured per-fragment Phong shading with multiple light sources.">DefaultShader</a> to render a mesh: </p><div class="fragment"><div class="line"><a class="code" href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">DefaultShader</a> phong_shader;</div>
+<div class="line">Mesh teapot;</div>
+<div class="line">DefaultShader::MaterialProperties teapot_material;</div>
+<div class="line"> </div>
+<div class="line"><span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">Init</a>() {</div>
+<div class="line"> <span class="comment">// initialize the shader</span></div>
+<div class="line"> DefaultShader::LightProperties red_light;</div>
+<div class="line"> red_light.position = Point3(-10, 5, 5);</div>
+<div class="line"> red_light.diffuseIntensity = Color(1,0,0);</div>
+<div class="line"> phong_shader.AddLight(red_light);</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// initialize the mesh</span></div>
+<div class="line"> teapot.LoadFromOBJ(<a class="code" href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">Platform::FindMinGfxDataFile</a>(<span class="stringliteral">&quot;teapot.obj&quot;</span>));</div>
+<div class="line">}</div>
+<div class="line"> </div>
+<div class="line"><span class="keywordtype">void</span> DrawUsingOpenGL() {</div>
+<div class="line"> Matrix4 M;</div>
+<div class="line"> Matrix4 V = <a class="code" href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">Matrix4::LookAt</a>(Point3(0,0,3), Point3(0,0,0), Vector3(0,1,0));</div>
+<div class="line"> Matrix4 P = <a class="code" href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">Matrix4::Perspective</a>(60.0, aspect_ratio(), 0.1, 10.0);</div>
+<div class="line"> phong_shader.Draw(M, V, P, teapot, teapot_material);</div>
+<div class="line">}</div>
+<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a5cb9f0a1709452268858ec338448a4c3"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">mingfx::DefaultShader::Init</a></div><div class="ttdeci">void Init()</div><div class="ttdoc">This loads vertex and fragment shaders from files, compiles them, and links them. So,...</div></div>
+<div class="ttc" id="aclassmingfx_1_1_default_shader_html_ac030575fd76a6076262bdd09bbb93428"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">mingfx::DefaultShader::DefaultShader</a></div><div class="ttdeci">DefaultShader(bool add_default_light=true)</div><div class="ttdoc">The constructor defaults to adding a single white light to the scene at (10,10,10)....</div></div>
+<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a0e34aee86758a0397074590b87712c5e"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">mingfx::Matrix4::Perspective</a></div><div class="ttdeci">static Matrix4 Perspective(float fov_y_in_degrees, float aspect_ratio, float near_plane_dist, float far_plane_dist)</div><div class="ttdoc">Returns a perspective projection matrix equivalent to the one gluPerspective creates.</div></div>
+<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a4543695a6dfc996d0312b70c2eaa00de"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">mingfx::Matrix4::LookAt</a></div><div class="ttdeci">static Matrix4 LookAt(Point3 eye, Point3 target, Vector3 up)</div><div class="ttdoc">Returns a view matrix that centers the camera at the 'eye' position and orients it to look at the des...</div></div>
+<div class="ttc" id="aclassmingfx_1_1_platform_html_a2c36ca57a246efa218a49a942c8c4a3b"><div class="ttname"><a href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">mingfx::Platform::FindMinGfxDataFile</a></div><div class="ttdeci">static std::string FindMinGfxDataFile(const std::string &amp;basename)</div><div class="ttdoc">Searches for a data file that ships with MinGfx.</div></div>
+</div><!-- fragment -->
+<p class="definition">Definition at line <a class="el" href="default__shader_8h_source.html#l00062">62</a> of file <a class="el" href="default__shader_8h_source.html">default_shader.h</a>.</p>
+</div>
+<p><code>#include &lt;<a class="el" href="default__shader_8h_source.html">default_shader.h</a>&gt;</code></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Classes</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Small data structure to hold per-light properties. <a href="classmingfx_1_1_default_shader_1_1_light_properties.html#details">More...</a><br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Small data structure to hold properties of the material to be lit. <a href="classmingfx_1_1_default_shader_1_1_material_properties.html#details">More...</a><br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
+Public Member Functions</h2></td></tr>
+<tr class="memitem:ac030575fd76a6076262bdd09bbb93428"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">DefaultShader</a> (bool add_default_light=true)</td></tr>
+<tr class="memdesc:ac030575fd76a6076262bdd09bbb93428"><td class="mdescLeft">&#160;</td><td class="mdescRight">The constructor defaults to adding a single white light to the scene at (10,10,10). Change this by passing it 'false'. The constructor does not load and compile the shader right away. This is done inside <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>. <a href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">More...</a><br /></td></tr>
+<tr class="separator:ac030575fd76a6076262bdd09bbb93428"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a0fe7d605d039ecdbf17837bc5bbe0aba"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a0fe7d605d039ecdbf17837bc5bbe0aba">~DefaultShader</a> ()</td></tr>
+<tr class="separator:a0fe7d605d039ecdbf17837bc5bbe0aba"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af54a8e489d9fb34cfceb1c07562c6e2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#af54a8e489d9fb34cfceb1c07562c6e2c">AddLight</a> (<a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> <a class="el" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a>)</td></tr>
+<tr class="memdesc:af54a8e489d9fb34cfceb1c07562c6e2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiple lights are supported, this adds one to the end of the list. Up to MAX_LIGHTS can be added. <a href="classmingfx_1_1_default_shader.html#af54a8e489d9fb34cfceb1c07562c6e2c">More...</a><br /></td></tr>
+<tr class="separator:af54a8e489d9fb34cfceb1c07562c6e2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a41e74fb8af72a6b22c72b0916726b6d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a41e74fb8af72a6b22c72b0916726b6d6">SetLight</a> (int i, <a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> <a class="el" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a>)</td></tr>
+<tr class="memdesc:a41e74fb8af72a6b22c72b0916726b6d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the properties for a light that was already added. <a href="classmingfx_1_1_default_shader.html#a41e74fb8af72a6b22c72b0916726b6d6">More...</a><br /></td></tr>
+<tr class="separator:a41e74fb8af72a6b22c72b0916726b6d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5cb9f0a1709452268858ec338448a4c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">Init</a> ()</td></tr>
+<tr class="memdesc:a5cb9f0a1709452268858ec338448a4c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This loads vertex and fragment shaders from files, compiles them, and links them. So, it must be called from within an active OpenGL context, for example, from within GraphicsApp::Init() or <a class="el" href="classmingfx_1_1_graphics_app.html#a5a858fd10651f7617491f37b49dbf8ca" title="Override this to draw graphics using raw OpenGL 2D or 3D graphics calls.">GraphicsApp::DrawUsingOpenGL()</a>. If you call <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a> before calling <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>, then <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a> will be called as the first step within <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a>. So, if you do not mind a slowdown on the very first frame of your program, it is fine to skip calling <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>. <a href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">More...</a><br /></td></tr>
+<tr class="separator:a5cb9f0a1709452268858ec338448a4c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a652b3d00bb6ae2a806b1ca3e3d42242b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b">Draw</a> (const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;model, const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;view, const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;projection, <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> *mesh, const <a class="el" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;material)</td></tr>
+<tr class="memdesc:a652b3d00bb6ae2a806b1ca3e3d42242b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This starts the shader and sets its uniform variables based upon the current set of lights, the material properties passed in, and the model, view, and projection matrices. Then, it calls mesh-&gt;<a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a>. After drawing, it disables the shader. <a href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b">More...</a><br /></td></tr>
+<tr class="separator:a652b3d00bb6ae2a806b1ca3e3d42242b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a053599d8c7acd9920461aab8ce945ab0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0">UseProgram</a> (const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;model, const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;view, const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;projection, const <a class="el" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;material)</td></tr>
+<tr class="memdesc:a053599d8c7acd9920461aab8ce945ab0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Only needed if you do not want to draw a <a class="el" href="classmingfx_1_1_mesh.html" title="A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.">Mesh</a>. This does all of the same setup for drawing that the <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a> function does and then it returns so that you may draw your own geometry however you want. After doing your draw must call <a class="el" href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67" title="Only needed if you do not want to draw a Mesh. Call this after UseProgram() and after drawing your ge...">StopProgram()</a> to turn off the shader. <a href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0">More...</a><br /></td></tr>
+<tr class="separator:a053599d8c7acd9920461aab8ce945ab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2c188bc0fc5f7fc7405f04b036bd4d67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67">StopProgram</a> ()</td></tr>
+<tr class="memdesc:a2c188bc0fc5f7fc7405f04b036bd4d67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Only needed if you do not want to draw a <a class="el" href="classmingfx_1_1_mesh.html" title="A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.">Mesh</a>. Call this after <a class="el" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0" title="Only needed if you do not want to draw a Mesh. This does all of the same setup for drawing that the D...">UseProgram()</a> and after drawing your geometry to turn off the shader. <a href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67">More...</a><br /></td></tr>
+<tr class="separator:a2c188bc0fc5f7fc7405f04b036bd4d67"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac5b779672a983df8aa67c9cbe026e0c2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#ac5b779672a983df8aa67c9cbe026e0c2">num_lights</a> ()</td></tr>
+<tr class="separator:ac5b779672a983df8aa67c9cbe026e0c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa2ed33efad35aefbb400be45250cd316"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a> (int i)</td></tr>
+<tr class="separator:aa2ed33efad35aefbb400be45250cd316"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
+Static Public Attributes</h2></td></tr>
+<tr class="memitem:a21c1fd93273eaf643e7ac9b05ba0fb24"><td class="memItemLeft" align="right" valign="top">static const unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a> = 10</td></tr>
+<tr class="memdesc:a21c1fd93273eaf643e7ac9b05ba0fb24"><td class="mdescLeft">&#160;</td><td class="mdescRight">If changed, this needs to also be changed in the glsl shader code. <a href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">More...</a><br /></td></tr>
+<tr class="separator:a21c1fd93273eaf643e7ac9b05ba0fb24"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
+<a id="ac030575fd76a6076262bdd09bbb93428"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ac030575fd76a6076262bdd09bbb93428">&#9670;&nbsp;</a></span>DefaultShader()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">mingfx::DefaultShader::DefaultShader </td>
+ <td>(</td>
+ <td class="paramtype">bool&#160;</td>
+ <td class="paramname"><em>add_default_light</em> = <code>true</code></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>The constructor defaults to adding a single white light to the scene at (10,10,10). Change this by passing it 'false'. The constructor does not load and compile the shader right away. This is done inside <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>. </p>
+
+</div>
+</div>
+<a id="a0fe7d605d039ecdbf17837bc5bbe0aba"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a0fe7d605d039ecdbf17837bc5bbe0aba">&#9670;&nbsp;</a></span>~DefaultShader()</h2>
+
+<div class="memitem">
+<div class="memproto">
+<table class="mlabels">
+ <tr>
+ <td class="mlabels-left">
+ <table class="memname">
+ <tr>
+ <td class="memname">virtual mingfx::DefaultShader::~DefaultShader </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
+ </tr>
+</table>
+</div><div class="memdoc">
+
+</div>
+</div>
+<h2 class="groupheader">Member Function Documentation</h2>
+<a id="af54a8e489d9fb34cfceb1c07562c6e2c"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#af54a8e489d9fb34cfceb1c07562c6e2c">&#9670;&nbsp;</a></span>AddLight()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::AddLight </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a>&#160;</td>
+ <td class="paramname"><em>light</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiple lights are supported, this adds one to the end of the list. Up to MAX_LIGHTS can be added. </p>
+
+</div>
+</div>
+<a id="a652b3d00bb6ae2a806b1ca3e3d42242b"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a652b3d00bb6ae2a806b1ca3e3d42242b">&#9670;&nbsp;</a></span>Draw()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::Draw </td>
+ <td>(</td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>model</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>view</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>projection</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> *&#160;</td>
+ <td class="paramname"><em>mesh</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;&#160;</td>
+ <td class="paramname"><em>material</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This starts the shader and sets its uniform variables based upon the current set of lights, the material properties passed in, and the model, view, and projection matrices. Then, it calls mesh-&gt;<a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a>. After drawing, it disables the shader. </p>
+
+</div>
+</div>
+<a id="a5cb9f0a1709452268858ec338448a4c3"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a5cb9f0a1709452268858ec338448a4c3">&#9670;&nbsp;</a></span>Init()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::Init </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This loads vertex and fragment shaders from files, compiles them, and links them. So, it must be called from within an active OpenGL context, for example, from within GraphicsApp::Init() or <a class="el" href="classmingfx_1_1_graphics_app.html#a5a858fd10651f7617491f37b49dbf8ca" title="Override this to draw graphics using raw OpenGL 2D or 3D graphics calls.">GraphicsApp::DrawUsingOpenGL()</a>. If you call <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a> before calling <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>, then <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a> will be called as the first step within <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a>. So, if you do not mind a slowdown on the very first frame of your program, it is fine to skip calling <a class="el" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3" title="This loads vertex and fragment shaders from files, compiles them, and links them. So,...">Init()</a>. </p>
+
+</div>
+</div>
+<a id="aa2ed33efad35aefbb400be45250cd316"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#aa2ed33efad35aefbb400be45250cd316">&#9670;&nbsp;</a></span>light()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> mingfx::DefaultShader::light </td>
+ <td>(</td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>i</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+</div>
+</div>
+<a id="ac5b779672a983df8aa67c9cbe026e0c2"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ac5b779672a983df8aa67c9cbe026e0c2">&#9670;&nbsp;</a></span>num_lights()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int mingfx::DefaultShader::num_lights </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+</div>
+</div>
+<a id="a41e74fb8af72a6b22c72b0916726b6d6"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a41e74fb8af72a6b22c72b0916726b6d6">&#9670;&nbsp;</a></span>SetLight()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::SetLight </td>
+ <td>(</td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>i</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a>&#160;</td>
+ <td class="paramname"><em>light</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Changes the properties for a light that was already added. </p>
+
+</div>
+</div>
+<a id="a2c188bc0fc5f7fc7405f04b036bd4d67"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a2c188bc0fc5f7fc7405f04b036bd4d67">&#9670;&nbsp;</a></span>StopProgram()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::StopProgram </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Only needed if you do not want to draw a <a class="el" href="classmingfx_1_1_mesh.html" title="A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.">Mesh</a>. Call this after <a class="el" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0" title="Only needed if you do not want to draw a Mesh. This does all of the same setup for drawing that the D...">UseProgram()</a> and after drawing your geometry to turn off the shader. </p>
+
+</div>
+</div>
+<a id="a053599d8c7acd9920461aab8ce945ab0"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a053599d8c7acd9920461aab8ce945ab0">&#9670;&nbsp;</a></span>UseProgram()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::DefaultShader::UseProgram </td>
+ <td>(</td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>model</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>view</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;&#160;</td>
+ <td class="paramname"><em>projection</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;&#160;</td>
+ <td class="paramname"><em>material</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Only needed if you do not want to draw a <a class="el" href="classmingfx_1_1_mesh.html" title="A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.">Mesh</a>. This does all of the same setup for drawing that the <a class="el" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b" title="This starts the shader and sets its uniform variables based upon the current set of lights,...">Draw()</a> function does and then it returns so that you may draw your own geometry however you want. After doing your draw must call <a class="el" href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67" title="Only needed if you do not want to draw a Mesh. Call this after UseProgram() and after drawing your ge...">StopProgram()</a> to turn off the shader. </p>
+
+</div>
+</div>
+<h2 class="groupheader">Member Data Documentation</h2>
+<a id="a21c1fd93273eaf643e7ac9b05ba0fb24"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a21c1fd93273eaf643e7ac9b05ba0fb24">&#9670;&nbsp;</a></span>MAX_LIGHTS</h2>
+
+<div class="memitem">
+<div class="memproto">
+<table class="mlabels">
+ <tr>
+ <td class="mlabels-left">
+ <table class="memname">
+ <tr>
+ <td class="memname">const unsigned int mingfx::DefaultShader::MAX_LIGHTS = 10</td>
+ </tr>
+ </table>
+ </td>
+ <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span> </td>
+ </tr>
+</table>
+</div><div class="memdoc">
+
+<p>If changed, this needs to also be changed in the glsl shader code. </p>
+
+<p class="definition">Definition at line <a class="el" href="default__shader_8h_source.html#l00066">66</a> of file <a class="el" href="default__shader_8h_source.html">default_shader.h</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li>src/<a class="el" href="default__shader_8h_source.html">default_shader.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- HTML footer for doxygen 1.8.9.1-->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by &#160;<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.9.1
+</small></address>
+</body>
+</html>