1202 lines
80 KiB
HTML
1202 lines
80 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;"/>
|
||
|
<meta charset="utf-8"/>
|
||
|
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
|
||
|
<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>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="banner-container">
|
||
|
<div id="banner">
|
||
|
<span id="sfml">SFML 2.5.1</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div id="content">
|
||
|
<!-- Generated by Doxygen 1.8.14 -->
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
||
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
||
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
||
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
||
|
<li><a href="functions.html"><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_1Texture.html">Texture</a></li> </ul>
|
||
|
</div>
|
||
|
</div><!-- top -->
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#pub-types">Public Types</a> |
|
||
|
<a href="#pub-methods">Public Member Functions</a> |
|
||
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
||
|
<a href="#pri-static-methods">Static Private Member Functions</a> |
|
||
|
<a href="#friends">Friends</a> |
|
||
|
<a href="classsf_1_1Texture-members.html">List of all members</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">sf::Texture Class Reference<div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
|
||
|
<p><a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> living on the graphics card that can be used for drawing.
|
||
|
<a href="classsf_1_1Texture.html#details">More...</a></p>
|
||
|
|
||
|
<p><code>#include <<a class="el" href="Texture_8hpp_source.html">Texture.hpp</a>></code></p>
|
||
|
<div class="dynheader">
|
||
|
Inheritance diagram for sf::Texture:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center">
|
||
|
<img src="classsf_1_1Texture.png" usemap="#sf::Texture_map" alt=""/>
|
||
|
<map id="sf::Texture_map" name="sf::Texture_map">
|
||
|
<area href="classsf_1_1GlResource.html" title="Base class for classes that require an OpenGL context. " alt="sf::GlResource" shape="rect" coords="0,0,94,24"/>
|
||
|
</map>
|
||
|
</div></div>
|
||
|
<table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
||
|
Public Types</h2></td></tr>
|
||
|
<tr class="memitem:aa6fd3bbe3c334b3c4428edfb2765a82e"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82e">CoordinateType</a> { <a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82ea69d6228950882e4d68be4ba4dbe7df73">Normalized</a>,
|
||
|
<a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82ea6372f9c3a10203a7a69d8d5da59d82ff">Pixels</a>
|
||
|
}</td></tr>
|
||
|
<tr class="memdesc:aa6fd3bbe3c334b3c4428edfb2765a82e"><td class="mdescLeft"> </td><td class="mdescRight">Types of texture coordinates that can be used for rendering. <a href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82e">More...</a><br /></td></tr>
|
||
|
<tr class="separator:aa6fd3bbe3c334b3c4428edfb2765a82e"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><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:a3e04674853b8533bf981db3173e3a4a7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a3e04674853b8533bf981db3173e3a4a7">Texture</a> ()</td></tr>
|
||
|
<tr class="memdesc:a3e04674853b8533bf981db3173e3a4a7"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a3e04674853b8533bf981db3173e3a4a7">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a3e04674853b8533bf981db3173e3a4a7"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a524855cbf89de3b74be84d385fd229de"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a524855cbf89de3b74be84d385fd229de">Texture</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &copy)</td></tr>
|
||
|
<tr class="memdesc:a524855cbf89de3b74be84d385fd229de"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#a524855cbf89de3b74be84d385fd229de">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a524855cbf89de3b74be84d385fd229de"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a9c5354ad40eb1c5aeeeb21f57ccd7e6c"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a9c5354ad40eb1c5aeeeb21f57ccd7e6c">~Texture</a> ()</td></tr>
|
||
|
<tr class="memdesc:a9c5354ad40eb1c5aeeeb21f57ccd7e6c"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a9c5354ad40eb1c5aeeeb21f57ccd7e6c">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a9c5354ad40eb1c5aeeeb21f57ccd7e6c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a89b4c7d204acf1033c3a1b6e0a3ad0a3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a89b4c7d204acf1033c3a1b6e0a3ad0a3">create</a> (unsigned int width, unsigned int height)</td></tr>
|
||
|
<tr class="memdesc:a89b4c7d204acf1033c3a1b6e0a3ad0a3"><td class="mdescLeft"> </td><td class="mdescRight">Create the texture. <a href="#a89b4c7d204acf1033c3a1b6e0a3ad0a3">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a89b4c7d204acf1033c3a1b6e0a3ad0a3"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a8e1b56eabfe33e2e0e1cb03712c7fcc7"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7">loadFromFile</a> (const std::string &filename, const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &area=<a class="el" href="classsf_1_1Rect.html">IntRect</a>())</td></tr>
|
||
|
<tr class="memdesc:a8e1b56eabfe33e2e0e1cb03712c7fcc7"><td class="mdescLeft"> </td><td class="mdescRight">Load the texture from a file on disk. <a href="#a8e1b56eabfe33e2e0e1cb03712c7fcc7">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a8e1b56eabfe33e2e0e1cb03712c7fcc7"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a2c4adb19dd4cbee0a588eeb85e52a249"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a2c4adb19dd4cbee0a588eeb85e52a249">loadFromMemory</a> (const void *data, std::size_t size, const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &area=<a class="el" href="classsf_1_1Rect.html">IntRect</a>())</td></tr>
|
||
|
<tr class="memdesc:a2c4adb19dd4cbee0a588eeb85e52a249"><td class="mdescLeft"> </td><td class="mdescRight">Load the texture from a file in memory. <a href="#a2c4adb19dd4cbee0a588eeb85e52a249">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a2c4adb19dd4cbee0a588eeb85e52a249"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a786b486a46b1c6d1c16ff4af61ecc601"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a786b486a46b1c6d1c16ff4af61ecc601">loadFromStream</a> (<a class="el" href="classsf_1_1InputStream.html">InputStream</a> &stream, const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &area=<a class="el" href="classsf_1_1Rect.html">IntRect</a>())</td></tr>
|
||
|
<tr class="memdesc:a786b486a46b1c6d1c16ff4af61ecc601"><td class="mdescLeft"> </td><td class="mdescRight">Load the texture from a custom stream. <a href="#a786b486a46b1c6d1c16ff4af61ecc601">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a786b486a46b1c6d1c16ff4af61ecc601"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:abec4567ad9856a3596dc74803f26fba2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2">loadFromImage</a> (const <a class="el" href="classsf_1_1Image.html">Image</a> &image, const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &area=<a class="el" href="classsf_1_1Rect.html">IntRect</a>())</td></tr>
|
||
|
<tr class="memdesc:abec4567ad9856a3596dc74803f26fba2"><td class="mdescLeft"> </td><td class="mdescRight">Load the texture from an image. <a href="#abec4567ad9856a3596dc74803f26fba2">More...</a><br /></td></tr>
|
||
|
<tr class="separator:abec4567ad9856a3596dc74803f26fba2"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a9f86b8cc670c6399c539d4ce07ae5c8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.html">Vector2u</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a9f86b8cc670c6399c539d4ce07ae5c8a">getSize</a> () const</td></tr>
|
||
|
<tr class="memdesc:a9f86b8cc670c6399c539d4ce07ae5c8a"><td class="mdescLeft"> </td><td class="mdescRight">Return the size of the texture. <a href="#a9f86b8cc670c6399c539d4ce07ae5c8a">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a9f86b8cc670c6399c539d4ce07ae5c8a"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a77e18a70de2e525ac5e4a7cd95f614b9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Image.html">Image</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a77e18a70de2e525ac5e4a7cd95f614b9">copyToImage</a> () const</td></tr>
|
||
|
<tr class="memdesc:a77e18a70de2e525ac5e4a7cd95f614b9"><td class="mdescLeft"> </td><td class="mdescRight">Copy the texture pixels to an image. <a href="#a77e18a70de2e525ac5e4a7cd95f614b9">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a77e18a70de2e525ac5e4a7cd95f614b9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ae4eab5c6781316840b0c50ad08370963"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#ae4eab5c6781316840b0c50ad08370963">update</a> (const Uint8 *pixels)</td></tr>
|
||
|
<tr class="memdesc:ae4eab5c6781316840b0c50ad08370963"><td class="mdescLeft"> </td><td class="mdescRight">Update the whole texture from an array of pixels. <a href="#ae4eab5c6781316840b0c50ad08370963">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ae4eab5c6781316840b0c50ad08370963"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a1352d8e16c2aeb4df586ed65dd2c36b9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a1352d8e16c2aeb4df586ed65dd2c36b9">update</a> (const Uint8 *pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)</td></tr>
|
||
|
<tr class="memdesc:a1352d8e16c2aeb4df586ed65dd2c36b9"><td class="mdescLeft"> </td><td class="mdescRight">Update a part of the texture from an array of pixels. <a href="#a1352d8e16c2aeb4df586ed65dd2c36b9">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a1352d8e16c2aeb4df586ed65dd2c36b9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:af9885ca00b74950d60feea28132d9691"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#af9885ca00b74950d60feea28132d9691">update</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &texture)</td></tr>
|
||
|
<tr class="memdesc:af9885ca00b74950d60feea28132d9691"><td class="mdescLeft"> </td><td class="mdescRight">Update a part of this texture from another texture. <a href="#af9885ca00b74950d60feea28132d9691">More...</a><br /></td></tr>
|
||
|
<tr class="separator:af9885ca00b74950d60feea28132d9691"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a89beb474da1da84b5e38c9fc0b441fe4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a89beb474da1da84b5e38c9fc0b441fe4">update</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &texture, unsigned int x, unsigned int y)</td></tr>
|
||
|
<tr class="memdesc:a89beb474da1da84b5e38c9fc0b441fe4"><td class="mdescLeft"> </td><td class="mdescRight">Update a part of this texture from another texture. <a href="#a89beb474da1da84b5e38c9fc0b441fe4">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a89beb474da1da84b5e38c9fc0b441fe4"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a037cdf171af0fb392d07626a44a4ea17"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a037cdf171af0fb392d07626a44a4ea17">update</a> (const <a class="el" href="classsf_1_1Image.html">Image</a> &image)</td></tr>
|
||
|
<tr class="memdesc:a037cdf171af0fb392d07626a44a4ea17"><td class="mdescLeft"> </td><td class="mdescRight">Update the texture from an image. <a href="#a037cdf171af0fb392d07626a44a4ea17">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a037cdf171af0fb392d07626a44a4ea17"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a87f916490b757fe900798eedf3abf3ba"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a87f916490b757fe900798eedf3abf3ba">update</a> (const <a class="el" href="classsf_1_1Image.html">Image</a> &image, unsigned int x, unsigned int y)</td></tr>
|
||
|
<tr class="memdesc:a87f916490b757fe900798eedf3abf3ba"><td class="mdescLeft"> </td><td class="mdescRight">Update a part of the texture from an image. <a href="#a87f916490b757fe900798eedf3abf3ba">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a87f916490b757fe900798eedf3abf3ba"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ad3cceef238f7d5d2108a98dd38c17fc5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#ad3cceef238f7d5d2108a98dd38c17fc5">update</a> (const <a class="el" href="classsf_1_1Window.html">Window</a> &window)</td></tr>
|
||
|
<tr class="memdesc:ad3cceef238f7d5d2108a98dd38c17fc5"><td class="mdescLeft"> </td><td class="mdescRight">Update the texture from the contents of a window. <a href="#ad3cceef238f7d5d2108a98dd38c17fc5">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ad3cceef238f7d5d2108a98dd38c17fc5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a154f246eb8059b602076009ab1cfd175"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a154f246eb8059b602076009ab1cfd175">update</a> (const <a class="el" href="classsf_1_1Window.html">Window</a> &window, unsigned int x, unsigned int y)</td></tr>
|
||
|
<tr class="memdesc:a154f246eb8059b602076009ab1cfd175"><td class="mdescLeft"> </td><td class="mdescRight">Update a part of the texture from the contents of a window. <a href="#a154f246eb8059b602076009ab1cfd175">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a154f246eb8059b602076009ab1cfd175"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a0c3bd6825b9a99714f10d44179d74324"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a0c3bd6825b9a99714f10d44179d74324">setSmooth</a> (bool smooth)</td></tr>
|
||
|
<tr class="memdesc:a0c3bd6825b9a99714f10d44179d74324"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable the smooth filter. <a href="#a0c3bd6825b9a99714f10d44179d74324">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a0c3bd6825b9a99714f10d44179d74324"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a3ebb050b5a71e1d40ba66eb1a060e103"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a3ebb050b5a71e1d40ba66eb1a060e103">isSmooth</a> () const</td></tr>
|
||
|
<tr class="memdesc:a3ebb050b5a71e1d40ba66eb1a060e103"><td class="mdescLeft"> </td><td class="mdescRight">Tell whether the smooth filter is enabled or not. <a href="#a3ebb050b5a71e1d40ba66eb1a060e103">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a3ebb050b5a71e1d40ba66eb1a060e103"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:af8a38872c50a33ff074bd0865db19dd4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#af8a38872c50a33ff074bd0865db19dd4">setSrgb</a> (bool sRgb)</td></tr>
|
||
|
<tr class="memdesc:af8a38872c50a33ff074bd0865db19dd4"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable conversion from sRGB. <a href="#af8a38872c50a33ff074bd0865db19dd4">More...</a><br /></td></tr>
|
||
|
<tr class="separator:af8a38872c50a33ff074bd0865db19dd4"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a9d77ce4f8124abfda96900a6bd53bfe9"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a9d77ce4f8124abfda96900a6bd53bfe9">isSrgb</a> () const</td></tr>
|
||
|
<tr class="memdesc:a9d77ce4f8124abfda96900a6bd53bfe9"><td class="mdescLeft"> </td><td class="mdescRight">Tell whether the texture source is converted from sRGB or not. <a href="#a9d77ce4f8124abfda96900a6bd53bfe9">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a9d77ce4f8124abfda96900a6bd53bfe9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:aaa87d1eff053b9d4d34a24c784a28658"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#aaa87d1eff053b9d4d34a24c784a28658">setRepeated</a> (bool repeated)</td></tr>
|
||
|
<tr class="memdesc:aaa87d1eff053b9d4d34a24c784a28658"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable repeating. <a href="#aaa87d1eff053b9d4d34a24c784a28658">More...</a><br /></td></tr>
|
||
|
<tr class="separator:aaa87d1eff053b9d4d34a24c784a28658"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:af1a1a32ca5c799204b2bea4040df7647"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#af1a1a32ca5c799204b2bea4040df7647">isRepeated</a> () const</td></tr>
|
||
|
<tr class="memdesc:af1a1a32ca5c799204b2bea4040df7647"><td class="mdescLeft"> </td><td class="mdescRight">Tell whether the texture is repeated or not. <a href="#af1a1a32ca5c799204b2bea4040df7647">More...</a><br /></td></tr>
|
||
|
<tr class="separator:af1a1a32ca5c799204b2bea4040df7647"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a7779a75c0324b5faff77602f871710a9"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a7779a75c0324b5faff77602f871710a9">generateMipmap</a> ()</td></tr>
|
||
|
<tr class="memdesc:a7779a75c0324b5faff77602f871710a9"><td class="mdescLeft"> </td><td class="mdescRight">Generate a mipmap using the current texture data. <a href="#a7779a75c0324b5faff77602f871710a9">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a7779a75c0324b5faff77602f871710a9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a80a089b6b19bb09b83012d5f0e6af9ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Texture.html">Texture</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a80a089b6b19bb09b83012d5f0e6af9ba">operator=</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &right)</td></tr>
|
||
|
<tr class="memdesc:a80a089b6b19bb09b83012d5f0e6af9ba"><td class="mdescLeft"> </td><td class="mdescRight">Overload of assignment operator. <a href="#a80a089b6b19bb09b83012d5f0e6af9ba">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a80a089b6b19bb09b83012d5f0e6af9ba"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a9243470c64b7ff0d231e00663e495798"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a9243470c64b7ff0d231e00663e495798">swap</a> (<a class="el" href="classsf_1_1Texture.html">Texture</a> &right)</td></tr>
|
||
|
<tr class="memdesc:a9243470c64b7ff0d231e00663e495798"><td class="mdescLeft"> </td><td class="mdescRight">Swap the contents of this texture with those of another. <a href="#a9243470c64b7ff0d231e00663e495798">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a9243470c64b7ff0d231e00663e495798"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a674b632608747bfc27b53a4935c835b0"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a674b632608747bfc27b53a4935c835b0">getNativeHandle</a> () const</td></tr>
|
||
|
<tr class="memdesc:a674b632608747bfc27b53a4935c835b0"><td class="mdescLeft"> </td><td class="mdescRight">Get the underlying OpenGL handle of the texture. <a href="#a674b632608747bfc27b53a4935c835b0">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a674b632608747bfc27b53a4935c835b0"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
||
|
Static Public Member Functions</h2></td></tr>
|
||
|
<tr class="memitem:ae9a4274e7b95ebf7244d09c7445833b0"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#ae9a4274e7b95ebf7244d09c7445833b0">bind</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> *texture, <a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82e">CoordinateType</a> coordinateType=<a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82ea69d6228950882e4d68be4ba4dbe7df73">Normalized</a>)</td></tr>
|
||
|
<tr class="memdesc:ae9a4274e7b95ebf7244d09c7445833b0"><td class="mdescLeft"> </td><td class="mdescRight">Bind a texture for rendering. <a href="#ae9a4274e7b95ebf7244d09c7445833b0">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ae9a4274e7b95ebf7244d09c7445833b0"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a0bf905d487b104b758549c2e9e20a3fb"><td class="memItemLeft" align="right" valign="top">static unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Texture.html#a0bf905d487b104b758549c2e9e20a3fb">getMaximumSize</a> ()</td></tr>
|
||
|
<tr class="memdesc:a0bf905d487b104b758549c2e9e20a3fb"><td class="mdescLeft"> </td><td class="mdescRight">Get the maximum texture size allowed. <a href="#a0bf905d487b104b758549c2e9e20a3fb">More...</a><br /></td></tr>
|
||
|
<tr class="separator:a0bf905d487b104b758549c2e9e20a3fb"><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:ab171bdaf5eb36789da14b30a846db471"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1GlResource.html#ab171bdaf5eb36789da14b30a846db471">registerContextDestroyCallback</a> (ContextDestroyCallback callback, void *arg)</td></tr>
|
||
|
<tr class="memdesc:ab171bdaf5eb36789da14b30a846db471"><td class="mdescLeft"> </td><td class="mdescRight">Register a function to be called when a context is destroyed. <a href="#ab171bdaf5eb36789da14b30a846db471">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ab171bdaf5eb36789da14b30a846db471"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
||
|
Friends</h2></td></tr>
|
||
|
<tr class="memitem:aee0ad1dafe471596e6d25530d9fbaf0c"><td class="memItemLeft" align="right" valign="top"><a id="aee0ad1dafe471596e6d25530d9fbaf0c"></a>
|
||
|
class </td><td class="memItemRight" valign="bottom"><b>Text</b></td></tr>
|
||
|
<tr class="separator:aee0ad1dafe471596e6d25530d9fbaf0c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a2548fc9744f5e43e0276d5627ca178de"><td class="memItemLeft" align="right" valign="top"><a id="a2548fc9744f5e43e0276d5627ca178de"></a>
|
||
|
class </td><td class="memItemRight" valign="bottom"><b>RenderTexture</b></td></tr>
|
||
|
<tr class="separator:a2548fc9744f5e43e0276d5627ca178de"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:aa5afc6f82b7b587ed5ada4d227ce32aa"><td class="memItemLeft" align="right" valign="top"><a id="aa5afc6f82b7b587ed5ada4d227ce32aa"></a>
|
||
|
class </td><td class="memItemRight" valign="bottom"><b>RenderTarget</b></td></tr>
|
||
|
<tr class="separator:aa5afc6f82b7b587ed5ada4d227ce32aa"><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_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> living on the graphics card that can be used for drawing. </p>
|
||
|
<p><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> stores pixels that can be drawn, with a sprite for example.</p>
|
||
|
<p>A texture lives in the graphics card memory, therefore it is very fast to draw a texture to a render target, or copy a render target to a texture (the graphics card can access both directly).</p>
|
||
|
<p>Being stored in the graphics card memory has some drawbacks. A texture cannot be manipulated as freely as a <a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">sf::Image</a>, you need to prepare the pixels first and then upload them to the texture in a single operation (see <a class="el" href="classsf_1_1Texture.html#ae4eab5c6781316840b0c50ad08370963" title="Update the whole texture from an array of pixels. ">Texture::update</a>).</p>
|
||
|
<p><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> makes it easy to convert from/to <a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">sf::Image</a>, but keep in mind that these calls require transfers between the graphics card and the central memory, therefore they are slow operations.</p>
|
||
|
<p>A texture can be loaded from an image, but also directly from a file/memory/stream. The necessary shortcuts are defined so that you don't need an image first for the most common cases. However, if you want to perform some modifications on the pixels before creating the final texture, you can load your file to a <a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">sf::Image</a>, do whatever you need with the pixels, and then call <a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2" title="Load the texture from an image. ">Texture::loadFromImage</a>.</p>
|
||
|
<p>Since they live in the graphics card memory, the pixels of a texture cannot be accessed without a slow copy first. And they cannot be accessed individually. Therefore, if you need to read the texture's pixels (like for pixel-perfect collisions), it is recommended to store the collision information separately, for example in an array of booleans.</p>
|
||
|
<p>Like <a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">sf::Image</a>, <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> can handle a unique internal representation of pixels, which is RGBA 32 bits. This means that a pixel must be composed of 8 bits red, green, blue and alpha channels – just like a <a class="el" href="classsf_1_1Color.html" title="Utility class for manipulating RGBA colors. ">sf::Color</a>.</p>
|
||
|
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// This example shows the most common use of sf::Texture:</span></div><div class="line"><span class="comment">// drawing a sprite</span></div><div class="line"></div><div class="line"><span class="comment">// Load a texture from a file</span></div><div class="line"><a class="code" href="classsf_1_1Texture.html">sf::Texture</a> texture;</div><div class="line"><span class="keywordflow">if</span> (!texture.<a class="code" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7">loadFromFile</a>(<span class="stringliteral">"texture.png"</span>))</div><div class="line"> <span class="keywordflow">return</span> -1;</div><div class="line"></div><div class="line"><span class="comment">// Assign it to a sprite</span></div><div class="line"><a class="code" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite;</div><div class="line">sprite.<a class="code" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560">setTexture</a>(texture);</div><div class="line"></div><div class="line"><span class="comment">// Draw the textured sprite</span></div><div class="line">window.draw(sprite);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">// This example shows another common use of sf::Texture:</span></div><div class="line"><span class="comment">// streaming real-time data, like video frames</span></div><div class="line"></div><div class="line"><span class="comment">// Create an empty texture</span></div><div class="line"><a class="code" href="classsf_1_1Texture.html">sf::Texture</a> texture;</div><div class="line"><span class="keywordflow">if</span> (!texture.<a class="code" href="classsf_1_1Texture.html#a89b4c7d204acf1033c3a1b6e0a3ad0a3">create</a>(640, 480))</div><div class="line"> <span class="keywordflow">return</span> -1;</div><div class="line"></div><div class="line"><span class="comment">// Create a sprite that will display the texture</span></div><div class="line"><a class="code" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite(texture);</div><div class="line"></div><div class="line"><span class="keywordflow">while</span> (...) <span class="comment">// the main loop</span></div><div class="line">{</div><div class="line"> ...</div><div class="line"></div><div class="line"> <span class="comment">// update the texture</span></div><div class="line"> sf::Uint8* pixels = ...; <span class="comment">// get a fresh chunk of pixels (the next frame of a movie, for example)</span></div><div class="line"> texture.<a class="code" href="classsf_1_1Texture.html#ae4eab5c6781316840b0c50ad08370963">update</a>(pixels);</div><div class="line"></div><div class="line"> <span class="comment">// draw it</span></div><div class="line"> window.draw(sprite);</div><div class="line"></div><div class="line"> ...</div><div class="line">}</div></div><!-- fragment --><p>Like <a class="el" href="classsf_1_1Shader.html" title="Shader class (vertex, geometry and fragment) ">sf::Shader</a> that can be used as a raw OpenGL shader, <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> can also be used directly as a raw texture for custom OpenGL geometry. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Texture.html#ae9a4274e7b95ebf7244d09c7445833b0">sf::Texture::bind</a>(&texture);</div><div class="line">... render OpenGL geometry ...</div><div class="line">sf::Texture::bind(NULL);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a>, <a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">sf::Image</a>, <a class="el" href="classsf_1_1RenderTexture.html" title="Target for off-screen 2D rendering into a texture. ">sf::RenderTexture</a> </dd></dl>
|
||
|
|
||
|
<p class="definition">Definition at line <a class="el" href="Texture_8hpp_source.html#l00048">48</a> of file <a class="el" href="Texture_8hpp_source.html">Texture.hpp</a>.</p>
|
||
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
||
|
<a id="aa6fd3bbe3c334b3c4428edfb2765a82e"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#aa6fd3bbe3c334b3c4428edfb2765a82e">◆ </a></span>CoordinateType</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">enum <a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82e">sf::Texture::CoordinateType</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Types of texture coordinates that can be used for rendering. </p>
|
||
|
<table class="fieldtable">
|
||
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aa6fd3bbe3c334b3c4428edfb2765a82ea69d6228950882e4d68be4ba4dbe7df73"></a>Normalized </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">Texture</a> coordinates in range [0 .. 1]. </p>
|
||
|
</td></tr>
|
||
|
<tr><td class="fieldname"><a id="aa6fd3bbe3c334b3c4428edfb2765a82ea6372f9c3a10203a7a69d8d5da59d82ff"></a>Pixels </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">Texture</a> coordinates in range [0 .. size]. </p>
|
||
|
</td></tr>
|
||
|
</table>
|
||
|
|
||
|
<p class="definition">Definition at line <a class="el" href="Texture_8hpp_source.html#l00056">56</a> of file <a class="el" href="Texture_8hpp_source.html">Texture.hpp</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
||
|
<a id="a3e04674853b8533bf981db3173e3a4a7"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a3e04674853b8533bf981db3173e3a4a7">◆ </a></span>Texture() <span class="overload">[1/2]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">sf::Texture::Texture </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Default constructor. </p>
|
||
|
<p>Creates an empty texture. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a524855cbf89de3b74be84d385fd229de"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a524855cbf89de3b74be84d385fd229de">◆ </a></span>Texture() <span class="overload">[2/2]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">sf::Texture::Texture </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
||
|
<td class="paramname"><em>copy</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Copy constructor. </p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">copy</td><td>instance to copy </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a9c5354ad40eb1c5aeeeb21f57ccd7e6c"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a9c5354ad40eb1c5aeeeb21f57ccd7e6c">◆ </a></span>~Texture()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">sf::Texture::~Texture </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Destructor. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<h2 class="groupheader">Member Function Documentation</h2>
|
||
|
<a id="ae9a4274e7b95ebf7244d09c7445833b0"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ae9a4274e7b95ebf7244d09c7445833b0">◆ </a></span>bind()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static void sf::Texture::bind </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> * </td>
|
||
|
<td class="paramname"><em>texture</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype"><a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82e">CoordinateType</a> </td>
|
||
|
<td class="paramname"><em>coordinateType</em> = <code><a class="el" href="classsf_1_1Texture.html#aa6fd3bbe3c334b3c4428edfb2765a82ea69d6228950882e4d68be4ba4dbe7df73">Normalized</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">static</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Bind a texture for rendering. </p>
|
||
|
<p>This function is not part of the graphics API, it mustn't be used when drawing SFML entities. It must be used only if you mix <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> with OpenGL code.</p>
|
||
|
<div class="fragment"><div class="line"><a class="code" href="classsf_1_1Texture.html">sf::Texture</a> t1, t2;</div><div class="line">...</div><div class="line">sf::Texture::bind(&t1);</div><div class="line"><span class="comment">// draw OpenGL stuff that use t1...</span></div><div class="line"><a class="code" href="classsf_1_1Texture.html#ae9a4274e7b95ebf7244d09c7445833b0">sf::Texture::bind</a>(&t2);</div><div class="line"><span class="comment">// draw OpenGL stuff that use t2...</span></div><div class="line"><a class="code" href="classsf_1_1Texture.html#ae9a4274e7b95ebf7244d09c7445833b0">sf::Texture::bind</a>(NULL);</div><div class="line"><span class="comment">// draw OpenGL stuff that use no texture...</span></div></div><!-- fragment --><p>The <em>coordinateType</em> argument controls how texture coordinates will be interpreted. If Normalized (the default), they must be in range [0 .. 1], which is the default way of handling texture coordinates with OpenGL. If Pixels, they must be given in pixels (range [0 .. size]). This mode is used internally by the graphics classes of SFML, it makes the definition of texture coordinates more intuitive for the high-level API, users don't need to compute normalized values.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">texture</td><td>Pointer to the texture to bind, can be null to use no texture </td></tr>
|
||
|
<tr><td class="paramname">coordinateType</td><td>Type of texture coordinates to use </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a77e18a70de2e525ac5e4a7cd95f614b9"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a77e18a70de2e525ac5e4a7cd95f614b9">◆ </a></span>copyToImage()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="classsf_1_1Image.html">Image</a> sf::Texture::copyToImage </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Copy the texture pixels to an image. </p>
|
||
|
<p>This function performs a slow operation that downloads the texture's pixels from the graphics card and copies them to a new image, potentially applying transformations to pixels if necessary (texture may be padded or flipped).</p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> containing the texture's pixels</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2" title="Load the texture from an image. ">loadFromImage</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a89b4c7d204acf1033c3a1b6e0a3ad0a3"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a89b4c7d204acf1033c3a1b6e0a3ad0a3">◆ </a></span>create()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::create </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></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Create the texture. </p>
|
||
|
<p>If this function fails, the texture is left unchanged.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">width</td><td>Width of the texture </td></tr>
|
||
|
<tr><td class="paramname">height</td><td>Height of the texture</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if creation was successful </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a7779a75c0324b5faff77602f871710a9"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a7779a75c0324b5faff77602f871710a9">◆ </a></span>generateMipmap()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::generateMipmap </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Generate a mipmap using the current texture data. </p>
|
||
|
<p>Mipmaps are pre-computed chains of optimized textures. Each level of texture in a mipmap is generated by halving each of the previous level's dimensions. This is done until the final level has the size of 1x1. The textures generated in this process may make use of more advanced filters which might improve the visual quality of textures when they are applied to objects much smaller than they are. This is known as minification. Because fewer texels (texture elements) have to be sampled from when heavily minified, usage of mipmaps can also improve rendering performance in certain scenarios.</p>
|
||
|
<p>Mipmap generation relies on the necessary OpenGL extension being available. If it is unavailable or generation fails due to another reason, this function will return false. Mipmap data is only valid from the time it is generated until the next time the base level image is modified, at which point this function will have to be called again to regenerate it.</p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if mipmap generation was successful, false if unsuccessful </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a0bf905d487b104b758549c2e9e20a3fb"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a0bf905d487b104b758549c2e9e20a3fb">◆ </a></span>getMaximumSize()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static unsigned int sf::Texture::getMaximumSize </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Get the maximum texture size allowed. </p>
|
||
|
<p>This maximum size is defined by the graphics driver. You can expect a value of 512 pixels for low-end graphics card, and up to 8192 pixels or more for newer hardware.</p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>Maximum size allowed for textures, in pixels </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a674b632608747bfc27b53a4935c835b0"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a674b632608747bfc27b53a4935c835b0">◆ </a></span>getNativeHandle()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">unsigned int sf::Texture::getNativeHandle </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Get the underlying OpenGL handle of the texture. </p>
|
||
|
<p>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>OpenGL handle of the texture or 0 if not yet created </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a9f86b8cc670c6399c539d4ce07ae5c8a"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a9f86b8cc670c6399c539d4ce07ae5c8a">◆ </a></span>getSize()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="classsf_1_1Vector2.html">Vector2u</a> sf::Texture::getSize </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Return the size of the texture. </p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>Size in pixels </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="af1a1a32ca5c799204b2bea4040df7647"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#af1a1a32ca5c799204b2bea4040df7647">◆ </a></span>isRepeated()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::isRepeated </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Tell whether the texture is repeated or not. </p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if repeat mode is enabled, false if it is disabled</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#aaa87d1eff053b9d4d34a24c784a28658" title="Enable or disable repeating. ">setRepeated</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a3ebb050b5a71e1d40ba66eb1a060e103"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a3ebb050b5a71e1d40ba66eb1a060e103">◆ </a></span>isSmooth()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::isSmooth </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Tell whether the smooth filter is enabled or not. </p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if smoothing is enabled, false if it is disabled</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a0c3bd6825b9a99714f10d44179d74324" title="Enable or disable the smooth filter. ">setSmooth</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a9d77ce4f8124abfda96900a6bd53bfe9"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a9d77ce4f8124abfda96900a6bd53bfe9">◆ </a></span>isSrgb()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::isSrgb </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Tell whether the texture source is converted from sRGB or not. </p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if the texture source is converted from sRGB, false if not</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#af8a38872c50a33ff074bd0865db19dd4" title="Enable or disable conversion from sRGB. ">setSrgb</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a8e1b56eabfe33e2e0e1cb03712c7fcc7"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a8e1b56eabfe33e2e0e1cb03712c7fcc7">◆ </a></span>loadFromFile()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::loadFromFile </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const std::string & </td>
|
||
|
<td class="paramname"><em>filename</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
||
|
<td class="paramname"><em>area</em> = <code><a class="el" href="classsf_1_1Rect.html">IntRect</a>()</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Load the texture from a file on disk. </p>
|
||
|
<p>This function is a shortcut for the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Image.html">sf::Image</a> image;</div><div class="line">image.<a class="code" href="classsf_1_1Image.html#a9e4f2aa8e36d0cabde5ed5a4ef80290b">loadFromFile</a>(filename);</div><div class="line">texture.<a class="code" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2">loadFromImage</a>(image, area);</div></div><!-- fragment --><p>The <em>area</em> argument can be used to load only a sub-rectangle of the whole image. If you want the entire image then leave the default value (which is an empty IntRect). If the <em>area</em> rectangle crosses the bounds of the image, it is adjusted to fit the image size.</p>
|
||
|
<p>The maximum size for a texture depends on the graphics driver and can be retrieved with the getMaximumSize function.</p>
|
||
|
<p>If this function fails, the texture is left unchanged.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">filename</td><td>Path of the image file to load </td></tr>
|
||
|
<tr><td class="paramname">area</td><td>Area of the image to load</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if loading was successful</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a2c4adb19dd4cbee0a588eeb85e52a249" title="Load the texture from a file in memory. ">loadFromMemory</a>, <a class="el" href="classsf_1_1Texture.html#a786b486a46b1c6d1c16ff4af61ecc601" title="Load the texture from a custom stream. ">loadFromStream</a>, <a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2" title="Load the texture from an image. ">loadFromImage</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="abec4567ad9856a3596dc74803f26fba2"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#abec4567ad9856a3596dc74803f26fba2">◆ </a></span>loadFromImage()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::loadFromImage </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Image.html">Image</a> & </td>
|
||
|
<td class="paramname"><em>image</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
||
|
<td class="paramname"><em>area</em> = <code><a class="el" href="classsf_1_1Rect.html">IntRect</a>()</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Load the texture from an image. </p>
|
||
|
<p>The <em>area</em> argument can be used to load only a sub-rectangle of the whole image. If you want the entire image then leave the default value (which is an empty IntRect). If the <em>area</em> rectangle crosses the bounds of the image, it is adjusted to fit the image size.</p>
|
||
|
<p>The maximum size for a texture depends on the graphics driver and can be retrieved with the getMaximumSize function.</p>
|
||
|
<p>If this function fails, the texture is left unchanged.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">image</td><td><a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> to load into the texture </td></tr>
|
||
|
<tr><td class="paramname">area</td><td>Area of the image to load</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if loading was successful</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7" title="Load the texture from a file on disk. ">loadFromFile</a>, <a class="el" href="classsf_1_1Texture.html#a2c4adb19dd4cbee0a588eeb85e52a249" title="Load the texture from a file in memory. ">loadFromMemory</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a2c4adb19dd4cbee0a588eeb85e52a249"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a2c4adb19dd4cbee0a588eeb85e52a249">◆ </a></span>loadFromMemory()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::loadFromMemory </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const void * </td>
|
||
|
<td class="paramname"><em>data</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">std::size_t </td>
|
||
|
<td class="paramname"><em>size</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
||
|
<td class="paramname"><em>area</em> = <code><a class="el" href="classsf_1_1Rect.html">IntRect</a>()</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Load the texture from a file in memory. </p>
|
||
|
<p>This function is a shortcut for the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Image.html">sf::Image</a> image;</div><div class="line">image.<a class="code" href="classsf_1_1Image.html#aaa6c7afa5851a51cec6ab438faa7354c">loadFromMemory</a>(data, size);</div><div class="line">texture.<a class="code" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2">loadFromImage</a>(image, area);</div></div><!-- fragment --><p>The <em>area</em> argument can be used to load only a sub-rectangle of the whole image. If you want the entire image then leave the default value (which is an empty IntRect). If the <em>area</em> rectangle crosses the bounds of the image, it is adjusted to fit the image size.</p>
|
||
|
<p>The maximum size for a texture depends on the graphics driver and can be retrieved with the getMaximumSize function.</p>
|
||
|
<p>If this function fails, the texture is left unchanged.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">data</td><td>Pointer to the file data in memory </td></tr>
|
||
|
<tr><td class="paramname">size</td><td>Size of the data to load, in bytes </td></tr>
|
||
|
<tr><td class="paramname">area</td><td>Area of the image to load</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if loading was successful</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7" title="Load the texture from a file on disk. ">loadFromFile</a>, <a class="el" href="classsf_1_1Texture.html#a786b486a46b1c6d1c16ff4af61ecc601" title="Load the texture from a custom stream. ">loadFromStream</a>, <a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2" title="Load the texture from an image. ">loadFromImage</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a786b486a46b1c6d1c16ff4af61ecc601"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a786b486a46b1c6d1c16ff4af61ecc601">◆ </a></span>loadFromStream()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool sf::Texture::loadFromStream </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="classsf_1_1InputStream.html">InputStream</a> & </td>
|
||
|
<td class="paramname"><em>stream</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
||
|
<td class="paramname"><em>area</em> = <code><a class="el" href="classsf_1_1Rect.html">IntRect</a>()</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Load the texture from a custom stream. </p>
|
||
|
<p>This function is a shortcut for the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Image.html">sf::Image</a> image;</div><div class="line">image.<a class="code" href="classsf_1_1Image.html#a21122ded0e8368bb06ed3b9acfbfb501">loadFromStream</a>(stream);</div><div class="line">texture.<a class="code" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2">loadFromImage</a>(image, area);</div></div><!-- fragment --><p>The <em>area</em> argument can be used to load only a sub-rectangle of the whole image. If you want the entire image then leave the default value (which is an empty IntRect). If the <em>area</em> rectangle crosses the bounds of the image, it is adjusted to fit the image size.</p>
|
||
|
<p>The maximum size for a texture depends on the graphics driver and can be retrieved with the getMaximumSize function.</p>
|
||
|
<p>If this function fails, the texture is left unchanged.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">stream</td><td>Source stream to read from </td></tr>
|
||
|
<tr><td class="paramname">area</td><td>Area of the image to load</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>True if loading was successful</dd></dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7" title="Load the texture from a file on disk. ">loadFromFile</a>, <a class="el" href="classsf_1_1Texture.html#a2c4adb19dd4cbee0a588eeb85e52a249" title="Load the texture from a file in memory. ">loadFromMemory</a>, <a class="el" href="classsf_1_1Texture.html#abec4567ad9856a3596dc74803f26fba2" title="Load the texture from an image. ">loadFromImage</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a80a089b6b19bb09b83012d5f0e6af9ba"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a80a089b6b19bb09b83012d5f0e6af9ba">◆ </a></span>operator=()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="classsf_1_1Texture.html">Texture</a>& sf::Texture::operator= </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
||
|
<td class="paramname"><em>right</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Overload of assignment operator. </p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">right</td><td>Instance to assign</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>Reference to self </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="aaa87d1eff053b9d4d34a24c784a28658"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#aaa87d1eff053b9d4d34a24c784a28658">◆ </a></span>setRepeated()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::setRepeated </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">bool </td>
|
||
|
<td class="paramname"><em>repeated</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Enable or disable repeating. </p>
|
||
|
<p>Repeating is involved when using texture coordinates outside the texture rectangle [0, 0, width, height]. In this case, if repeat mode is enabled, the whole texture will be repeated as many times as needed to reach the coordinate (for example, if the X texture coordinate is 3 * width, the texture will be repeated 3 times). If repeat mode is disabled, the "extra space" will instead be filled with border pixels. Warning: on very old graphics cards, white pixels may appear when the texture is repeated. With such cards, repeat mode can be used reliably only if the texture has power-of-two dimensions (such as 256x128). Repeating is disabled by default.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">repeated</td><td>True to repeat the texture, false to disable repeating</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#af1a1a32ca5c799204b2bea4040df7647" title="Tell whether the texture is repeated or not. ">isRepeated</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a0c3bd6825b9a99714f10d44179d74324"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a0c3bd6825b9a99714f10d44179d74324">◆ </a></span>setSmooth()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::setSmooth </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">bool </td>
|
||
|
<td class="paramname"><em>smooth</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Enable or disable the smooth filter. </p>
|
||
|
<p>When the filter is activated, the texture appears smoother so that pixels are less noticeable. However if you want the texture to look exactly the same as its source file, you should leave it disabled. The smooth filter is disabled by default.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">smooth</td><td>True to enable smoothing, false to disable it</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a3ebb050b5a71e1d40ba66eb1a060e103" title="Tell whether the smooth filter is enabled or not. ">isSmooth</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="af8a38872c50a33ff074bd0865db19dd4"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#af8a38872c50a33ff074bd0865db19dd4">◆ </a></span>setSrgb()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::setSrgb </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">bool </td>
|
||
|
<td class="paramname"><em>sRgb</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Enable or disable conversion from sRGB. </p>
|
||
|
<p>When providing texture data from an image file or memory, it can either be stored in a linear color space or an sRGB color space. Most digital images account for gamma correction already, so they would need to be "uncorrected" back to linear color space before being processed by the hardware. The hardware can automatically convert it from the sRGB color space to a linear color space when it gets sampled. When the rendered image gets output to the final framebuffer, it gets converted back to sRGB.</p>
|
||
|
<p>After enabling or disabling sRGB conversion, make sure to reload the texture data in order for the setting to take effect.</p>
|
||
|
<p>This option is only useful in conjunction with an sRGB capable framebuffer. This can be requested during window creation.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">sRgb</td><td>True to enable sRGB conversion, false to disable it</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html#a9d77ce4f8124abfda96900a6bd53bfe9" title="Tell whether the texture source is converted from sRGB or not. ">isSrgb</a> </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a9243470c64b7ff0d231e00663e495798"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a9243470c64b7ff0d231e00663e495798">◆ </a></span>swap()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::swap </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
||
|
<td class="paramname"><em>right</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Swap the contents of this texture with those of another. </p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">right</td><td>Instance to swap with </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="ae4eab5c6781316840b0c50ad08370963"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ae4eab5c6781316840b0c50ad08370963">◆ </a></span>update() <span class="overload">[1/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const Uint8 * </td>
|
||
|
<td class="paramname"><em>pixels</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update the whole texture from an array of pixels. </p>
|
||
|
<p>The <em>pixel</em> array is assumed to have the same size as the <em>area</em> rectangle, and to contain 32-bits RGBA pixels.</p>
|
||
|
<p>No additional check is performed on the size of the pixel array, passing invalid arguments will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if <em>pixels</em> is null or if the texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">pixels</td><td>Array of pixels to copy to the texture </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a1352d8e16c2aeb4df586ed65dd2c36b9"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a1352d8e16c2aeb4df586ed65dd2c36b9">◆ </a></span>update() <span class="overload">[2/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const Uint8 * </td>
|
||
|
<td class="paramname"><em>pixels</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></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">unsigned int </td>
|
||
|
<td class="paramname"><em>x</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>y</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update a part of the texture from an array of pixels. </p>
|
||
|
<p>The size of the <em>pixel</em> array must match the <em>width</em> and <em>height</em> arguments, and it must contain 32-bits RGBA pixels.</p>
|
||
|
<p>No additional check is performed on the size of the pixel array or the bounds of the area to update, passing invalid arguments will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if <em>pixels</em> is null or if the texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">pixels</td><td>Array of pixels to copy to the texture </td></tr>
|
||
|
<tr><td class="paramname">width</td><td>Width of the pixel region contained in <em>pixels</em> </td></tr>
|
||
|
<tr><td class="paramname">height</td><td>Height of the pixel region contained in <em>pixels</em> </td></tr>
|
||
|
<tr><td class="paramname">x</td><td>X offset in the texture where to copy the source pixels </td></tr>
|
||
|
<tr><td class="paramname">y</td><td>Y offset in the texture where to copy the source pixels </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="af9885ca00b74950d60feea28132d9691"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#af9885ca00b74950d60feea28132d9691">◆ </a></span>update() <span class="overload">[3/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
||
|
<td class="paramname"><em>texture</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update a part of this texture from another texture. </p>
|
||
|
<p>Although the source texture can be smaller than this texture, this function is usually used for updating the whole texture. The other overload, which has (x, y) additional arguments, is more convenient for updating a sub-area of this texture.</p>
|
||
|
<p>No additional check is performed on the size of the passed texture, passing a texture bigger than this texture will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if either texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">texture</td><td>Source texture to copy to this texture </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a89beb474da1da84b5e38c9fc0b441fe4"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a89beb474da1da84b5e38c9fc0b441fe4">◆ </a></span>update() <span class="overload">[4/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
||
|
<td class="paramname"><em>texture</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>x</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>y</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update a part of this texture from another texture. </p>
|
||
|
<p>No additional check is performed on the size of the texture, passing an invalid combination of texture size and offset will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if either texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">texture</td><td>Source texture to copy to this texture </td></tr>
|
||
|
<tr><td class="paramname">x</td><td>X offset in this texture where to copy the source texture </td></tr>
|
||
|
<tr><td class="paramname">y</td><td>Y offset in this texture where to copy the source texture </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a037cdf171af0fb392d07626a44a4ea17"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a037cdf171af0fb392d07626a44a4ea17">◆ </a></span>update() <span class="overload">[5/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Image.html">Image</a> & </td>
|
||
|
<td class="paramname"><em>image</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update the texture from an image. </p>
|
||
|
<p>Although the source image can be smaller than the texture, this function is usually used for updating the whole texture. The other overload, which has (x, y) additional arguments, is more convenient for updating a sub-area of the texture.</p>
|
||
|
<p>No additional check is performed on the size of the image, passing an image bigger than the texture will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if the texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">image</td><td><a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> to copy to the texture </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a87f916490b757fe900798eedf3abf3ba"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a87f916490b757fe900798eedf3abf3ba">◆ </a></span>update() <span class="overload">[6/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Image.html">Image</a> & </td>
|
||
|
<td class="paramname"><em>image</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>x</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>y</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update a part of the texture from an image. </p>
|
||
|
<p>No additional check is performed on the size of the image, passing an invalid combination of image size and offset will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if the texture was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">image</td><td><a class="el" href="classsf_1_1Image.html" title="Class for loading, manipulating and saving images. ">Image</a> to copy to the texture </td></tr>
|
||
|
<tr><td class="paramname">x</td><td>X offset in the texture where to copy the source image </td></tr>
|
||
|
<tr><td class="paramname">y</td><td>Y offset in the texture where to copy the source image </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="ad3cceef238f7d5d2108a98dd38c17fc5"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ad3cceef238f7d5d2108a98dd38c17fc5">◆ </a></span>update() <span class="overload">[7/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Window.html">Window</a> & </td>
|
||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update the texture from the contents of a window. </p>
|
||
|
<p>Although the source window can be smaller than the texture, this function is usually used for updating the whole texture. The other overload, which has (x, y) additional arguments, is more convenient for updating a sub-area of the texture.</p>
|
||
|
<p>No additional check is performed on the size of the window, passing a window bigger than the texture will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if either the texture or the window was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">window</td><td><a class="el" href="classsf_1_1Window.html" title="Window that serves as a target for OpenGL rendering. ">Window</a> to copy to the texture </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="a154f246eb8059b602076009ab1cfd175"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#a154f246eb8059b602076009ab1cfd175">◆ </a></span>update() <span class="overload">[8/8]</span></h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void sf::Texture::update </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classsf_1_1Window.html">Window</a> & </td>
|
||
|
<td class="paramname"><em>window</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>x</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"><em>y</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Update a part of the texture from the contents of a window. </p>
|
||
|
<p>No additional check is performed on the size of the window, passing an invalid combination of window size and offset will lead to an undefined behavior.</p>
|
||
|
<p>This function does nothing if either the texture or the window was not previously created.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">window</td><td><a class="el" href="classsf_1_1Window.html" title="Window that serves as a target for OpenGL rendering. ">Window</a> to copy to the texture </td></tr>
|
||
|
<tr><td class="paramname">x</td><td>X offset in the texture where to copy the source window </td></tr>
|
||
|
<tr><td class="paramname">y</td><td>Y offset in the texture where to copy the source window </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
||
|
<li><a class="el" href="Texture_8hpp_source.html">Texture.hpp</a></li>
|
||
|
</ul>
|
||
|
</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>
|