176 lines
14 KiB
HTML
176 lines
14 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>SFML - Simple and Fast Multimedia Library</title>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
|
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="search/search.css" />
|
|
<link rel="stylesheet" type="text/css" href="searchOverrides.css" />
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_search(); });
|
|
/* @license-end */
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">SFML 3.0.0</span>
|
|
</div>
|
|
</div>
|
|
<div id="content">
|
|
<div>
|
|
<!-- Generated by Doxygen 1.12.0 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="topics.html"><span>Topics</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div id="doc-content">
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){ initResizable(false); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">SFML Documentation </div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><h1><a class="anchor" id="welcome"></a>
|
|
Welcome</h1>
|
|
<p>Welcome to the official SFML documentation. Here you will find a detailed view of all the SFML classes and functions. <br />
|
|
If you are looking for tutorials, you can visit the official website at <a href="https://www.sfml-dev.org/">www.sfml-dev.org</a>.</p>
|
|
<h1><a class="anchor" id="example"></a>
|
|
Short example</h1>
|
|
<p>Here is a short example, to show you how simple it is to use SFML:</p>
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="Audio_8hpp.html">SFML/Audio.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="Graphics_8hpp.html">SFML/Graphics.hpp</a>></span></div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main()</div>
|
|
<div class="line">{</div>
|
|
<div class="line"> <span class="comment">// Create the main window</span></div>
|
|
<div class="line"> <a class="code hl_class" href="classsf_1_1RenderWindow.html">sf::RenderWindow</a> window(<a class="code hl_class" href="classsf_1_1VideoMode.html">sf::VideoMode</a>({800, 600}), <span class="stringliteral">"SFML window"</span>);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Load a sprite to display</span></div>
|
|
<div class="line"> <span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Texture.html">sf::Texture</a> texture(<span class="stringliteral">"cute_image.jpg"</span>);</div>
|
|
<div class="line"> <a class="code hl_class" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite(texture);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Create a graphical text to display</span></div>
|
|
<div class="line"> <span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Font.html">sf::Font</a> font(<span class="stringliteral">"arial.ttf"</span>);</div>
|
|
<div class="line"> <a class="code hl_class" href="classsf_1_1Text.html">sf::Text</a> text(font, <span class="stringliteral">"Hello SFML"</span>, 50);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Load a music to play</span></div>
|
|
<div class="line"> <a class="code hl_class" href="classsf_1_1Music.html">sf::Music</a> music(<span class="stringliteral">"nice_music.ogg"</span>);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Play the music</span></div>
|
|
<div class="line"> music.play();</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Start the game loop</span></div>
|
|
<div class="line"> <span class="keywordflow">while</span> (window.<a class="code hl_function" href="classsf_1_1WindowBase.html#aa43559822564ef958dc664a90c57cba0">isOpen</a>())</div>
|
|
<div class="line"> {</div>
|
|
<div class="line"> <span class="comment">// Process events</span></div>
|
|
<div class="line"> <span class="keywordflow">while</span> (<span class="keyword">const</span> std::optional event = window.<a class="code hl_function" href="classsf_1_1WindowBase.html#a6090926b477e9d0a83854b94b9e1fd35">pollEvent</a>())</div>
|
|
<div class="line"> {</div>
|
|
<div class="line"> <span class="comment">// Close window: exit</span></div>
|
|
<div class="line"> <span class="keywordflow">if</span> (event->is<<a class="code hl_struct" href="structsf_1_1Event_1_1Closed.html">sf::Event::Closed</a>>())</div>
|
|
<div class="line"> window.<a class="code hl_function" href="classsf_1_1Window.html#ab1d808a3682db8d113d67354bcbd717d">close</a>();</div>
|
|
<div class="line"> }</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Clear screen</span></div>
|
|
<div class="line"> window.<a class="code hl_function" href="classsf_1_1RenderTarget.html#aee353fc2cd35edf0747e710301af3e4c">clear</a>();</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Draw the sprite</span></div>
|
|
<div class="line"> window.<a class="code hl_function" href="classsf_1_1RenderTarget.html#a12417a3bcc245c41d957b29583556f39">draw</a>(sprite);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Draw the string</span></div>
|
|
<div class="line"> window.<a class="code hl_function" href="classsf_1_1RenderTarget.html#a12417a3bcc245c41d957b29583556f39">draw</a>(text);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> <span class="comment">// Update the window</span></div>
|
|
<div class="line"> window.<a class="code hl_function" href="classsf_1_1Window.html#adabf839cb103ac96cfc82f781638772a">display</a>();</div>
|
|
<div class="line"> }</div>
|
|
<div class="line">}</div>
|
|
<div class="ttc" id="aAudio_8hpp_html"><div class="ttname"><a href="Audio_8hpp.html">Audio.hpp</a></div></div>
|
|
<div class="ttc" id="aGraphics_8hpp_html"><div class="ttname"><a href="Graphics_8hpp.html">Graphics.hpp</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Font_html"><div class="ttname"><a href="classsf_1_1Font.html">sf::Font</a></div><div class="ttdoc">Class for loading and manipulating character fonts.</div><div class="ttdef"><b>Definition</b> <a href="Font_8hpp_source.html#l00063">Font.hpp:64</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Music_html"><div class="ttname"><a href="classsf_1_1Music.html">sf::Music</a></div><div class="ttdoc">Streamed music played from an audio file.</div><div class="ttdef"><b>Definition</b> <a href="Music_8hpp_source.html#l00052">Music.hpp:53</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1RenderTarget_html_a12417a3bcc245c41d957b29583556f39"><div class="ttname"><a href="classsf_1_1RenderTarget.html#a12417a3bcc245c41d957b29583556f39">sf::RenderTarget::draw</a></div><div class="ttdeci">void draw(const Drawable &drawable, const RenderStates &states=RenderStates::Default)</div><div class="ttdoc">Draw a drawable object to the render target.</div></div>
|
|
<div class="ttc" id="aclasssf_1_1RenderTarget_html_aee353fc2cd35edf0747e710301af3e4c"><div class="ttname"><a href="classsf_1_1RenderTarget.html#aee353fc2cd35edf0747e710301af3e4c">sf::RenderTarget::clear</a></div><div class="ttdeci">void clear(Color color=Color::Black)</div><div class="ttdoc">Clear the entire target with a single color.</div></div>
|
|
<div class="ttc" id="aclasssf_1_1RenderWindow_html"><div class="ttname"><a href="classsf_1_1RenderWindow.html">sf::RenderWindow</a></div><div class="ttdoc">Window that can serve as a target for 2D drawing.</div><div class="ttdef"><b>Definition</b> <a href="RenderWindow_8hpp_source.html#l00054">RenderWindow.hpp:55</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Sprite_html"><div class="ttname"><a href="classsf_1_1Sprite.html">sf::Sprite</a></div><div class="ttdoc">Drawable representation of a texture, with its own transformations, color, etc.</div><div class="ttdef"><b>Definition</b> <a href="Sprite_8hpp_source.html#l00050">Sprite.hpp:51</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Text_html"><div class="ttname"><a href="classsf_1_1Text.html">sf::Text</a></div><div class="ttdoc">Graphical text that can be drawn to a render target.</div><div class="ttdef"><b>Definition</b> <a href="Text_8hpp_source.html#l00056">Text.hpp:57</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Texture_html"><div class="ttname"><a href="classsf_1_1Texture.html">sf::Texture</a></div><div class="ttdoc">Image living on the graphics card that can be used for drawing.</div><div class="ttdef"><b>Definition</b> <a href="Texture_8hpp_source.html#l00055">Texture.hpp:56</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1VideoMode_html"><div class="ttname"><a href="classsf_1_1VideoMode.html">sf::VideoMode</a></div><div class="ttdoc">VideoMode defines a video mode (size, bpp)</div><div class="ttdef"><b>Definition</b> <a href="VideoMode_8hpp_source.html#l00043">VideoMode.hpp:44</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1WindowBase_html_a6090926b477e9d0a83854b94b9e1fd35"><div class="ttname"><a href="classsf_1_1WindowBase.html#a6090926b477e9d0a83854b94b9e1fd35">sf::WindowBase::pollEvent</a></div><div class="ttdeci">std::optional< Event > pollEvent()</div><div class="ttdoc">Pop the next event from the front of the FIFO event queue, if any, and return it.</div></div>
|
|
<div class="ttc" id="aclasssf_1_1WindowBase_html_aa43559822564ef958dc664a90c57cba0"><div class="ttname"><a href="classsf_1_1WindowBase.html#aa43559822564ef958dc664a90c57cba0">sf::WindowBase::isOpen</a></div><div class="ttdeci">bool isOpen() const</div><div class="ttdoc">Tell whether or not the window is open.</div></div>
|
|
<div class="ttc" id="aclasssf_1_1Window_html_ab1d808a3682db8d113d67354bcbd717d"><div class="ttname"><a href="classsf_1_1Window.html#ab1d808a3682db8d113d67354bcbd717d">sf::Window::close</a></div><div class="ttdeci">void close() override</div><div class="ttdoc">Close the window and destroy all the attached resources.</div></div>
|
|
<div class="ttc" id="aclasssf_1_1Window_html_adabf839cb103ac96cfc82f781638772a"><div class="ttname"><a href="classsf_1_1Window.html#adabf839cb103ac96cfc82f781638772a">sf::Window::display</a></div><div class="ttdeci">void display()</div><div class="ttdoc">Display on screen what has been rendered to the window so far.</div></div>
|
|
<div class="ttc" id="astructsf_1_1Event_1_1Closed_html"><div class="ttname"><a href="structsf_1_1Event_1_1Closed.html">sf::Event::Closed</a></div><div class="ttdoc">Closed event subtype.</div><div class="ttdef"><b>Definition</b> <a href="Event_8hpp_source.html#l00053">Event.hpp:54</a></div></div>
|
|
</div><!-- fragment --> </div></div><!-- PageDoc -->
|
|
<a href="doxygen_crawl.html"></a>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br />
|
|
Copyright © Laurent Gomila ::
|
|
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|