summaryrefslogtreecommitdiffstats
path: root/dev/MinGfx/docs/html/default__shader_8h_source.html
blob: 38bc6930b395ff721f1d7641e745ab3b0b2be4ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!-- 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: src/default_shader.h Source File</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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">default_shader.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="default__shader_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> This file is part of the MinGfx Project.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> </span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> Copyright (c) 2017,2018 Regents of the University of Minnesota.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> All Rights Reserved.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> </span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> Original Author(s) of this File:</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">    Dan Keefe, 2018, University of Minnesota</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">    </span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> Author(s) of Significant Updates/Modifications to the File:</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">    ...</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#ifndef SRC_DEFAULT_SHADER_H_</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define SRC_DEFAULT_SHADER_H_</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="color_8h.html">color.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="point3_8h.html">point3.h</a>&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="shader__program_8h.html">shader_program.h</a>&quot;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="texture2d_8h.html">texture2d.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="vector3_8h.html">vector3.h</a>&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="matrix4_8h.html">matrix4.h</a>&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mesh_8h.html">mesh.h</a>&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacemingfx.html">mingfx</a> {</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html">   62</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmingfx_1_1_default_shader.html">DefaultShader</a> {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">   66</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a> = 10;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html">   70</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad4db9a1b0636db84f57f022c51ce7657">   72</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad4db9a1b0636db84f57f022c51ce7657">ambient_reflectance</a>;</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa7b75f95a45d7a1030c297192b14014f">   73</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa7b75f95a45d7a1030c297192b14014f">diffuse_reflectance</a>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#acfd78796e08f527a24cce3c1e206148c">   74</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#acfd78796e08f527a24cce3c1e206148c">specular_reflectance</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad77e4c78a2bf60776c673b91bc4c8a13">   75</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad77e4c78a2bf60776c673b91bc4c8a13">shinniness</a>;</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ae26eed46a279c73e947880858763514e">   76</a></span>&#160;        <a class="code" href="classmingfx_1_1_texture2_d.html">Texture2D</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ae26eed46a279c73e947880858763514e">surface_texture</a>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="comment">// eventually, this might include a normal map, etc.</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="comment">// defaults</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa24361a9c6eb0a87355d0ad00e47dd96">   80</a></span>&#160;        <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa24361a9c6eb0a87355d0ad00e47dd96">MaterialProperties</a>() :</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad4db9a1b0636db84f57f022c51ce7657">ambient_reflectance</a>(0.25f, 0.25f, 0.25f),</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa7b75f95a45d7a1030c297192b14014f">diffuse_reflectance</a>(0.6f, 0.6f, 0.6f),</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#acfd78796e08f527a24cce3c1e206148c">specular_reflectance</a>(0.4f, 0.4f, 0.4f),</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad77e4c78a2bf60776c673b91bc4c8a13">shinniness</a>(20.0f) {}</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    };</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html">   88</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> {</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a160b58a0e70294008b9dac8eb6291d3e">   90</a></span>&#160;        <a class="code" href="classmingfx_1_1_point3.html">Point3</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a160b58a0e70294008b9dac8eb6291d3e">position</a>;</div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a226c173b193459af291687dd45280fbb">   91</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a226c173b193459af291687dd45280fbb">ambient_intensity</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a9a010057c15e3db5661b07a03d5176d7">   92</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a9a010057c15e3db5661b07a03d5176d7">diffuse_intensity</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html#abef7666629dbb9da661b163e0584c9a4">   93</a></span>&#160;        <a class="code" href="classmingfx_1_1_color.html">Color</a> <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#abef7666629dbb9da661b163e0584c9a4">specular_intensity</a>;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="comment">// defaults</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a582ceee332260b06cbf2ec607257aba3">   96</a></span>&#160;        <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a582ceee332260b06cbf2ec607257aba3">LightProperties</a>() :</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a160b58a0e70294008b9dac8eb6291d3e">position</a>(10.0f, 10.0f, 10.0f),</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a226c173b193459af291687dd45280fbb">ambient_intensity</a>(0.25f, 0.25f, 0.25f),</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#a9a010057c15e3db5661b07a03d5176d7">diffuse_intensity</a>(0.6f, 0.6f, 0.6f),</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html#abef7666629dbb9da661b163e0584c9a4">specular_intensity</a>(0.6f, 0.6f, 0.6f) {}</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    };</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    </div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">  106</a></span>&#160;    <a class="code" href="classmingfx_1_1_default_shader.html#ac030575fd76a6076262bdd09bbb93428">DefaultShader</a>(<span class="keywordtype">bool</span> add_default_light=<span class="keyword">true</span>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a0fe7d605d039ecdbf17837bc5bbe0aba">  108</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classmingfx_1_1_default_shader.html#a0fe7d605d039ecdbf17837bc5bbe0aba">~DefaultShader</a>();</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#af54a8e489d9fb34cfceb1c07562c6e2c">  112</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#af54a8e489d9fb34cfceb1c07562c6e2c">AddLight</a>(<a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> <a class="code" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a>);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a41e74fb8af72a6b22c72b0916726b6d6">  115</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a41e74fb8af72a6b22c72b0916726b6d6">SetLight</a>(<span class="keywordtype">int</span> i, <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> <a class="code" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a>);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">  124</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a5cb9f0a1709452268858ec338448a4c3">Init</a>();</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b">  130</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b">Draw</a>(<span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;model, <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;view, <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;projection,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;              <a class="code" href="classmingfx_1_1_mesh.html">Mesh</a> *mesh, <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;material);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    </div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0">  138</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0">UseProgram</a>(<span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;model, <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;view, <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_matrix4.html">Matrix4</a> &amp;projection,</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                    <span class="keyword">const</span> <a class="code" href="classmingfx_1_1_default_shader_1_1_material_properties.html">MaterialProperties</a> &amp;material);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67">  143</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67">StopProgram</a>();</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    </div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    </div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#ac5b779672a983df8aa67c9cbe026e0c2">  146</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmingfx_1_1_default_shader.html#ac5b779672a983df8aa67c9cbe026e0c2">num_lights</a>();</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    </div>
<div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">  148</a></span>&#160;    <a class="code" href="classmingfx_1_1_default_shader_1_1_light_properties.html">LightProperties</a> <a class="code" href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">light</a>(<span class="keywordtype">int</span> i);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    </div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    </div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    std::vector&lt;LightProperties&gt; lights_;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="comment">// cached raw float arrays store data to send directly to the gpu</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="comment">// GLSL requires fixed size arrays for these</span></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">float</span> lightPositions_[3*<a class="code" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a>];</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">float</span> lightIas_[4*<a class="code" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a>];</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordtype">float</span> lightIds_[4*<a class="code" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a>];</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="keywordtype">float</span> lightIss_[4*<a class="code" href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">MAX_LIGHTS</a>];</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keywordtype">void</span> update_light_arrays();</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    </div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <a class="code" href="classmingfx_1_1_shader_program.html">ShaderProgram</a> phongShader_;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;};</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;} <span class="comment">// end namespace</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassmingfx_1_1_color_html"><div class="ttname"><a href="classmingfx_1_1_color.html">mingfx::Color</a></div><div class="ttdoc">Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...</div><div class="ttdef"><b>Definition:</b> <a href="color_8h_source.html#l00041">color.h:41</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html">mingfx::DefaultShader::LightProperties</a></div><div class="ttdoc">Small data structure to hold per-light properties.</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00088">default_shader.h:88</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html_a160b58a0e70294008b9dac8eb6291d3e"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html#a160b58a0e70294008b9dac8eb6291d3e">mingfx::DefaultShader::LightProperties::position</a></div><div class="ttdeci">Point3 position</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00090">default_shader.h:90</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html_a226c173b193459af291687dd45280fbb"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html#a226c173b193459af291687dd45280fbb">mingfx::DefaultShader::LightProperties::ambient_intensity</a></div><div class="ttdeci">Color ambient_intensity</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00091">default_shader.h:91</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html_a582ceee332260b06cbf2ec607257aba3"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html#a582ceee332260b06cbf2ec607257aba3">mingfx::DefaultShader::LightProperties::LightProperties</a></div><div class="ttdeci">LightProperties()</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00096">default_shader.h:96</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html_a9a010057c15e3db5661b07a03d5176d7"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html#a9a010057c15e3db5661b07a03d5176d7">mingfx::DefaultShader::LightProperties::diffuse_intensity</a></div><div class="ttdeci">Color diffuse_intensity</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00092">default_shader.h:92</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_light_properties_html_abef7666629dbb9da661b163e0584c9a4"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_light_properties.html#abef7666629dbb9da661b163e0584c9a4">mingfx::DefaultShader::LightProperties::specular_intensity</a></div><div class="ttdeci">Color specular_intensity</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00093">default_shader.h:93</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html">mingfx::DefaultShader::MaterialProperties</a></div><div class="ttdoc">Small data structure to hold properties of the material to be lit.</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00070">default_shader.h:70</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_aa24361a9c6eb0a87355d0ad00e47dd96"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa24361a9c6eb0a87355d0ad00e47dd96">mingfx::DefaultShader::MaterialProperties::MaterialProperties</a></div><div class="ttdeci">MaterialProperties()</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00080">default_shader.h:80</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_aa7b75f95a45d7a1030c297192b14014f"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#aa7b75f95a45d7a1030c297192b14014f">mingfx::DefaultShader::MaterialProperties::diffuse_reflectance</a></div><div class="ttdeci">Color diffuse_reflectance</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00073">default_shader.h:73</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_acfd78796e08f527a24cce3c1e206148c"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#acfd78796e08f527a24cce3c1e206148c">mingfx::DefaultShader::MaterialProperties::specular_reflectance</a></div><div class="ttdeci">Color specular_reflectance</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00074">default_shader.h:74</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_ad4db9a1b0636db84f57f022c51ce7657"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad4db9a1b0636db84f57f022c51ce7657">mingfx::DefaultShader::MaterialProperties::ambient_reflectance</a></div><div class="ttdeci">Color ambient_reflectance</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00072">default_shader.h:72</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_ad77e4c78a2bf60776c673b91bc4c8a13"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#ad77e4c78a2bf60776c673b91bc4c8a13">mingfx::DefaultShader::MaterialProperties::shinniness</a></div><div class="ttdeci">float shinniness</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00075">default_shader.h:75</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_1_1_material_properties_html_ae26eed46a279c73e947880858763514e"><div class="ttname"><a href="classmingfx_1_1_default_shader_1_1_material_properties.html#ae26eed46a279c73e947880858763514e">mingfx::DefaultShader::MaterialProperties::surface_texture</a></div><div class="ttdeci">Texture2D surface_texture</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00076">default_shader.h:76</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html"><div class="ttname"><a href="classmingfx_1_1_default_shader.html">mingfx::DefaultShader</a></div><div class="ttdoc">A simple GLSL shader for textured per-fragment Phong shading with multiple light sources.</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00062">default_shader.h:62</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a053599d8c7acd9920461aab8ce945ab0"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a053599d8c7acd9920461aab8ce945ab0">mingfx::DefaultShader::UseProgram</a></div><div class="ttdeci">void UseProgram(const Matrix4 &amp;model, const Matrix4 &amp;view, const Matrix4 &amp;projection, const MaterialProperties &amp;material)</div><div class="ttdoc">Only needed if you do not want to draw a Mesh. This does all of the same setup for drawing that the D...</div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a0fe7d605d039ecdbf17837bc5bbe0aba"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a0fe7d605d039ecdbf17837bc5bbe0aba">mingfx::DefaultShader::~DefaultShader</a></div><div class="ttdeci">virtual ~DefaultShader()</div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a21c1fd93273eaf643e7ac9b05ba0fb24"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a21c1fd93273eaf643e7ac9b05ba0fb24">mingfx::DefaultShader::MAX_LIGHTS</a></div><div class="ttdeci">static const unsigned int MAX_LIGHTS</div><div class="ttdoc">If changed, this needs to also be changed in the glsl shader code.</div><div class="ttdef"><b>Definition:</b> <a href="default__shader_8h_source.html#l00066">default_shader.h:66</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a2c188bc0fc5f7fc7405f04b036bd4d67"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a2c188bc0fc5f7fc7405f04b036bd4d67">mingfx::DefaultShader::StopProgram</a></div><div class="ttdeci">void StopProgram()</div><div class="ttdoc">Only needed if you do not want to draw a Mesh. Call this after UseProgram() and after drawing your ge...</div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_a41e74fb8af72a6b22c72b0916726b6d6"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a41e74fb8af72a6b22c72b0916726b6d6">mingfx::DefaultShader::SetLight</a></div><div class="ttdeci">void SetLight(int i, LightProperties light)</div><div class="ttdoc">Changes the properties for a light that was already added.</div></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_a652b3d00bb6ae2a806b1ca3e3d42242b"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#a652b3d00bb6ae2a806b1ca3e3d42242b">mingfx::DefaultShader::Draw</a></div><div class="ttdeci">void Draw(const Matrix4 &amp;model, const Matrix4 &amp;view, const Matrix4 &amp;projection, Mesh *mesh, const MaterialProperties &amp;material)</div><div class="ttdoc">This starts the shader and sets its uniform variables based upon the current set of lights,...</div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_aa2ed33efad35aefbb400be45250cd316"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#aa2ed33efad35aefbb400be45250cd316">mingfx::DefaultShader::light</a></div><div class="ttdeci">LightProperties light(int i)</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_default_shader_html_ac5b779672a983df8aa67c9cbe026e0c2"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#ac5b779672a983df8aa67c9cbe026e0c2">mingfx::DefaultShader::num_lights</a></div><div class="ttdeci">int num_lights()</div></div>
<div class="ttc" id="aclassmingfx_1_1_default_shader_html_af54a8e489d9fb34cfceb1c07562c6e2c"><div class="ttname"><a href="classmingfx_1_1_default_shader.html#af54a8e489d9fb34cfceb1c07562c6e2c">mingfx::DefaultShader::AddLight</a></div><div class="ttdeci">void AddLight(LightProperties light)</div><div class="ttdoc">Multiple lights are supported, this adds one to the end of the list. Up to MAX_LIGHTS can be added.</div></div>
<div class="ttc" id="aclassmingfx_1_1_matrix4_html"><div class="ttname"><a href="classmingfx_1_1_matrix4.html">mingfx::Matrix4</a></div><div class="ttdoc">A 4x4 transformation matrix stored internally as an array of floats in column-major order so as to be...</div><div class="ttdef"><b>Definition:</b> <a href="matrix4_8h_source.html#l00050">matrix4.h:50</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_mesh_html"><div class="ttname"><a href="classmingfx_1_1_mesh.html">mingfx::Mesh</a></div><div class="ttdoc">A triangle mesh data structure that can be rendered with a ShaderProgram like DefaultShader.</div><div class="ttdef"><b>Definition:</b> <a href="mesh_8h_source.html#l00127">mesh.h:127</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_point3_html"><div class="ttname"><a href="classmingfx_1_1_point3.html">mingfx::Point3</a></div><div class="ttdoc">A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...</div><div class="ttdef"><b>Definition:</b> <a href="point3_8h_source.html#l00052">point3.h:52</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_shader_program_html"><div class="ttname"><a href="classmingfx_1_1_shader_program.html">mingfx::ShaderProgram</a></div><div class="ttdoc">A wrapper around GLSL shader programs.</div><div class="ttdef"><b>Definition:</b> <a href="shader__program_8h_source.html#l00066">shader_program.h:66</a></div></div>
<div class="ttc" id="aclassmingfx_1_1_texture2_d_html"><div class="ttname"><a href="classmingfx_1_1_texture2_d.html">mingfx::Texture2D</a></div><div class="ttdoc">A wrapper around a 2D texture that supports loading images from files or setting texture color data d...</div><div class="ttdef"><b>Definition:</b> <a href="texture2d_8h_source.html#l00042">texture2d.h:42</a></div></div>
<div class="ttc" id="acolor_8h_html"><div class="ttname"><a href="color_8h.html">color.h</a></div></div>
<div class="ttc" id="amatrix4_8h_html"><div class="ttname"><a href="matrix4_8h.html">matrix4.h</a></div></div>
<div class="ttc" id="amesh_8h_html"><div class="ttname"><a href="mesh_8h.html">mesh.h</a></div></div>
<div class="ttc" id="anamespacemingfx_html"><div class="ttname"><a href="namespacemingfx.html">mingfx</a></div><div class="ttdoc">Namespace for the MinGfx Toolkit.</div><div class="ttdef"><b>Definition:</b> <a href="aabb_8h_source.html#l00021">aabb.h:21</a></div></div>
<div class="ttc" id="apoint3_8h_html"><div class="ttname"><a href="point3_8h.html">point3.h</a></div></div>
<div class="ttc" id="ashader__program_8h_html"><div class="ttname"><a href="shader__program_8h.html">shader_program.h</a></div></div>
<div class="ttc" id="atexture2d_8h_html"><div class="ttname"><a href="texture2d_8h.html">texture2d.h</a></div></div>
<div class="ttc" id="avector3_8h_html"><div class="ttname"><a href="vector3_8h.html">vector3.h</a></div></div>
</div><!-- fragment --></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>