SDLU/docs/html/_mouse_8hpp_source.html
2021-04-24 02:01:36 +02:00

148 lines
15 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">
<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"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SDL Utility: C:/Users/Robert/source/repos/SDLU/include/structures/Mouse.hpp 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>
<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">SDL Utility
</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>
</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_mouse_8hpp_source.html',''); initResizable(); });
/* @license-end */
</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">Mouse.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_mouse_8hpp.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; </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_vector2_8hpp.html">structures/Vector2.hpp</a>&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_render_window_8hpp.html">graphics/RenderWindow.hpp</a>&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<a class="code" href="_util_8hpp.html#ad0494d8896dbc587136819e261afdc91">SDLU_BEGIN</a></div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="class_mouse.html"> 16</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_mouse.html">Mouse</a></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;{</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_mouse.html#a2189c95ac90001266b97105c25085270"> 22</a></span>&#160; <span class="keyword">enum class</span> <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Button</a> {</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270a945d5e233cf7d6240f6b783b36a374ff">Left</a> = 1,</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270a92b09c7c48c520c3c55e497875da437c">Right</a> = 2,</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270ab1ca34f82e83c52b010f86955f264e05">Middle</a> = 3,</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270aac8e5aa1a680bd64e6fb9313db5b4428">XButton1</a> = 4,</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270a7af9d9a16f813c045a3dbe8068a13f4d">XButton2</a> = 5</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; };</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="class_mouse.html#a07faafbfb9f42a45b155fdd0c98a027b"> 35</a></span>&#160; <span class="keyword">static</span> <a class="code" href="_util_8hpp.html#add440eff171ea5f55cb00c4a9ab8672d">Uint32</a> <a class="code" href="class_mouse.html#a07faafbfb9f42a45b155fdd0c98a027b">GetButtonState</a>();</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_mouse.html#a03c02466c8713509e0bed311e55520a6"> 43</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_mouse.html#a03c02466c8713509e0bed311e55520a6">IsButtonDown</a>(<a class="code" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Button</a> button);</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="class_mouse.html#ab18b92fb5eb5fecf6918d0dcbe696a2a"> 50</a></span>&#160; <span class="keyword">static</span> <a class="code" href="struct_vector2.html">Vector2i</a> <a class="code" href="class_mouse.html#ab18b92fb5eb5fecf6918d0dcbe696a2a">GetPosition</a>();</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_mouse.html#ad92df5406cb8d429314fa17eaa40ce1e"> 58</a></span>&#160; <span class="keyword">static</span> <a class="code" href="struct_vector2.html">Vector2i</a> <a class="code" href="class_mouse.html#ad92df5406cb8d429314fa17eaa40ce1e">GetPosition</a>(<span class="keyword">const</span> <a class="code" href="class_render_window.html">RenderWindow</a>&amp; relativeTo);</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_mouse.html#adf9d858fb89d23a9227602c169b209f5"> 65</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_mouse.html#adf9d858fb89d23a9227602c169b209f5">SetPosition</a>(<span class="keyword">const</span> <a class="code" href="struct_vector2.html">Vector2i</a>&amp; position);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_mouse.html#aaa904df11f52c1484e0630144c6e4e0e"> 73</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_mouse.html#aaa904df11f52c1484e0630144c6e4e0e">SetPosition</a>(<span class="keyword">const</span> <a class="code" href="struct_vector2.html">Vector2i</a>&amp; position, <span class="keyword">const</span> <a class="code" href="class_render_window.html">RenderWindow</a>&amp; relativeTo);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;};</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;SDLU_END</div>
<div class="ttc" id="a_render_window_8hpp_html"><div class="ttname"><a href="_render_window_8hpp.html">RenderWindow.hpp</a></div><div class="ttdoc">A wrapper around SDL_Window and SDL_Renderer.</div></div>
<div class="ttc" id="a_util_8hpp_html_ad0494d8896dbc587136819e261afdc91"><div class="ttname"><a href="_util_8hpp.html#ad0494d8896dbc587136819e261afdc91">SDLU_BEGIN</a></div><div class="ttdeci">#define SDLU_BEGIN</div><div class="ttdef"><b>Definition:</b> Util.hpp:32</div></div>
<div class="ttc" id="a_util_8hpp_html_add440eff171ea5f55cb00c4a9ab8672d"><div class="ttname"><a href="_util_8hpp.html#add440eff171ea5f55cb00c4a9ab8672d">Uint32</a></div><div class="ttdeci">uint32_t Uint32</div><div class="ttdef"><b>Definition:</b> Util.hpp:23</div></div>
<div class="ttc" id="a_vector2_8hpp_html"><div class="ttname"><a href="_vector2_8hpp.html">Vector2.hpp</a></div><div class="ttdoc">Provides a structure for simple vector calculations.</div></div>
<div class="ttc" id="aclass_mouse_html"><div class="ttname"><a href="class_mouse.html">Mouse</a></div><div class="ttdoc">A static class that contains/handles data about mouse position and button states.</div><div class="ttdef"><b>Definition:</b> Mouse.hpp:17</div></div>
<div class="ttc" id="aclass_mouse_html_a03c02466c8713509e0bed311e55520a6"><div class="ttname"><a href="class_mouse.html#a03c02466c8713509e0bed311e55520a6">Mouse::IsButtonDown</a></div><div class="ttdeci">static bool IsButtonDown(Button button)</div><div class="ttdoc">Checks if a specific button is pressed.</div></div>
<div class="ttc" id="aclass_mouse_html_a07faafbfb9f42a45b155fdd0c98a027b"><div class="ttname"><a href="class_mouse.html#a07faafbfb9f42a45b155fdd0c98a027b">Mouse::GetButtonState</a></div><div class="ttdeci">static Uint32 GetButtonState()</div><div class="ttdoc">Returns the current mouse button state.</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270">Mouse::Button</a></div><div class="ttdeci">Button</div><div class="ttdoc">Mouse buttons.</div><div class="ttdef"><b>Definition:</b> Mouse.hpp:22</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270a7af9d9a16f813c045a3dbe8068a13f4d"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270a7af9d9a16f813c045a3dbe8068a13f4d">Mouse::Button::XButton2</a></div><div class="ttdeci">@ XButton2</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270a92b09c7c48c520c3c55e497875da437c"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270a92b09c7c48c520c3c55e497875da437c">Mouse::Button::Right</a></div><div class="ttdeci">@ Right</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270a945d5e233cf7d6240f6b783b36a374ff"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270a945d5e233cf7d6240f6b783b36a374ff">Mouse::Button::Left</a></div><div class="ttdeci">@ Left</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270aac8e5aa1a680bd64e6fb9313db5b4428"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270aac8e5aa1a680bd64e6fb9313db5b4428">Mouse::Button::XButton1</a></div><div class="ttdeci">@ XButton1</div></div>
<div class="ttc" id="aclass_mouse_html_a2189c95ac90001266b97105c25085270ab1ca34f82e83c52b010f86955f264e05"><div class="ttname"><a href="class_mouse.html#a2189c95ac90001266b97105c25085270ab1ca34f82e83c52b010f86955f264e05">Mouse::Button::Middle</a></div><div class="ttdeci">@ Middle</div></div>
<div class="ttc" id="aclass_mouse_html_aaa904df11f52c1484e0630144c6e4e0e"><div class="ttname"><a href="class_mouse.html#aaa904df11f52c1484e0630144c6e4e0e">Mouse::SetPosition</a></div><div class="ttdeci">static void SetPosition(const Vector2i &amp;position, const RenderWindow &amp;relativeTo)</div><div class="ttdoc">Sets current relative position of the mouse.</div></div>
<div class="ttc" id="aclass_mouse_html_ab18b92fb5eb5fecf6918d0dcbe696a2a"><div class="ttname"><a href="class_mouse.html#ab18b92fb5eb5fecf6918d0dcbe696a2a">Mouse::GetPosition</a></div><div class="ttdeci">static Vector2i GetPosition()</div><div class="ttdoc">Gets the absolute position of the mouse.</div></div>
<div class="ttc" id="aclass_mouse_html_ad92df5406cb8d429314fa17eaa40ce1e"><div class="ttname"><a href="class_mouse.html#ad92df5406cb8d429314fa17eaa40ce1e">Mouse::GetPosition</a></div><div class="ttdeci">static Vector2i GetPosition(const RenderWindow &amp;relativeTo)</div><div class="ttdoc">Gets current relative position of the mouse.</div></div>
<div class="ttc" id="aclass_mouse_html_adf9d858fb89d23a9227602c169b209f5"><div class="ttname"><a href="class_mouse.html#adf9d858fb89d23a9227602c169b209f5">Mouse::SetPosition</a></div><div class="ttdeci">static void SetPosition(const Vector2i &amp;position)</div><div class="ttdoc">Sets the absolute position of the mouse.</div></div>
<div class="ttc" id="aclass_render_window_html"><div class="ttname"><a href="class_render_window.html">RenderWindow</a></div><div class="ttdoc">A class that handles window related functionality.</div><div class="ttdef"><b>Definition:</b> RenderWindow.hpp:29</div></div>
<div class="ttc" id="astruct_vector2_html"><div class="ttname"><a href="struct_vector2.html">Vector2</a></div><div class="ttdoc">A struct to handle basic 2D vector operations.</div><div class="ttdef"><b>Definition:</b> Vector2.hpp:22</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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_ae392c548e81aebab219dc0867f8ff50.html">structures</a></li><li class="navelem"><a class="el" href="_mouse_8hpp.html">Mouse.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>