libnx/framebuffer_8h_source.html
2025-05-08 06:59:12 +00:00

208 lines
28 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libnx: include/switch/display/framebuffer.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>
<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 id="projectrow">
<td id="projectalign">
<div id="projectname">libnx<span id="projectnumber">&#160;v4.9.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_42bea3d40f1f1694e41a8f3166c98108.html">switch</a></li><li class="navelem"><a class="el" href="dir_2b5b553157a94351151a308cd797ea35.html">display</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">framebuffer.h</div></div>
</div><!--header-->
<div class="contents">
<a href="framebuffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/**</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * @file framebuffer.h</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * @brief Framebuffer wrapper object, providing support for software rendered graphics.</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * @author fincs</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * @copyright libnx Authors</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> */</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;../nvidia/map.h&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;<a class="code" href="native__window_8h.html">native_window.h</a>&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"></span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">/// Converts red/green/blue/alpha components to packed RGBA8 (i.e. \ref PIXEL_FORMAT_RGBA_8888).</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ada252b0d1c54c165a668d3bb1bee06c1"> 12</a></span><span class="comment"></span><span class="preprocessor">#define RGBA8(r,g,b,a) (((r)&amp;0xff)|(((g)&amp;0xff)&lt;&lt;8)|(((b)&amp;0xff)&lt;&lt;16)|(((a)&amp;0xff)&lt;&lt;24))</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"></span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">/// Same as \ref RGBA8 except with alpha=0xff.</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a2ed799d2d34a926b6eb4126eebac974f"> 15</a></span><span class="comment"></span><span class="preprocessor">#define RGBA8_MAXALPHA(r,g,b) RGBA8((r),(g),(b),0xff)</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"></span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">/// Converts red/green/blue to packed RGBX8 (i.e. \ref PIXEL_FORMAT_RGBX_8888).</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a2526aa11f61dd5b7c0fc7b609e92165a"> 18</a></span><span class="comment"></span><span class="preprocessor">#define RGBX8(r,g,b) RGBA8((r),(g),(b),0)</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment"></span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">/// Converts red/green/blue components to packed RGB565 (i.e. \ref PIXEL_FORMAT_RGB_565)</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ab2ed36b98652f54ec3e1fdc8a31c8b13"> 21</a></span><span class="comment"></span><span class="preprocessor">#define RGB565(r,g,b) (((b)&amp;0x1f)|(((g)&amp;0x3f)&lt;&lt;5)|(((r)&amp;0x1f)&lt;&lt;11))</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"></span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">/// Same as \ref RGB565 but accepting 8-bit components as input instead.</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a88522287090978d8a811339a0c11eada"> 24</a></span><span class="comment"></span><span class="preprocessor">#define RGB565_FROM_RGB8(r,g,b) RGB565((r)&gt;&gt;3,(g)&gt;&gt;2,(b)&gt;&gt;3)</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment"></span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">/// Converts red/green/blue/alpha components to packed BGR8 (i.e. \ref PIXEL_FORMAT_BGRA_8888).</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a1489caec0aacfac8056b3cf0dfc8104e"> 27</a></span><span class="comment"></span><span class="preprocessor">#define BGRA8(r,g,b,a) RGBA8((b),(g),(r),(a))</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment"></span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">/// Same as \ref BGRA8 except with alpha=0xff.</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a3a105c506747ad6014c81bac90d74bec"> 30</a></span><span class="comment"></span><span class="preprocessor">#define BGRA8_MAXALPHA(r,g,b) RGBA8((b),(g),(r),0xff)</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment"></span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment">/// Converts red/green/blue/alpha components to packed RGBA4 (i.e. \ref PIXEL_FORMAT_RGBA_4444).</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a8310669d74ada6b7376bd0f54c4860e0"> 33</a></span><span class="comment"></span><span class="preprocessor">#define RGBA4(r,g,b,a) (((r)&amp;0xf)|(((g)&amp;0xf)&lt;&lt;4)|(((b)&amp;0xf)&lt;&lt;8)|(((a)&amp;0xf)&lt;&lt;12))</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment"></span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">/// Same as \ref RGBA4 except with alpha=0xf.</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a06dd70549c1855b1f443d9a80d5d2422"> 36</a></span><span class="comment"></span><span class="preprocessor">#define RGBA4_MAXALPHA(r,g,b) RGBA4((r),(g),(b),0xf)</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment"></span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">/// Same as \ref RGBA4 but accepting 8-bit components as input instead.</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a43a178866fe21b617fc69cb22d1a141d"> 39</a></span><span class="comment"></span><span class="preprocessor">#define RGBA4_FROM_RGBA8(r,g,b,a) RGBA4((r)&gt;&gt;4,(g)&gt;&gt;4,(b)&gt;&gt;4,(a)&gt;&gt;4)</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment"></span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/// Same as \ref RGBA4_MAXALPHA except with alpha=0xff.</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ad8792b9073ff927b30e64afba9d5d8aa"> 42</a></span><span class="comment"></span><span class="preprocessor">#define RGBA4_FROM_RGBA8_MAXALPHA(r,g,b) RGBA4_MAXALPHA((r)&gt;&gt;4,(g)&gt;&gt;4,(b)&gt;&gt;4)</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"></span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment">/// Framebuffer structure.</span></div>
<div class="foldopen" id="foldopen00045" data-start="{" data-end="};">
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="structFramebuffer.html"> 45</a></span><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a> {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <a class="code hl_struct" href="structNWindow.html">NWindow</a> *win;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <a class="code hl_struct" href="structNvMap.html">NvMap</a> map;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">void</span>* buf;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">void</span>* buf_linear;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> stride;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> width_aligned;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> height_aligned;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> num_fbs;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> fb_size;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">bool</span> has_init;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span>} <a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>;</div>
</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment"></span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment">/**</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment"> * @brief Creates a \ref Framebuffer object.</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment"> * @param[out] fb Output \ref Framebuffer structure.</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment"> * @param[in] win Pointer to the \ref NWindow to which the \ref Framebuffer will be registered.</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"> * @param[in] width Desired width of the framebuffer (usually 1280).</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment"> * @param[in] height Desired height of the framebuffer (usually 720).</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment"> * @param[in] format Desired pixel format (see PIXEL_FORMAT_* enum).</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment"> * @param[in] num_fbs Number of buffers to create. Pass 1 for single-buffering, 2 for double-buffering or 3 for triple-buffering.</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> * @note Framebuffer images are stored in Tegra block linear format with 16Bx2 sector ordering, read TRM chapter 20.1 for more details.</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> * In order to use regular linear layout, consider calling \ref framebufferMakeLinear after the \ref Framebuffer object is created.</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> * @note Presently, only the following pixel formats are supported:</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"> * \ref PIXEL_FORMAT_RGBA_8888</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"> * \ref PIXEL_FORMAT_RGBX_8888</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"> * \ref PIXEL_FORMAT_RGB_565</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> * \ref PIXEL_FORMAT_BGRA_8888</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> * \ref PIXEL_FORMAT_RGBA_4444</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> */</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#a39d6330d4aa0a6cfecfb15f57d08209e"> 75</a></span><a class="code hl_typedef" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> <a class="code hl_function" href="framebuffer_8h.html#a39d6330d4aa0a6cfecfb15f57d08209e">framebufferCreate</a>(<a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>* fb, <a class="code hl_struct" href="structNWindow.html">NWindow</a> *win, <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> width, <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> height, <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> format, <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> num_fbs);</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"></span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment">/// Enables linear framebuffer mode in a \ref Framebuffer, allocating a shadow buffer in the process.</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ab0cd755df16aaa629d659da93961a859"> 78</a></span><span class="comment"></span><a class="code hl_typedef" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> <a class="code hl_function" href="framebuffer_8h.html#ab0cd755df16aaa629d659da93961a859">framebufferMakeLinear</a>(<a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>* fb);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"></span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment">/// Closes a \ref Framebuffer object, freeing all resources associated with it.</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#af0c4da5d2f1b0a15fd25a8a48debf630"> 81</a></span><span class="comment"></span><span class="keywordtype">void</span> <a class="code hl_function" href="framebuffer_8h.html#af0c4da5d2f1b0a15fd25a8a48debf630">framebufferClose</a>(<a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>* fb);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment"></span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment">/**</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> * @brief Begins rendering a frame in a \ref Framebuffer.</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> * @param[in] fb Pointer to \ref Framebuffer structure.</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> * @param[out] out_stride Output variable containing the distance in bytes between rows of pixels in memory.</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"> * @return Pointer to buffer to which new graphics data should be written to.</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> * @note When this function is called, a buffer will be dequeued from the corresponding \ref NWindow.</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> * @note This function will return pointers to different buffers, depending on the number of buffers it was initialized with.</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> * @note If \ref framebufferMakeLinear was used, this function will instead return a pointer to the shadow linear buffer.</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> * In this case, the offset of a pixel is \p y * \p out_stride + \p x * \p bytes_per_pixel.</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> * @note Each call to \ref framebufferBegin must be paired with a \ref framebufferEnd call.</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"> */</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ad8362196eab1229e7e6a72c6b790fdd4"> 94</a></span><span class="keywordtype">void</span>* <a class="code hl_function" href="framebuffer_8h.html#ad8362196eab1229e7e6a72c6b790fdd4">framebufferBegin</a>(<a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>* fb, <a class="code hl_typedef" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a>* out_stride);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"></span> </div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment">/**</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> * @brief Finishes rendering a frame in a \ref Framebuffer.</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> * @param[in] fb Pointer to \ref Framebuffer structure.</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> * @note When this function is called, the written image data will be flushed and queued (presented) in the corresponding \ref NWindow.</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> * @note If \ref framebufferMakeLinear was used, this function will copy the image from the shadow linear buffer to the actual framebuffer,</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> * converting it in the process to the layout expected by the compositor.</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"> * @note Each call to \ref framebufferBegin must be paired with a \ref framebufferEnd call.</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"> */</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="framebuffer_8h.html#ae3e68013f6c5d800dd9395bb825edf59"> 104</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="framebuffer_8h.html#ae3e68013f6c5d800dd9395bb825edf59">framebufferEnd</a>(<a class="code hl_struct" href="structFramebuffer.html">Framebuffer</a>* fb);</div>
<div class="ttc" id="aframebuffer_8h_html_a39d6330d4aa0a6cfecfb15f57d08209e"><div class="ttname"><a href="framebuffer_8h.html#a39d6330d4aa0a6cfecfb15f57d08209e">framebufferCreate</a></div><div class="ttdeci">Result framebufferCreate(Framebuffer *fb, NWindow *win, u32 width, u32 height, u32 format, u32 num_fbs)</div><div class="ttdoc">Creates a Framebuffer object.</div></div>
<div class="ttc" id="aframebuffer_8h_html_ab0cd755df16aaa629d659da93961a859"><div class="ttname"><a href="framebuffer_8h.html#ab0cd755df16aaa629d659da93961a859">framebufferMakeLinear</a></div><div class="ttdeci">Result framebufferMakeLinear(Framebuffer *fb)</div><div class="ttdoc">Enables linear framebuffer mode in a Framebuffer, allocating a shadow buffer in the process.</div></div>
<div class="ttc" id="aframebuffer_8h_html_ad8362196eab1229e7e6a72c6b790fdd4"><div class="ttname"><a href="framebuffer_8h.html#ad8362196eab1229e7e6a72c6b790fdd4">framebufferBegin</a></div><div class="ttdeci">void * framebufferBegin(Framebuffer *fb, u32 *out_stride)</div><div class="ttdoc">Begins rendering a frame in a Framebuffer.</div></div>
<div class="ttc" id="aframebuffer_8h_html_ae3e68013f6c5d800dd9395bb825edf59"><div class="ttname"><a href="framebuffer_8h.html#ae3e68013f6c5d800dd9395bb825edf59">framebufferEnd</a></div><div class="ttdeci">void framebufferEnd(Framebuffer *fb)</div><div class="ttdoc">Finishes rendering a frame in a Framebuffer.</div></div>
<div class="ttc" id="aframebuffer_8h_html_af0c4da5d2f1b0a15fd25a8a48debf630"><div class="ttname"><a href="framebuffer_8h.html#af0c4da5d2f1b0a15fd25a8a48debf630">framebufferClose</a></div><div class="ttdeci">void framebufferClose(Framebuffer *fb)</div><div class="ttdoc">Closes a Framebuffer object, freeing all resources associated with it.</div></div>
<div class="ttc" id="anative__window_8h_html"><div class="ttname"><a href="native__window_8h.html">native_window.h</a></div><div class="ttdoc">Native window (NWindow) wrapper object, used for presenting images to the display (or other sinks).</div></div>
<div class="ttc" id="astructFramebuffer_html"><div class="ttname"><a href="structFramebuffer.html">Framebuffer</a></div><div class="ttdoc">Framebuffer structure.</div><div class="ttdef"><b>Definition</b> framebuffer.h:45</div></div>
<div class="ttc" id="astructNWindow_html"><div class="ttname"><a href="structNWindow.html">NWindow</a></div><div class="ttdoc">Native window structure.</div><div class="ttdef"><b>Definition</b> native_window.h:17</div></div>
<div class="ttc" id="astructNvMap_html"><div class="ttname"><a href="structNvMap.html">NvMap</a></div><div class="ttdef"><b>Definition</b> map.h:4</div></div>
<div class="ttc" id="atypes_8h_html_ad1be2721625a17f1be47fac918032afe"><div class="ttname"><a href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a></div><div class="ttdeci">u32 Result</div><div class="ttdoc">Function error code result type.</div><div class="ttdef"><b>Definition</b> types.h:44</div></div>
<div class="ttc" id="atypes_8h_html_afaa62991928fb9fb18ff0db62a040aba"><div class="ttname"><a href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a></div><div class="ttdeci">uint32_t u32</div><div class="ttdoc">32-bit unsigned integer.</div><div class="ttdef"><b>Definition</b> types.h:21</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>