aboutsummaryrefslogtreecommitdiffstats
path: root/spritebatch_8h_source.html
blob: a2f43621fd716ce055c2db03401ab6384e8c3121 (plain)
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
<!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.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>YAGE: yage/base/spritebatch.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</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>
<link href="doxygen.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 id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">YAGE
   &#160;<span id="projectnumber">v0.1.1</span>
   </div>
   <div id="projectbrief">Yet Another Game Engine</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('spritebatch_8h_source.html','');});
</script>
<div id="doc-content">
<!-- 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 class="header">
  <div class="headertitle">
<div class="title">spritebatch.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="spritebatch_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"> * spritebatch.h</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 Yann Herklotz Grave &lt;ymherklotz@gmail.com&gt; -- MIT License</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * See file LICENSE for more details</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"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef YAGE_SPRITE_BATCH_H</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define YAGE_SPRITE_BATCH_H</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="vertex_8h.html">vertex.h</a>&quot;</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 &lt;glad/glad.h&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;glm/glm.hpp&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceyage.html">yage</a></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;{</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;<span class="keyword">class </span>SpriteBatch;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html">   29</a></span>&#160;<span class="keyword">class </span><a class="code" href="classyage_1_1Glyph.html">Glyph</a></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;{</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a2efbe49c2307601731416d615ac415c8">   32</a></span>&#160;    GLuint <a class="code" href="classyage_1_1Glyph.html#a2efbe49c2307601731416d615ac415c8">texture_</a>;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#ab27b92a62dcebccae673a7d8d0c15704">   33</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="classyage_1_1Glyph.html#ab27b92a62dcebccae673a7d8d0c15704">depth_</a>;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a71c5c3381928153e3eb2f67461b76a2d">   34</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a71c5c3381928153e3eb2f67461b76a2d">top_left_</a>;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a9db1936e683cafe3b6ef72f63b3241fa">   35</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a9db1936e683cafe3b6ef72f63b3241fa">top_right_</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a6240a88991e31b2fc8ed5dccfc362234">   36</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a6240a88991e31b2fc8ed5dccfc362234">bottom_right_</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#add70123a08d594e4cfb627a03ae8daad">   37</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#add70123a08d594e4cfb627a03ae8daad">bottom_left_</a>;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="classyage_1_1Glyph.html#a19ae31e594b33bb1ad3bc1763cdba38f">Glyph</a>(GLuint <a class="code" href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">texture</a>, <span class="keywordtype">float</span> <a class="code" href="classyage_1_1Glyph.html#ab1906273e09446d9f6ccdc0a06428afa">depth</a>, <span class="keyword">const</span> <a class="code" href="structyage_1_1Vertex.html">Vertex</a> &amp;<a class="code" href="classyage_1_1Glyph.html#a6a86e79419ccea7f6921685c197453a1">top_left</a>,</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;          <span class="keyword">const</span> <a class="code" href="structyage_1_1Vertex.html">Vertex</a> &amp;<a class="code" href="classyage_1_1Glyph.html#aac14f7258926c0c06ec594bc616ed5d0">top_right</a>, <span class="keyword">const</span> <a class="code" href="structyage_1_1Vertex.html">Vertex</a> &amp;<a class="code" href="classyage_1_1Glyph.html#a3db3e9cd03629c6c37a597d5779d1024">bottom_right</a>,</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;          <span class="keyword">const</span> <a class="code" href="structyage_1_1Vertex.html">Vertex</a> &amp;<a class="code" href="classyage_1_1Glyph.html#a8d8150986db3f0985f1b5d9622f83854">bottom_left</a>);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">   44</a></span>&#160;    GLuint <a class="code" href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">texture</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#a2efbe49c2307601731416d615ac415c8">texture_</a>; }</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#ab1906273e09446d9f6ccdc0a06428afa">   45</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="classyage_1_1Glyph.html#ab1906273e09446d9f6ccdc0a06428afa">depth</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#ab27b92a62dcebccae673a7d8d0c15704">depth_</a>; }</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a6a86e79419ccea7f6921685c197453a1">   46</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a6a86e79419ccea7f6921685c197453a1">top_left</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#a71c5c3381928153e3eb2f67461b76a2d">top_left_</a>; }</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#aac14f7258926c0c06ec594bc616ed5d0">   47</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#aac14f7258926c0c06ec594bc616ed5d0">top_right</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#a9db1936e683cafe3b6ef72f63b3241fa">top_right_</a>; }</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a3db3e9cd03629c6c37a597d5779d1024">   48</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a3db3e9cd03629c6c37a597d5779d1024">bottom_right</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#a6240a88991e31b2fc8ed5dccfc362234">bottom_right_</a>; }</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classyage_1_1Glyph.html#a8d8150986db3f0985f1b5d9622f83854">   49</a></span>&#160;    <a class="code" href="structyage_1_1Vertex.html">Vertex</a> <a class="code" href="classyage_1_1Glyph.html#a8d8150986db3f0985f1b5d9622f83854">bottom_left</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#add70123a08d594e4cfb627a03ae8daad">bottom_left_</a>; }</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html">   52</a></span>&#160;<span class="keyword">class </span><a class="code" href="classyage_1_1RenderBatch.html">RenderBatch</a></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#ad12ecf32cf9f9244afa7e9ad15b4e78f">   54</a></span>&#160;    <span class="keyword">friend</span> <a class="code" href="classyage_1_1RenderBatch.html#ad12ecf32cf9f9244afa7e9ad15b4e78f">SpriteBatch</a>;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#a160bf0e089d392d26fd50935263762ba">   57</a></span>&#160;    GLsizei <a class="code" href="classyage_1_1RenderBatch.html#a160bf0e089d392d26fd50935263762ba">num_vertices_</a>;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#a129b5fa960e1acc85650ce06b10905e7">   58</a></span>&#160;    GLint <a class="code" href="classyage_1_1RenderBatch.html#a129b5fa960e1acc85650ce06b10905e7">offset_</a>;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#a17da9d35451d55766836917699406160">   59</a></span>&#160;    GLuint <a class="code" href="classyage_1_1RenderBatch.html#a17da9d35451d55766836917699406160">texture_</a>;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="classyage_1_1RenderBatch.html">RenderBatch</a>(GLint offset, GLsizei num_vertices, GLuint <a class="code" href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">texture</a>);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#a6bedb60b10b6d47b7b198d3cb53eea2a">   64</a></span>&#160;    GLint <a class="code" href="classyage_1_1RenderBatch.html#a6bedb60b10b6d47b7b198d3cb53eea2a">offset</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> offset_; }</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#ad5edaded9e6257aa2f3a3b7cae276307">   65</a></span>&#160;    GLsizei <a class="code" href="classyage_1_1RenderBatch.html#ad5edaded9e6257aa2f3a3b7cae276307">num_vertices</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_vertices_; }</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classyage_1_1RenderBatch.html#a54102dde86a787d06d47928de8f72c3f">   66</a></span>&#160;    GLuint <a class="code" href="classyage_1_1RenderBatch.html#a54102dde86a787d06d47928de8f72c3f">texture</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classyage_1_1Glyph.html#a2efbe49c2307601731416d615ac415c8">texture_</a>; }</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="l00069"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html">   69</a></span>&#160;<span class="keyword">class </span><a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;{</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="classyage_1_1SpriteBatch.html#a6e01d11880a841b153e950aa8307b1a5">   72</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> NUM_VERTICES = 6;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html#a56e335f07826ca61ba680981d46b043c">   75</a></span>&#160;    GLuint vbo_ = 0;</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html#a00a06cc5f4bd47c2d5003cf2e3d7a6c1">   76</a></span>&#160;    GLuint vao_ = 0;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html#a0ca8f0d0df0eeb22e8fc6fceebb96200">   77</a></span>&#160;    std::vector&lt;Glyph&gt; <a class="code" href="classyage_1_1SpriteBatch.html#a0ca8f0d0df0eeb22e8fc6fceebb96200">glyphs_</a>;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html#a007d24cd3765e2fcea843f85dbbb475e">   78</a></span>&#160;    std::vector&lt;Glyph *&gt; <a class="code" href="classyage_1_1SpriteBatch.html#a007d24cd3765e2fcea843f85dbbb475e">glyph_ptrs_</a>;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classyage_1_1SpriteBatch.html#abf057ffe5fd9b7c35256dad147391008">   79</a></span>&#160;    std::vector&lt;RenderBatch&gt; <a class="code" href="classyage_1_1SpriteBatch.html#abf057ffe5fd9b7c35256dad147391008">render_batches_</a>;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a>();</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a>(<span class="keyword">const</span> <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a>(<a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;&amp;) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    ~<a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a>();</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;operator=(<span class="keyword">const</span> <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;operator=(<a class="code" href="classyage_1_1SpriteBatch.html">SpriteBatch</a> &amp;&amp;) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="comment">// initialize vaos and vbos</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce">init</a>();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordtype">void</span> begin();</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordtype">void</span> end();</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="comment">// adds a sprite to the sprite batch to be rendered later</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordtype">void</span> draw(<span class="keyword">const</span> glm::vec4 &amp;destination_rect, <span class="keyword">const</span> glm::vec4 &amp;uv_rect,</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;              GLuint <a class="code" href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">texture</a>, <span class="keyword">const</span> <a class="code" href="structyage_1_1Color.html">Color</a> &amp;color, <span class="keywordtype">float</span> <a class="code" href="classyage_1_1Glyph.html#ab1906273e09446d9f6ccdc0a06428afa">depth</a>);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">// render the batch</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordtype">void</span> render();</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">void</span> createVertexArray();</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">void</span> createRenderBatches();</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordtype">void</span> sortGlyphs();</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;};</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;} <span class="comment">// namespace yage</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">  108</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classyage_1_1RenderBatch_html"><div class="ttname"><a href="classyage_1_1RenderBatch.html">yage::RenderBatch</a></div><div class="ttdef"><b>Definition:</b> spritebatch.h:52</div></div>
<div class="ttc" id="classyage_1_1SpriteBatch_html_a007d24cd3765e2fcea843f85dbbb475e"><div class="ttname"><a href="classyage_1_1SpriteBatch.html#a007d24cd3765e2fcea843f85dbbb475e">yage::SpriteBatch::glyph_ptrs_</a></div><div class="ttdeci">std::vector&lt; Glyph * &gt; glyph_ptrs_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:78</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_a17da9d35451d55766836917699406160"><div class="ttname"><a href="classyage_1_1RenderBatch.html#a17da9d35451d55766836917699406160">yage::RenderBatch::texture_</a></div><div class="ttdeci">GLuint texture_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:59</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_add70123a08d594e4cfb627a03ae8daad"><div class="ttname"><a href="classyage_1_1Glyph.html#add70123a08d594e4cfb627a03ae8daad">yage::Glyph::bottom_left_</a></div><div class="ttdeci">Vertex bottom_left_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:37</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_aac14f7258926c0c06ec594bc616ed5d0"><div class="ttname"><a href="classyage_1_1Glyph.html#aac14f7258926c0c06ec594bc616ed5d0">yage::Glyph::top_right</a></div><div class="ttdeci">Vertex top_right() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:47</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_af59de1a9642b07583d49197bc9d74747"><div class="ttname"><a href="classyage_1_1Glyph.html#af59de1a9642b07583d49197bc9d74747">yage::Glyph::texture</a></div><div class="ttdeci">GLuint texture() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:44</div></div>
<div class="ttc" id="structyage_1_1Vertex_html"><div class="ttname"><a href="structyage_1_1Vertex.html">yage::Vertex</a></div><div class="ttdef"><b>Definition:</b> vertex.h:49</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_ab1906273e09446d9f6ccdc0a06428afa"><div class="ttname"><a href="classyage_1_1Glyph.html#ab1906273e09446d9f6ccdc0a06428afa">yage::Glyph::depth</a></div><div class="ttdeci">float depth() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:45</div></div>
<div class="ttc" id="classyage_1_1SpriteBatch_html"><div class="ttname"><a href="classyage_1_1SpriteBatch.html">yage::SpriteBatch</a></div><div class="ttdef"><b>Definition:</b> spritebatch.h:69</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a71c5c3381928153e3eb2f67461b76a2d"><div class="ttname"><a href="classyage_1_1Glyph.html#a71c5c3381928153e3eb2f67461b76a2d">yage::Glyph::top_left_</a></div><div class="ttdeci">Vertex top_left_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:34</div></div>
<div class="ttc" id="namespaceyage_html_a4fc8b4d2a19d4c7f7f1bd42a788827ce"><div class="ttname"><a href="namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce">yage::init</a></div><div class="ttdeci">void init()</div><div class="ttdoc">Initializes yage. </div><div class="ttdef"><b>Definition:</b> yage.cpp:23</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_a54102dde86a787d06d47928de8f72c3f"><div class="ttname"><a href="classyage_1_1RenderBatch.html#a54102dde86a787d06d47928de8f72c3f">yage::RenderBatch::texture</a></div><div class="ttdeci">GLuint texture() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:66</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a19ae31e594b33bb1ad3bc1763cdba38f"><div class="ttname"><a href="classyage_1_1Glyph.html#a19ae31e594b33bb1ad3bc1763cdba38f">yage::Glyph::Glyph</a></div><div class="ttdeci">Glyph(GLuint texture, float depth, const Vertex &amp;top_left, const Vertex &amp;top_right, const Vertex &amp;bottom_right, const Vertex &amp;bottom_left)</div><div class="ttdef"><b>Definition:</b> spritebatch.cpp:19</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_ab27b92a62dcebccae673a7d8d0c15704"><div class="ttname"><a href="classyage_1_1Glyph.html#ab27b92a62dcebccae673a7d8d0c15704">yage::Glyph::depth_</a></div><div class="ttdeci">float depth_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:33</div></div>
<div class="ttc" id="vertex_8h_html"><div class="ttname"><a href="vertex_8h.html">vertex.h</a></div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_ad12ecf32cf9f9244afa7e9ad15b4e78f"><div class="ttname"><a href="classyage_1_1RenderBatch.html#ad12ecf32cf9f9244afa7e9ad15b4e78f">yage::RenderBatch::SpriteBatch</a></div><div class="ttdeci">friend SpriteBatch</div><div class="ttdef"><b>Definition:</b> spritebatch.h:54</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a2efbe49c2307601731416d615ac415c8"><div class="ttname"><a href="classyage_1_1Glyph.html#a2efbe49c2307601731416d615ac415c8">yage::Glyph::texture_</a></div><div class="ttdeci">GLuint texture_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:32</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a8d8150986db3f0985f1b5d9622f83854"><div class="ttname"><a href="classyage_1_1Glyph.html#a8d8150986db3f0985f1b5d9622f83854">yage::Glyph::bottom_left</a></div><div class="ttdeci">Vertex bottom_left() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:49</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a3db3e9cd03629c6c37a597d5779d1024"><div class="ttname"><a href="classyage_1_1Glyph.html#a3db3e9cd03629c6c37a597d5779d1024">yage::Glyph::bottom_right</a></div><div class="ttdeci">Vertex bottom_right() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:48</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a6240a88991e31b2fc8ed5dccfc362234"><div class="ttname"><a href="classyage_1_1Glyph.html#a6240a88991e31b2fc8ed5dccfc362234">yage::Glyph::bottom_right_</a></div><div class="ttdeci">Vertex bottom_right_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:36</div></div>
<div class="ttc" id="classyage_1_1SpriteBatch_html_abf057ffe5fd9b7c35256dad147391008"><div class="ttname"><a href="classyage_1_1SpriteBatch.html#abf057ffe5fd9b7c35256dad147391008">yage::SpriteBatch::render_batches_</a></div><div class="ttdeci">std::vector&lt; RenderBatch &gt; render_batches_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:79</div></div>
<div class="ttc" id="classyage_1_1SpriteBatch_html_a0ca8f0d0df0eeb22e8fc6fceebb96200"><div class="ttname"><a href="classyage_1_1SpriteBatch.html#a0ca8f0d0df0eeb22e8fc6fceebb96200">yage::SpriteBatch::glyphs_</a></div><div class="ttdeci">std::vector&lt; Glyph &gt; glyphs_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:77</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_a129b5fa960e1acc85650ce06b10905e7"><div class="ttname"><a href="classyage_1_1RenderBatch.html#a129b5fa960e1acc85650ce06b10905e7">yage::RenderBatch::offset_</a></div><div class="ttdeci">GLint offset_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:58</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a9db1936e683cafe3b6ef72f63b3241fa"><div class="ttname"><a href="classyage_1_1Glyph.html#a9db1936e683cafe3b6ef72f63b3241fa">yage::Glyph::top_right_</a></div><div class="ttdeci">Vertex top_right_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:35</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_ad5edaded9e6257aa2f3a3b7cae276307"><div class="ttname"><a href="classyage_1_1RenderBatch.html#ad5edaded9e6257aa2f3a3b7cae276307">yage::RenderBatch::num_vertices</a></div><div class="ttdeci">GLsizei num_vertices() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:65</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_a6bedb60b10b6d47b7b198d3cb53eea2a"><div class="ttname"><a href="classyage_1_1RenderBatch.html#a6bedb60b10b6d47b7b198d3cb53eea2a">yage::RenderBatch::offset</a></div><div class="ttdeci">GLint offset() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:64</div></div>
<div class="ttc" id="classyage_1_1Glyph_html"><div class="ttname"><a href="classyage_1_1Glyph.html">yage::Glyph</a></div><div class="ttdoc">Glyph with information of the texture. </div><div class="ttdef"><b>Definition:</b> spritebatch.h:29</div></div>
<div class="ttc" id="classyage_1_1Glyph_html_a6a86e79419ccea7f6921685c197453a1"><div class="ttname"><a href="classyage_1_1Glyph.html#a6a86e79419ccea7f6921685c197453a1">yage::Glyph::top_left</a></div><div class="ttdeci">Vertex top_left() const</div><div class="ttdef"><b>Definition:</b> spritebatch.h:46</div></div>
<div class="ttc" id="namespaceyage_html"><div class="ttname"><a href="namespaceyage.html">yage</a></div><div class="ttdoc">Project namespace. </div><div class="ttdef"><b>Definition:</b> camera2d.cpp:13</div></div>
<div class="ttc" id="classyage_1_1RenderBatch_html_a160bf0e089d392d26fd50935263762ba"><div class="ttname"><a href="classyage_1_1RenderBatch.html#a160bf0e089d392d26fd50935263762ba">yage::RenderBatch::num_vertices_</a></div><div class="ttdeci">GLsizei num_vertices_</div><div class="ttdef"><b>Definition:</b> spritebatch.h:57</div></div>
<div class="ttc" id="structyage_1_1Color_html"><div class="ttname"><a href="structyage_1_1Color.html">yage::Color</a></div><div class="ttdef"><b>Definition:</b> vertex.h:26</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_0a5be4b85c8e2c05f7a9f5a803f53125.html">yage</a></li><li class="navelem"><a class="el" href="dir_ac0faa69eaf4dc6c8e3ca03d2fb5cb5f.html">base</a></li><li class="navelem"><a class="el" href="spritebatch_8h.html">spritebatch.h</a></li>
    <li class="footer">Generated on Tue Sep 26 2017 14:16:32 for YAGE by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>