sfmlinstaller

sfmlinstaller Mercurial Source Tree


Root/windows/doc/html/classsf_1_1Window.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
        <!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.htm"><span>Main Page</span></a></li>
      <li><a href="modules.htm"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
      <li><a href="files.htm"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.htm"><span>Class List</span></a></li>
      <li><a href="classes.htm"><span>Class Index</span></a></li>
      <li><a href="hierarchy.htm"><span>Class Hierarchy</span></a></li>
      <li><a href="functions.htm"><span>Class Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Window.htm">Window</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="#pri-static-methods">Static Private Member Functions</a> |
<a href="classsf_1_1Window-members.htm">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sf::Window Class Reference<div class="ingroups"><a class="el" href="group__window.htm">Window module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
 
<p><a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">Window</a> that serves as a target for OpenGL rendering. 
 <a href="classsf_1_1Window.htm#details">More...</a></p>
 
<p><code>#include <<a class="el" href="Window_2Window_8hpp_source.htm">Window.hpp</a>></code></p>
<div class="dynheader">
Inheritance diagram for sf::Window:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classsf_1_1Window.png" usemap="#sf::Window_map" alt=""/>
  <map id="sf::Window_map" name="sf::Window_map">
<area href="classsf_1_1GlResource.htm" title="Base class for classes that require an OpenGL context." alt="sf::GlResource" shape="rect" coords="0,0,113,24"/>
<area href="classsf_1_1NonCopyable.htm" title="Utility class that makes any derived class non-copyable." alt="sf::NonCopyable" shape="rect" coords="123,0,236,24"/>
<area href="classsf_1_1RenderWindow.htm" title="Window that can serve as a target for 2D drawing." alt="sf::RenderWindow" shape="rect" coords="61,112,174,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5359122166b4dc492c3d25caf08ccfc4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a5359122166b4dc492c3d25caf08ccfc4">Window</a> ()</td></tr>
<tr class="memdesc:a5359122166b4dc492c3d25caf08ccfc4"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor.  <a href="#a5359122166b4dc492c3d25caf08ccfc4"></a><br/></td></tr>
<tr class="separator:a5359122166b4dc492c3d25caf08ccfc4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1bee771baecbae6d357871929dc042a2"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a1bee771baecbae6d357871929dc042a2">Window</a> (<a class="el" href="classsf_1_1VideoMode.htm">VideoMode</a> mode, const <a class="el" href="classsf_1_1String.htm">String</a> &title, Uint32 style=Style::Default, const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> &settings=<a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>())</td></tr>
<tr class="memdesc:a1bee771baecbae6d357871929dc042a2"><td class="mdescLeft"> </td><td class="mdescRight">Construct a new window.  <a href="#a1bee771baecbae6d357871929dc042a2"></a><br/></td></tr>
<tr class="separator:a1bee771baecbae6d357871929dc042a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6d60912633bff9d33cf3ade4e0201de4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a6d60912633bff9d33cf3ade4e0201de4">Window</a> (WindowHandle handle, const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> &settings=<a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>())</td></tr>
<tr class="memdesc:a6d60912633bff9d33cf3ade4e0201de4"><td class="mdescLeft"> </td><td class="mdescRight">Construct the window from an existing control.  <a href="#a6d60912633bff9d33cf3ade4e0201de4"></a><br/></td></tr>
<tr class="separator:a6d60912633bff9d33cf3ade4e0201de4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac30eb6ea5f5594204944d09d4bd69a97"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#ac30eb6ea5f5594204944d09d4bd69a97">~Window</a> ()</td></tr>
<tr class="memdesc:ac30eb6ea5f5594204944d09d4bd69a97"><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#ac30eb6ea5f5594204944d09d4bd69a97"></a><br/></td></tr>
<tr class="separator:ac30eb6ea5f5594204944d09d4bd69a97"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30e6edf2162f8dbff61023b9de5d961d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a30e6edf2162f8dbff61023b9de5d961d">create</a> (<a class="el" href="classsf_1_1VideoMode.htm">VideoMode</a> mode, const <a class="el" href="classsf_1_1String.htm">String</a> &title, Uint32 style=Style::Default, const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> &settings=<a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>())</td></tr>
<tr class="memdesc:a30e6edf2162f8dbff61023b9de5d961d"><td class="mdescLeft"> </td><td class="mdescRight">Create (or recreate) the window.  <a href="#a30e6edf2162f8dbff61023b9de5d961d"></a><br/></td></tr>
<tr class="separator:a30e6edf2162f8dbff61023b9de5d961d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acf67483dc21f08d65c8835b3889b41b2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#acf67483dc21f08d65c8835b3889b41b2">create</a> (WindowHandle handle, const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> &settings=<a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>())</td></tr>
<tr class="memdesc:acf67483dc21f08d65c8835b3889b41b2"><td class="mdescLeft"> </td><td class="mdescRight">Create (or recreate) the window from an existing control.  <a href="#acf67483dc21f08d65c8835b3889b41b2"></a><br/></td></tr>
<tr class="separator:acf67483dc21f08d65c8835b3889b41b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a99d1e030387b0c26f5995670504fe7b5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a99d1e030387b0c26f5995670504fe7b5">close</a> ()</td></tr>
<tr class="memdesc:a99d1e030387b0c26f5995670504fe7b5"><td class="mdescLeft"> </td><td class="mdescRight">Close the window and destroy all the attached resources.  <a href="#a99d1e030387b0c26f5995670504fe7b5"></a><br/></td></tr>
<tr class="separator:a99d1e030387b0c26f5995670504fe7b5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5aa9c2b2b0e51d3423c2b66c80253337"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a5aa9c2b2b0e51d3423c2b66c80253337">isOpen</a> () const </td></tr>
<tr class="memdesc:a5aa9c2b2b0e51d3423c2b66c80253337"><td class="mdescLeft"> </td><td class="mdescRight">Tell whether or not the window is open.  <a href="#a5aa9c2b2b0e51d3423c2b66c80253337"></a><br/></td></tr>
<tr class="separator:a5aa9c2b2b0e51d3423c2b66c80253337"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a9d5c15facf25ad4d9b2b30caa0a2db"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a5a9d5c15facf25ad4d9b2b30caa0a2db">getSettings</a> () const </td></tr>
<tr class="memdesc:a5a9d5c15facf25ad4d9b2b30caa0a2db"><td class="mdescLeft"> </td><td class="mdescRight">Get the settings of the OpenGL context of the window.  <a href="#a5a9d5c15facf25ad4d9b2b30caa0a2db"></a><br/></td></tr>
<tr class="separator:a5a9d5c15facf25ad4d9b2b30caa0a2db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a338e996585faf82e93069858e3b531b7"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7">pollEvent</a> (<a class="el" href="classsf_1_1Event.htm">Event</a> &event)</td></tr>
<tr class="memdesc:a338e996585faf82e93069858e3b531b7"><td class="mdescLeft"> </td><td class="mdescRight">Pop the event on top of the event queue, if any, and return it.  <a href="#a338e996585faf82e93069858e3b531b7"></a><br/></td></tr>
<tr class="separator:a338e996585faf82e93069858e3b531b7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaf02ab64fbc1d374eef3696df54137bc"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#aaf02ab64fbc1d374eef3696df54137bc">waitEvent</a> (<a class="el" href="classsf_1_1Event.htm">Event</a> &event)</td></tr>
<tr class="memdesc:aaf02ab64fbc1d374eef3696df54137bc"><td class="mdescLeft"> </td><td class="mdescRight">Wait for an event and return it.  <a href="#aaf02ab64fbc1d374eef3696df54137bc"></a><br/></td></tr>
<tr class="separator:aaf02ab64fbc1d374eef3696df54137bc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2e6bc12612ea289afea8268fe37c8678"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.htm">Vector2i</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a2e6bc12612ea289afea8268fe37c8678">getPosition</a> () const </td></tr>
<tr class="memdesc:a2e6bc12612ea289afea8268fe37c8678"><td class="mdescLeft"> </td><td class="mdescRight">Get the position of the window.  <a href="#a2e6bc12612ea289afea8268fe37c8678"></a><br/></td></tr>
<tr class="separator:a2e6bc12612ea289afea8268fe37c8678"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6c4078bfbf61c29bfc4b4732ce764f17"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a6c4078bfbf61c29bfc4b4732ce764f17">setPosition</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2i</a> &position)</td></tr>
<tr class="memdesc:a6c4078bfbf61c29bfc4b4732ce764f17"><td class="mdescLeft"> </td><td class="mdescRight">Change the position of the window on screen.  <a href="#a6c4078bfbf61c29bfc4b4732ce764f17"></a><br/></td></tr>
<tr class="separator:a6c4078bfbf61c29bfc4b4732ce764f17"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad2b55a731ba1680fe67292991ef1610e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.htm">Vector2u</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#ad2b55a731ba1680fe67292991ef1610e">getSize</a> () const </td></tr>
<tr class="memdesc:ad2b55a731ba1680fe67292991ef1610e"><td class="mdescLeft"> </td><td class="mdescRight">Get the size of the rendering region of the window.  <a href="#ad2b55a731ba1680fe67292991ef1610e"></a><br/></td></tr>
<tr class="separator:ad2b55a731ba1680fe67292991ef1610e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad6513418bb2963347cd1819a1810524d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#ad6513418bb2963347cd1819a1810524d">setSize</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2u</a> size)</td></tr>
<tr class="memdesc:ad6513418bb2963347cd1819a1810524d"><td class="mdescLeft"> </td><td class="mdescRight">Change the size of the rendering region of the window.  <a href="#ad6513418bb2963347cd1819a1810524d"></a><br/></td></tr>
<tr class="separator:ad6513418bb2963347cd1819a1810524d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b3f3513bb6be90f5cd456c20b5fd5fa"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a3b3f3513bb6be90f5cd456c20b5fd5fa">setTitle</a> (const <a class="el" href="classsf_1_1String.htm">String</a> &title)</td></tr>
<tr class="memdesc:a3b3f3513bb6be90f5cd456c20b5fd5fa"><td class="mdescLeft"> </td><td class="mdescRight">Change the title of the window.  <a href="#a3b3f3513bb6be90f5cd456c20b5fd5fa"></a><br/></td></tr>
<tr class="separator:a3b3f3513bb6be90f5cd456c20b5fd5fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63af61e026fba08e3153fd013620bcc0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a63af61e026fba08e3153fd013620bcc0">setIcon</a> (unsigned int width, unsigned int height, const Uint8 *pixels)</td></tr>
<tr class="memdesc:a63af61e026fba08e3153fd013620bcc0"><td class="mdescLeft"> </td><td class="mdescRight">Change the window's icon.  <a href="#a63af61e026fba08e3153fd013620bcc0"></a><br/></td></tr>
<tr class="separator:a63af61e026fba08e3153fd013620bcc0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a160f7f11a207603d7e99ce606e749703"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a160f7f11a207603d7e99ce606e749703">setVisible</a> (bool visible)</td></tr>
<tr class="memdesc:a160f7f11a207603d7e99ce606e749703"><td class="mdescLeft"> </td><td class="mdescRight">Show or hide the window.  <a href="#a160f7f11a207603d7e99ce606e749703"></a><br/></td></tr>
<tr class="separator:a160f7f11a207603d7e99ce606e749703"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59041c4556e0351048f8aff366034f61"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a59041c4556e0351048f8aff366034f61">setVerticalSyncEnabled</a> (bool enabled)</td></tr>
<tr class="memdesc:a59041c4556e0351048f8aff366034f61"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable vertical synchronization.  <a href="#a59041c4556e0351048f8aff366034f61"></a><br/></td></tr>
<tr class="separator:a59041c4556e0351048f8aff366034f61"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aad3991c25e0a83afbb4d62febf9b7b14"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#aad3991c25e0a83afbb4d62febf9b7b14">setMouseCursorVisible</a> (bool visible)</td></tr>
<tr class="memdesc:aad3991c25e0a83afbb4d62febf9b7b14"><td class="mdescLeft"> </td><td class="mdescRight">Show or hide the mouse cursor.  <a href="#aad3991c25e0a83afbb4d62febf9b7b14"></a><br/></td></tr>
<tr class="separator:aad3991c25e0a83afbb4d62febf9b7b14"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef9f2b14c10ecba8a8df95dd51c5bb73"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#aef9f2b14c10ecba8a8df95dd51c5bb73">setKeyRepeatEnabled</a> (bool enabled)</td></tr>
<tr class="memdesc:aef9f2b14c10ecba8a8df95dd51c5bb73"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable automatic key-repeat.  <a href="#aef9f2b14c10ecba8a8df95dd51c5bb73"></a><br/></td></tr>
<tr class="separator:aef9f2b14c10ecba8a8df95dd51c5bb73"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af4322d315baf93405bf0d5087ad5e784"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#af4322d315baf93405bf0d5087ad5e784">setFramerateLimit</a> (unsigned int limit)</td></tr>
<tr class="memdesc:af4322d315baf93405bf0d5087ad5e784"><td class="mdescLeft"> </td><td class="mdescRight">Limit the framerate to a maximum fixed frequency.  <a href="#af4322d315baf93405bf0d5087ad5e784"></a><br/></td></tr>
<tr class="separator:af4322d315baf93405bf0d5087ad5e784"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa45b8f54e29a6f59f1fc7ee66b2fab68"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#aa45b8f54e29a6f59f1fc7ee66b2fab68">setJoystickThreshold</a> (float threshold)</td></tr>
<tr class="memdesc:aa45b8f54e29a6f59f1fc7ee66b2fab68"><td class="mdescLeft"> </td><td class="mdescRight">Change the joystick threshold.  <a href="#aa45b8f54e29a6f59f1fc7ee66b2fab68"></a><br/></td></tr>
<tr class="separator:aa45b8f54e29a6f59f1fc7ee66b2fab68"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a17ccf8ece0ce0bf2f1e6698bcfa29731"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a17ccf8ece0ce0bf2f1e6698bcfa29731">setActive</a> (bool active=true) const </td></tr>
<tr class="memdesc:a17ccf8ece0ce0bf2f1e6698bcfa29731"><td class="mdescLeft"> </td><td class="mdescRight">Activate or deactivate the window as the current target for OpenGL rendering.  <a href="#a17ccf8ece0ce0bf2f1e6698bcfa29731"></a><br/></td></tr>
<tr class="separator:a17ccf8ece0ce0bf2f1e6698bcfa29731"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adabf839cb103ac96cfc82f781638772a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#adabf839cb103ac96cfc82f781638772a">display</a> ()</td></tr>
<tr class="memdesc:adabf839cb103ac96cfc82f781638772a"><td class="mdescLeft"> </td><td class="mdescRight">Display on screen what has been rendered to the window so far.  <a href="#adabf839cb103ac96cfc82f781638772a"></a><br/></td></tr>
<tr class="separator:adabf839cb103ac96cfc82f781638772a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a26368e7162229f8637c34d80ab0f138e"><td class="memItemLeft" align="right" valign="top">WindowHandle </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a26368e7162229f8637c34d80ab0f138e">getSystemHandle</a> () const </td></tr>
<tr class="memdesc:a26368e7162229f8637c34d80ab0f138e"><td class="mdescLeft"> </td><td class="mdescRight">Get the OS-specific handle of the window.  <a href="#a26368e7162229f8637c34d80ab0f138e"></a><br/></td></tr>
<tr class="separator:a26368e7162229f8637c34d80ab0f138e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a106633b9be49b27f83d4712689b493eb"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a106633b9be49b27f83d4712689b493eb">onCreate</a> ()</td></tr>
<tr class="memdesc:a106633b9be49b27f83d4712689b493eb"><td class="mdescLeft"> </td><td class="mdescRight">Function called after the window has been created.  <a href="#a106633b9be49b27f83d4712689b493eb"></a><br/></td></tr>
<tr class="separator:a106633b9be49b27f83d4712689b493eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10f567a387da7b49f417f73321fcf64d"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Window.htm#a10f567a387da7b49f417f73321fcf64d">onResize</a> ()</td></tr>
<tr class="memdesc:a10f567a387da7b49f417f73321fcf64d"><td class="mdescLeft"> </td><td class="mdescRight">Function called after the window has been resized.  <a href="#a10f567a387da7b49f417f73321fcf64d"></a><br/></td></tr>
<tr class="separator:a10f567a387da7b49f417f73321fcf64d"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr class="memitem:ae0efa7935241644608ca32ba47b22a33"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1GlResource.htm#ae0efa7935241644608ca32ba47b22a33">ensureGlContext</a> ()</td></tr>
<tr class="memdesc:ae0efa7935241644608ca32ba47b22a33"><td class="mdescLeft"> </td><td class="mdescRight">Make sure that a valid OpenGL context exists in the current thread.  <a href="#ae0efa7935241644608ca32ba47b22a33"></a><br/></td></tr>
<tr class="separator:ae0efa7935241644608ca32ba47b22a33"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">Window</a> that serves as a target for OpenGL rendering. </p>
<p><a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">sf::Window</a> is the main class of the <a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">Window</a> module.</p>
<p>It defines an OS window that is able to receive an OpenGL rendering.</p>
<p>A <a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">sf::Window</a> can create its own new window, or be embedded into an already existing control using the create(handle) function. This can be useful for embedding an OpenGL rendering area into a view which is part of a bigger GUI with existing windows, controls, etc. It can also serve as embedding an OpenGL rendering area into a window created by another (probably richer) GUI library like Qt or wxWidgets.</p>
<p>The <a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">sf::Window</a> class provides a simple interface for manipulating the window: move, resize, show/hide, control mouse cursor, etc. It also provides event handling through its <a class="el" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7" title="Pop the event on top of the event queue, if any, and return it.">pollEvent()</a> and <a class="el" href="classsf_1_1Window.htm#aaf02ab64fbc1d374eef3696df54137bc" title="Wait for an event and return it.">waitEvent()</a> functions.</p>
<p>Note that OpenGL experts can pass their own parameters (antialiasing level, bits for the depth and stencil buffers, etc.) to the OpenGL context attached to the window, with the <a class="el" href="structsf_1_1ContextSettings.htm" title="Structure defining the settings of the OpenGL context attached to a window.">sf::ContextSettings</a> structure which is passed as an optional argument when creating the window.</p>
<p>Usage example: </p>
<div class="fragment"><div class="line"><span class="comment">// Declare and create a new window</span></div>
<div class="line"><a class="code" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">sf::Window</a> window(<a class="code" href="classsf_1_1VideoMode.htm" title="VideoMode defines a video mode (width, height, bpp)">sf::VideoMode</a>(800, 600), <span class="stringliteral">"SFML window"</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Limit the framerate to 60 frames per second (this step is optional)</span></div>
<div class="line">window.<a class="code" href="classsf_1_1Window.htm#af4322d315baf93405bf0d5087ad5e784" title="Limit the framerate to a maximum fixed frequency.">setFramerateLimit</a>(60);</div>
<div class="line"></div>
<div class="line"><span class="comment">// The main loop - ends as soon as the window is closed</span></div>
<div class="line"><span class="keywordflow">while</span> (window.<a class="code" href="classsf_1_1Window.htm#a5aa9c2b2b0e51d3423c2b66c80253337" title="Tell whether or not the window is open.">isOpen</a>())</div>
<div class="line">{</div>
<div class="line">   <span class="comment">// Event processing</span></div>
<div class="line">   <a class="code" href="classsf_1_1Event.htm" title="Defines a system event and its parameters.">sf::Event</a> event;</div>
<div class="line">   <span class="keywordflow">while</span> (window.<a class="code" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7" title="Pop the event on top of the event queue, if any, and return it.">pollEvent</a>(event))</div>
<div class="line">   {</div>
<div class="line">       <span class="comment">// Request for closing the window</span></div>
<div class="line">       <span class="keywordflow">if</span> (event.<a class="code" href="classsf_1_1Event.htm#adf2f8044f713fd9d6019077b0d1ffe0a" title="Type of the event.">type</a> == <a class="code" href="classsf_1_1Event.htm#af41fa9ed45c02449030699f671331d4aa316e4212e083f1dce79efd8d9e9c0a95" title="The window requested to be closed (no data)">sf::Event::Closed</a>)</div>
<div class="line">           window.<a class="code" href="classsf_1_1Window.htm#a99d1e030387b0c26f5995670504fe7b5" title="Close the window and destroy all the attached resources.">close</a>();</div>
<div class="line">   }</div>
<div class="line"></div>
<div class="line">   <span class="comment">// Activate the window for OpenGL rendering</span></div>
<div class="line">   window.<a class="code" href="classsf_1_1Window.htm#a17ccf8ece0ce0bf2f1e6698bcfa29731" title="Activate or deactivate the window as the current target for OpenGL rendering.">setActive</a>();</div>
<div class="line"></div>
<div class="line">   <span class="comment">// OpenGL drawing commands go here...</span></div>
<div class="line"></div>
<div class="line">   <span class="comment">// End the current frame and display its contents on screen</span></div>
<div class="line">   window.<a class="code" href="classsf_1_1Window.htm#adabf839cb103ac96cfc82f781638772a" title="Display on screen what has been rendered to the window so far.">display</a>();</div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="Window_2Window_8hpp_source.htm#l00057">57</a> of file <a class="el" href="Window_2Window_8hpp_source.htm">Window/Window.hpp</a>.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a5359122166b4dc492c3d25caf08ccfc4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Window::Window </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Default constructor. </p>
<p>This constructor doesn't actually create the window, use the other constructors or call "create" to do so. </p>
 
</div>
</div>
<a class="anchor" id="a1bee771baecbae6d357871929dc042a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Window::Window </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsf_1_1VideoMode.htm">VideoMode</a> </td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsf_1_1String.htm">String</a> & </td>
          <td class="paramname"><em>title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Uint32 </td>
          <td class="paramname"><em>style</em> = <code>Style::Default</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> & </td>
          <td class="paramname"><em>settings</em> = <code><a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Construct a new window. </p>
<p>This constructor creates the window with the size and pixel depth defined in <em>mode</em>. An optional style can be passed to customize the look and behaviour of the window (borders, title bar, resizable, closable, ...). If <em>style</em> contains Style::Fullscreen, then <em>mode</em> must be a valid video mode.</p>
<p>The fourth parameter is an optional structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td>Video mode to use (defines the width, height and depth of the rendering area of the window) </td></tr>
    <tr><td class="paramname">title</td><td>Title of the window </td></tr>
    <tr><td class="paramname">style</td><td><a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">Window</a> style </td></tr>
    <tr><td class="paramname">settings</td><td>Additional settings for the underlying OpenGL context </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="a6d60912633bff9d33cf3ade4e0201de4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sf::Window::Window </td>
          <td>(</td>
          <td class="paramtype">WindowHandle </td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> & </td>
          <td class="paramname"><em>settings</em> = <code><a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
 
<p>Construct the window from an existing control. </p>
<p>Use this constructor if you want to create an OpenGL rendering area into an already existing control.</p>
<p>The second parameter is an optional structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>Platform-specific handle of the control </td></tr>
    <tr><td class="paramname">settings</td><td>Additional settings for the underlying OpenGL context </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="ac30eb6ea5f5594204944d09d4bd69a97"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual sf::Window::~Window </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
 
<p>Destructor. </p>
<p>Closes the window and free all the resources attached to it. </p>
 
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a99d1e030387b0c26f5995670504fe7b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Close the window and destroy all the attached resources. </p>
<p>After calling this function, the <a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">sf::Window</a> instance remains valid and you can call <a class="el" href="classsf_1_1Window.htm#a30e6edf2162f8dbff61023b9de5d961d" title="Create (or recreate) the window.">create()</a> to recreate the window. All other functions such as <a class="el" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7" title="Pop the event on top of the event queue, if any, and return it.">pollEvent()</a> or <a class="el" href="classsf_1_1Window.htm#adabf839cb103ac96cfc82f781638772a" title="Display on screen what has been rendered to the window so far.">display()</a> will still work (i.e. you don't have to test <a class="el" href="classsf_1_1Window.htm#a5aa9c2b2b0e51d3423c2b66c80253337" title="Tell whether or not the window is open.">isOpen()</a> every time), and will have no effect on closed windows. </p>
 
</div>
</div>
<a class="anchor" id="a30e6edf2162f8dbff61023b9de5d961d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsf_1_1VideoMode.htm">VideoMode</a> </td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsf_1_1String.htm">String</a> & </td>
          <td class="paramname"><em>title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Uint32 </td>
          <td class="paramname"><em>style</em> = <code>Style::Default</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> & </td>
          <td class="paramname"><em>settings</em> = <code><a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Create (or recreate) the window. </p>
<p>If the window was already created, it closes it first. If <em>style</em> contains Style::Fullscreen, then <em>mode</em> must be a valid video mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td>Video mode to use (defines the width, height and depth of the rendering area of the window) </td></tr>
    <tr><td class="paramname">title</td><td>Title of the window </td></tr>
    <tr><td class="paramname">style</td><td><a class="el" href="classsf_1_1Window.htm" title="Window that serves as a target for OpenGL rendering.">Window</a> style </td></tr>
    <tr><td class="paramname">settings</td><td>Additional settings for the underlying OpenGL context </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="acf67483dc21f08d65c8835b3889b41b2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::create </td>
          <td>(</td>
          <td class="paramtype">WindowHandle </td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a> & </td>
          <td class="paramname"><em>settings</em> = <code><a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Create (or recreate) the window from an existing control. </p>
<p>Use this function if you want to create an OpenGL rendering area into an already existing control. If the window was already created, it closes it first.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>Platform-specific handle of the control </td></tr>
    <tr><td class="paramname">settings</td><td>Additional settings for the underlying OpenGL context </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="adabf839cb103ac96cfc82f781638772a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::display </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Display on screen what has been rendered to the window so far. </p>
<p>This function is typically called after all OpenGL rendering has been done for the current frame, in order to show it on screen. </p>
 
</div>
</div>
<a class="anchor" id="a2e6bc12612ea289afea8268fe37c8678"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Vector2.htm">Vector2i</a> sf::Window::getPosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get the position of the window. </p>
<dl class="section return"><dt>Returns</dt><dd>Position of the window, in pixels</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#a6c4078bfbf61c29bfc4b4732ce764f17" title="Change the position of the window on screen.">setPosition</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="a5a9d5c15facf25ad4d9b2b30caa0a2db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structsf_1_1ContextSettings.htm">ContextSettings</a>& sf::Window::getSettings </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get the settings of the OpenGL context of the window. </p>
<p>Note that these settings may be different from what was passed to the constructor or the <a class="el" href="classsf_1_1Window.htm#a30e6edf2162f8dbff61023b9de5d961d" title="Create (or recreate) the window.">create()</a> function, if one or more settings were not supported. In this case, SFML chose the closest match.</p>
<dl class="section return"><dt>Returns</dt><dd>Structure containing the OpenGL context settings </dd></dl>
 
</div>
</div>
<a class="anchor" id="ad2b55a731ba1680fe67292991ef1610e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Vector2.htm">Vector2u</a> sf::Window::getSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get the size of the rendering region of the window. </p>
<p>The size doesn't include the titlebar and borders of the window.</p>
<dl class="section return"><dt>Returns</dt><dd>Size in pixels</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#ad6513418bb2963347cd1819a1810524d" title="Change the size of the rendering region of the window.">setSize</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="a26368e7162229f8637c34d80ab0f138e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WindowHandle sf::Window::getSystemHandle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get the OS-specific handle of the window. </p>
<p>The type of the returned handle is sf::WindowHandle, which is a typedef to the handle type defined by the OS. You shouldn't need to use this function, unless you have very specific stuff to implement that SFML doesn't support, or implement a temporary workaround until a bug is fixed.</p>
<dl class="section return"><dt>Returns</dt><dd>System handle of the window </dd></dl>
 
</div>
</div>
<a class="anchor" id="a5aa9c2b2b0e51d3423c2b66c80253337"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sf::Window::isOpen </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Tell whether or not the window is open. </p>
<p>This function returns whether or not the window exists. Note that a hidden window (setVisible(false)) is open (therefore this function would return true).</p>
<dl class="section return"><dt>Returns</dt><dd>True if the window is open, false if it has been closed </dd></dl>
 
</div>
</div>
<a class="anchor" id="a106633b9be49b27f83d4712689b493eb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sf::Window::onCreate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
 
<p>Function called after the window has been created. </p>
<p>This function is called so that derived classes can perform their own specific initialization as soon as the window is created. </p>
 
<p>Reimplemented in <a class="el" href="classsf_1_1RenderWindow.htm#a5bef0040b0fa87bed9fbd459c980d53a">sf::RenderWindow</a>.</p>
 
</div>
</div>
<a class="anchor" id="a10f567a387da7b49f417f73321fcf64d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sf::Window::onResize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
 
<p>Function called after the window has been resized. </p>
<p>This function is called so that derived classes can perform custom actions when the size of the window changes. </p>
 
<p>Reimplemented in <a class="el" href="classsf_1_1RenderWindow.htm#a5c85fe482313562d33ffd24a194b6fef">sf::RenderWindow</a>.</p>
 
</div>
</div>
<a class="anchor" id="a338e996585faf82e93069858e3b531b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sf::Window::pollEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsf_1_1Event.htm">Event</a> & </td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Pop the event on top of the event queue, if any, and return it. </p>
<p>This function is not blocking: if there's no pending event then it will return false and leave <em>event</em> unmodified. Note that more than one event may be present in the event queue, thus you should always call this function in a loop to make sure that you process every pending event. </p>
<div class="fragment"><div class="line"><a class="code" href="classsf_1_1Event.htm" title="Defines a system event and its parameters.">sf::Event</a> event;</div>
<div class="line"><span class="keywordflow">while</span> (window.<a class="code" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7" title="Pop the event on top of the event queue, if any, and return it.">pollEvent</a>(event))</div>
<div class="line">{</div>
<div class="line">   <span class="comment">// process event...</span></div>
<div class="line">}</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td><a class="el" href="classsf_1_1Event.htm" title="Defines a system event and its parameters.">Event</a> to be returned</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if an event was returned, or false if the event queue was empty</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#aaf02ab64fbc1d374eef3696df54137bc" title="Wait for an event and return it.">waitEvent</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="a17ccf8ece0ce0bf2f1e6698bcfa29731"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sf::Window::setActive </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>active</em> = <code>true</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Activate or deactivate the window as the current target for OpenGL rendering. </p>
<p>A window is active only on the current thread, if you want to make it active on another thread you have to deactivate it on the previous thread first if it was active. Only one window can be active on a thread at a time, thus the window previously active (if any) automatically gets deactivated.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">active</td><td>True to activate, false to deactivate</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if operation was successful, false otherwise </dd></dl>
 
</div>
</div>
<a class="anchor" id="af4322d315baf93405bf0d5087ad5e784"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setFramerateLimit </td>
          <td>(</td>
          <td class="paramtype">unsigned int </td>
          <td class="paramname"><em>limit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Limit the framerate to a maximum fixed frequency. </p>
<p>If a limit is set, the window will use a small delay after each call to <a class="el" href="classsf_1_1Window.htm#adabf839cb103ac96cfc82f781638772a" title="Display on screen what has been rendered to the window so far.">display()</a> to ensure that the current frame lasted long enough to match the framerate limit. SFML will try to match the given limit as much as it can, but since it internally uses sf::sleep, whose precision depends on the underlying OS, the results may be a little unprecise as well (for example, you can get 65 FPS when requesting 60).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">limit</td><td>Framerate limit, in frames per seconds (use 0 to disable limit) </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="a63af61e026fba08e3153fd013620bcc0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setIcon </td>
          <td>(</td>
          <td class="paramtype">unsigned int </td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int </td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Uint8 * </td>
          <td class="paramname"><em>pixels</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Change the window's icon. </p>
<p><em>pixels</em> must be an array of <em>width</em> x <em>height</em> pixels in 32-bits RGBA format.</p>
<p>The OS default icon is used by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>Icon's width, in pixels </td></tr>
    <tr><td class="paramname">height</td><td>Icon's height, in pixels </td></tr>
    <tr><td class="paramname">pixels</td><td>Pointer to the array of pixels in memory</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#a3b3f3513bb6be90f5cd456c20b5fd5fa" title="Change the title of the window.">setTitle</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="aa45b8f54e29a6f59f1fc7ee66b2fab68"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setJoystickThreshold </td>
          <td>(</td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>threshold</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Change the joystick threshold. </p>
<p>The joystick threshold is the value below which no JoystickMoved event will be generated.</p>
<p>The threshold value is 0.1 by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">threshold</td><td>New threshold, in the range [0, 100] </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="aef9f2b14c10ecba8a8df95dd51c5bb73"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setKeyRepeatEnabled </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Enable or disable automatic key-repeat. </p>
<p>If key repeat is enabled, you will receive repeated KeyPressed events while keeping a key pressed. If it is disabled, you will only get a single event when the key is pressed.</p>
<p>Key repeat is enabled by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enabled</td><td>True to enable, false to disable </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="aad3991c25e0a83afbb4d62febf9b7b14"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setMouseCursorVisible </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>visible</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Show or hide the mouse cursor. </p>
<p>The mouse cursor is visible by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">visible</td><td>True to show the mouse cursor, false to hide it </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="a6c4078bfbf61c29bfc4b4732ce764f17"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setPosition </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2i</a> & </td>
          <td class="paramname"><em>position</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Change the position of the window on screen. </p>
<p>This function only works for top-level windows (i.e. it will be ignored for windows created from the handle of a child window/control).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">position</td><td>New position, in pixels</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#a2e6bc12612ea289afea8268fe37c8678" title="Get the position of the window.">getPosition</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="ad6513418bb2963347cd1819a1810524d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setSize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2u</a> </td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Change the size of the rendering region of the window. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>New size, in pixels</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#ad2b55a731ba1680fe67292991ef1610e" title="Get the size of the rendering region of the window.">getSize</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="a3b3f3513bb6be90f5cd456c20b5fd5fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setTitle </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1String.htm">String</a> & </td>
          <td class="paramname"><em>title</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Change the title of the window. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">title</td><td>New title</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#a63af61e026fba08e3153fd013620bcc0" title="Change the window's icon.">setIcon</a> </dd></dl>
 
</div>
</div>
<a class="anchor" id="a59041c4556e0351048f8aff366034f61"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setVerticalSyncEnabled </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Enable or disable vertical synchronization. </p>
<p>Activating vertical synchronization will limit the number of frames displayed to the refresh rate of the monitor. This can avoid some visual artifacts, and limit the framerate to a good value (but not constant across different computers).</p>
<p>Vertical synchronization is disabled by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enabled</td><td>True to enable v-sync, false to deactivate it </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="a160f7f11a207603d7e99ce606e749703"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Window::setVisible </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>visible</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Show or hide the window. </p>
<p>The window is shown by default.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">visible</td><td>True to show the window, false to hide it </td></tr>
  </table>
  </dd>
</dl>
 
</div>
</div>
<a class="anchor" id="aaf02ab64fbc1d374eef3696df54137bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sf::Window::waitEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsf_1_1Event.htm">Event</a> & </td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Wait for an event and return it. </p>
<p>This function is blocking: if there's no pending event then it will wait until an event is received. After this function returns (and no error occured), the <em>event</em> object is always valid and filled properly. This function is typically used when you have a thread that is dedicated to events handling: you want to make this thread sleep as long as no new event is received. </p>
<div class="fragment"><div class="line"><a class="code" href="classsf_1_1Event.htm" title="Defines a system event and its parameters.">sf::Event</a> event;</div>
<div class="line"><span class="keywordflow">if</span> (window.<a class="code" href="classsf_1_1Window.htm#aaf02ab64fbc1d374eef3696df54137bc" title="Wait for an event and return it.">waitEvent</a>(event))</div>
<div class="line">{</div>
<div class="line">   <span class="comment">// process event...</span></div>
<div class="line">}</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td><a class="el" href="classsf_1_1Event.htm" title="Defines a system event and its parameters.">Event</a> to be returned</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>False if any error occured</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1Window.htm#a338e996585faf82e93069858e3b531b7" title="Pop the event on top of the event queue, if any, and return it.">pollEvent</a> </dd></dl>
 
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Window_2Window_8hpp_source.htm">Window/Window.hpp</a></li>
</ul>
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                Copyright � Laurent Gomila  :: 
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a>  :: 
            </div>
        </div>
    <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
  ga('create', 'UA-41898676-1', 'srchub.org');
  ga('send', 'pageview');
Page rendered in 0.85393s using 11 queries.
Source at commit tip created 11 years 11 months ago.
By Nathan Adams, Initial commit

Archive Download this file

Branches

Tags

Page rendered in 0.85393s using 11 queries.