Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > bf9e3bc1aec7873c087fb2ccd927873f > files > 136

sdl2-docs-2.0.10-1.mga7.noarch.rpm

<!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.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: SDL_timer.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<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">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<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');
/* @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><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">SDL_timer.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="SDL__stdinc_8h_source.html">SDL_stdinc.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="SDL__error_8h_source.html">SDL_error.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="begin__code_8h_source.html">begin_code.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="close__code_8h_source.html">close_code.h</a>&quot;</code><br />
</div>
<p><a href="SDL__timer_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a5cc109e24ba0c46f6becb28353cd8921"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a5cc109e24ba0c46f6becb28353cd8921">SDL_TICKS_PASSED</a>(A,  B)&#160;&#160;&#160;((Sint32)((B) - (A)) &lt;= 0)</td></tr>
<tr class="memdesc:a5cc109e24ba0c46f6becb28353cd8921"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare SDL ticks values, and return true if A has passed B.  <a href="#a5cc109e24ba0c46f6becb28353cd8921">More...</a><br /></td></tr>
<tr class="separator:a5cc109e24ba0c46f6becb28353cd8921"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a3c5c867db975d245e4a82fcf0cd7de80"><td class="memItemLeft" align="right" valign="top">typedef Uint32(SDLCALL *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a3c5c867db975d245e4a82fcf0cd7de80">SDL_TimerCallback</a>) (Uint32 interval, void *param)</td></tr>
<tr class="separator:a3c5c867db975d245e4a82fcf0cd7de80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a412e8ff8a6c89615ba8f9486b292213a"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a></td></tr>
<tr class="separator:a412e8ff8a6c89615ba8f9486b292213a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0b9bc71d6287e0ffafdc3419760fe2b3"><td class="memItemLeft" align="right" valign="top">DECLSPEC Uint32 SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a0b9bc71d6287e0ffafdc3419760fe2b3">SDL_GetTicks</a> (void)</td></tr>
<tr class="memdesc:a0b9bc71d6287e0ffafdc3419760fe2b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of milliseconds since the SDL library initialization.  <a href="#a0b9bc71d6287e0ffafdc3419760fe2b3">More...</a><br /></td></tr>
<tr class="separator:a0b9bc71d6287e0ffafdc3419760fe2b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dbeb63c4f0564811a4adf3938808977"><td class="memItemLeft" align="right" valign="top"><a id="a2dbeb63c4f0564811a4adf3938808977"></a>
DECLSPEC Uint64 SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a2dbeb63c4f0564811a4adf3938808977">SDL_GetPerformanceCounter</a> (void)</td></tr>
<tr class="memdesc:a2dbeb63c4f0564811a4adf3938808977"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current value of the high resolution counter. <br /></td></tr>
<tr class="separator:a2dbeb63c4f0564811a4adf3938808977"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a507ebea12e31dacc9f85f7d9febe0efb"><td class="memItemLeft" align="right" valign="top"><a id="a507ebea12e31dacc9f85f7d9febe0efb"></a>
DECLSPEC Uint64 SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a507ebea12e31dacc9f85f7d9febe0efb">SDL_GetPerformanceFrequency</a> (void)</td></tr>
<tr class="memdesc:a507ebea12e31dacc9f85f7d9febe0efb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the count per second of the high resolution counter. <br /></td></tr>
<tr class="separator:a507ebea12e31dacc9f85f7d9febe0efb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8050b95373b95249064467592ab4e21"><td class="memItemLeft" align="right" valign="top"><a id="ae8050b95373b95249064467592ab4e21"></a>
DECLSPEC void SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#ae8050b95373b95249064467592ab4e21">SDL_Delay</a> (Uint32 ms)</td></tr>
<tr class="memdesc:ae8050b95373b95249064467592ab4e21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait a specified number of milliseconds before returning. <br /></td></tr>
<tr class="separator:ae8050b95373b95249064467592ab4e21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56ceea49587e3fa5796b2e4bf85603b8"><td class="memItemLeft" align="right" valign="top">DECLSPEC <a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a> SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#a56ceea49587e3fa5796b2e4bf85603b8">SDL_AddTimer</a> (Uint32 interval, <a class="el" href="SDL__timer_8h.html#a3c5c867db975d245e4a82fcf0cd7de80">SDL_TimerCallback</a> callback, void *param)</td></tr>
<tr class="memdesc:a56ceea49587e3fa5796b2e4bf85603b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a new timer to the pool of timers already running.  <a href="#a56ceea49587e3fa5796b2e4bf85603b8">More...</a><br /></td></tr>
<tr class="separator:a56ceea49587e3fa5796b2e4bf85603b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe8d418e59a24ae6ad820b92137ab9b2"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_bool SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__timer_8h.html#afe8d418e59a24ae6ad820b92137ab9b2">SDL_RemoveTimer</a> (<a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a> id)</td></tr>
<tr class="memdesc:afe8d418e59a24ae6ad820b92137ab9b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a timer knowing its ID.  <a href="#afe8d418e59a24ae6ad820b92137ab9b2">More...</a><br /></td></tr>
<tr class="separator:afe8d418e59a24ae6ad820b92137ab9b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header for the SDL time management routines. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a5cc109e24ba0c46f6becb28353cd8921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cc109e24ba0c46f6becb28353cd8921">&#9670;&nbsp;</a></span>SDL_TICKS_PASSED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SDL_TICKS_PASSED</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">A, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">B&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((Sint32)((B) - (A)) &lt;= 0)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare SDL ticks values, and return true if A has passed B. </p>
<p>e.g. if you want to wait 100 ms, you could do this: Uint32 timeout = <a class="el" href="SDL__timer_8h.html#a0b9bc71d6287e0ffafdc3419760fe2b3" title="Get the number of milliseconds since the SDL library initialization.">SDL_GetTicks()</a> + 100; while (!SDL_TICKS_PASSED(<a class="el" href="SDL__timer_8h.html#a0b9bc71d6287e0ffafdc3419760fe2b3" title="Get the number of milliseconds since the SDL library initialization.">SDL_GetTicks()</a>, timeout)) { ... do work until timeout has elapsed } </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a3c5c867db975d245e4a82fcf0cd7de80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c5c867db975d245e4a82fcf0cd7de80">&#9670;&nbsp;</a></span>SDL_TimerCallback</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function prototype for the timer callback function.</p>
<p>The callback function is passed the current timer interval and returns the next timer interval. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled. If the callback returns 0, the periodic alarm is cancelled. </p>

</div>
</div>
<a id="a412e8ff8a6c89615ba8f9486b292213a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a412e8ff8a6c89615ba8f9486b292213a">&#9670;&nbsp;</a></span>SDL_TimerID</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Definition of the timer ID type. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a56ceea49587e3fa5796b2e4bf85603b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56ceea49587e3fa5796b2e4bf85603b8">&#9670;&nbsp;</a></span>SDL_AddTimer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC <a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a> SDLCALL SDL_AddTimer </td>
          <td>(</td>
          <td class="paramtype">Uint32&#160;</td>
          <td class="paramname"><em>interval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="SDL__timer_8h.html#a3c5c867db975d245e4a82fcf0cd7de80">SDL_TimerCallback</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>param</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a new timer to the pool of timers already running. </p>
<dl class="section return"><dt>Returns</dt><dd>A timer ID, or 0 when an error occurs. </dd></dl>

</div>
</div>
<a id="a0b9bc71d6287e0ffafdc3419760fe2b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b9bc71d6287e0ffafdc3419760fe2b3">&#9670;&nbsp;</a></span>SDL_GetTicks()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC Uint32 SDLCALL SDL_GetTicks </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the number of milliseconds since the SDL library initialization. </p>
<dl class="section note"><dt>Note</dt><dd>This value wraps if the program runs for more than ~49 days. </dd></dl>

</div>
</div>
<a id="afe8d418e59a24ae6ad820b92137ab9b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe8d418e59a24ae6ad820b92137ab9b2">&#9670;&nbsp;</a></span>SDL_RemoveTimer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="SDL__timer_8h.html#a412e8ff8a6c89615ba8f9486b292213a">SDL_TimerID</a>&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove a timer knowing its ID. </p>
<dl class="section return"><dt>Returns</dt><dd>A boolean value indicating success or failure.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>It is not safe to remove a timer multiple times. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- 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.8.15
</small></address>
</body>
</html>