<!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&amp;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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;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 class="current"><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()">&#160;</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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;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 id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacesf.html">sf</a></li><li class="navelem"><a class="el" href="structsf_1_1Vertex.html">Vertex</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structsf_1_1Vertex-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">sf::Vertex Struct Reference<div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Point with color and texture coordinates.  
 <a href="#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Vertex_8hpp_source.html">SFML/Graphics/Vertex.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a8a4e0f4dfa7f1eb215c92e93d04f0ac0" id="r_a8a4e0f4dfa7f1eb215c92e93d04f0ac0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8a4e0f4dfa7f1eb215c92e93d04f0ac0">position</a></td></tr>
<tr class="memdesc:a8a4e0f4dfa7f1eb215c92e93d04f0ac0"><td class="mdescLeft">&#160;</td><td class="mdescRight">2D position of the vertex  <br /></td></tr>
<tr class="separator:a8a4e0f4dfa7f1eb215c92e93d04f0ac0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a799faa0629442e90f07cd2edb568ff80" id="r_a799faa0629442e90f07cd2edb568ff80"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Color.html">Color</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a799faa0629442e90f07cd2edb568ff80">color</a> {<a class="el" href="classsf_1_1Color.html#a4fd874712178d9e206f53226002aa4ca">Color::White</a>}</td></tr>
<tr class="memdesc:a799faa0629442e90f07cd2edb568ff80"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsf_1_1Color.html" title="Utility class for manipulating RGBA colors.">Color</a> of the vertex.  <br /></td></tr>
<tr class="separator:a799faa0629442e90f07cd2edb568ff80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e79bd05818d36c4789751908037097c" id="r_a9e79bd05818d36c4789751908037097c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9e79bd05818d36c4789751908037097c">texCoords</a> {}</td></tr>
<tr class="memdesc:a9e79bd05818d36c4789751908037097c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Coordinates of the texture's pixel to map to the vertex NOLINT(readability-redundant-member-init)  <br /></td></tr>
<tr class="separator:a9e79bd05818d36c4789751908037097c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Point with color and texture coordinates. </p>
<p>A vertex is an improved point.</p>
<p>By default, the vertex color is white and texture coordinates are (0, 0).</p>
<p>It has a position and other extra attributes that will be used for drawing: in SFML, vertices also have a color and a pair of texture coordinates.</p>
<p>The vertex is the building block of drawing. Everything which is visible on screen is made of vertices. They are grouped as 2D primitives (lines, triangles, ...), and these primitives are grouped to create even more complex 2D entities such as sprites, texts, etc.</p>
<p>If you use the graphical entities of SFML (sprite, text, shape) you won't have to deal with vertices directly. But if you want to define your own 2D entities, such as tiled maps or particle systems, using vertices will allow you to get maximum performances.</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="comment">// define a 100x100 square, red, with a 10x10 texture mapped on it</span></div>
<div class="line"><a class="code hl_struct" href="structsf_1_1Vertex.html">sf::Vertex</a> vertices[]</div>
<div class="line">{</div>
<div class="line">    {{  0.0f,   0.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, { 0.0f,  0.0f}},</div>
<div class="line">    {{  0.0f, 100.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, { 0.0f, 10.0f}},</div>
<div class="line">    {{100.0f, 100.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, {10.0f, 10.0f}},</div>
<div class="line">    {{  0.0f,   0.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, { 0.0f,  0.0f}},</div>
<div class="line">    {{100.0f, 100.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, {10.0f, 10.0f}},</div>
<div class="line">    {{100.0f,   0.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, {10.0f,  0.0f}}</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// draw it</span></div>
<div class="line">window.draw(vertices, 6, <a class="code hl_enumvalue" href="group__graphics.html#gga5ee56ac1339984909610713096283b1ba7ca66fdfaad3eb33fc65d7490178f856">sf::PrimitiveType::Triangles</a>);</div>
<div class="ttc" id="aclasssf_1_1Color_html_a127dbf55db9c07d0fa8f4bfcbb97594a"><div class="ttname"><a href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a></div><div class="ttdeci">static const Color Red</div><div class="ttdoc">Red predefined color.</div><div class="ttdef"><b>Definition</b> <a href="Color_8hpp_source.html#l00084">Color.hpp:84</a></div></div>
<div class="ttc" id="agroup__graphics_html_gga5ee56ac1339984909610713096283b1ba7ca66fdfaad3eb33fc65d7490178f856"><div class="ttname"><a href="group__graphics.html#gga5ee56ac1339984909610713096283b1ba7ca66fdfaad3eb33fc65d7490178f856">sf::PrimitiveType::Triangles</a></div><div class="ttdeci">@ Triangles</div><div class="ttdoc">List of individual triangles.</div></div>
<div class="ttc" id="astructsf_1_1Vertex_html"><div class="ttname"><a href="structsf_1_1Vertex.html">sf::Vertex</a></div><div class="ttdoc">Point with color and texture coordinates.</div><div class="ttdef"><b>Definition</b> <a href="Vertex_8hpp_source.html#l00043">Vertex.hpp:44</a></div></div>
</div><!-- fragment --><p>It is recommended to use aggregate initialization to create vertex objects, which initializes the members in order.</p>
<p>On a C++20-compliant compiler (or where supported as an extension) it is possible to use "designated initializers" to only initialize a subset of members, with the restriction of having to follow the same order in which they are defined.</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="comment">// C++17 and above</span></div>
<div class="line"><a class="code hl_struct" href="structsf_1_1Vertex.html">sf::Vertex</a> v0{{5.0f, 5.0f}};                               <span class="comment">// explicit &#39;position&#39;, implicit &#39;color&#39; and &#39;texCoords&#39;</span></div>
<div class="line"><a class="code hl_struct" href="structsf_1_1Vertex.html">sf::Vertex</a> v1{{5.0f, 5.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>};               <span class="comment">// explicit &#39;position&#39; and &#39;color&#39;, implicit &#39;texCoords&#39;</span></div>
<div class="line"><a class="code hl_struct" href="structsf_1_1Vertex.html">sf::Vertex</a> v2{{5.0f, 5.0f}, <a class="code hl_variable" href="classsf_1_1Color.html#a127dbf55db9c07d0fa8f4bfcbb97594a">sf::Color::Red</a>, {1.0f, 1.0f}}; <span class="comment">// everything is explicitly specified</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// C++20 and above (or compilers supporting &quot;designated initializers&quot; as an extension)</span></div>
<div class="line"><a class="code hl_struct" href="structsf_1_1Vertex.html">sf::Vertex</a> v3{</div>
<div class="line">   .position{5.0f, 5.0f},</div>
<div class="line">   .texCoords{1.0f, 1.0f}</div>
<div class="line">};</div>
</div><!-- fragment --><p>Note: Although texture coordinates are supposed to be an integer amount of pixels, their type is float because of some buggy graphics drivers that are not able to process integer coordinates correctly.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1VertexArray.html" title="Set of one or more 2D primitives.">sf::VertexArray</a></code> </dd></dl>

<p class="definition">Definition at line <a class="el" href="Vertex_8hpp_source.html#l00043">43</a> of file <a class="el" href="Vertex_8hpp_source.html">Vertex.hpp</a>.</p>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a id="a799faa0629442e90f07cd2edb568ff80" name="a799faa0629442e90f07cd2edb568ff80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a799faa0629442e90f07cd2edb568ff80">&#9670;&#160;</a></span>color</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Color.html">Color</a> sf::Vertex::color {<a class="el" href="classsf_1_1Color.html#a4fd874712178d9e206f53226002aa4ca">Color::White</a>}</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><a class="el" href="classsf_1_1Color.html" title="Utility class for manipulating RGBA colors.">Color</a> of the vertex. </p>

<p class="definition">Definition at line <a class="el" href="Vertex_8hpp_source.html#l00049">49</a> of file <a class="el" href="Vertex_8hpp_source.html">Vertex.hpp</a>.</p>

</div>
</div>
<a id="a8a4e0f4dfa7f1eb215c92e93d04f0ac0" name="a8a4e0f4dfa7f1eb215c92e93d04f0ac0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a4e0f4dfa7f1eb215c92e93d04f0ac0">&#9670;&#160;</a></span>position</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> sf::Vertex::position</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>2D position of the vertex </p>

<p class="definition">Definition at line <a class="el" href="Vertex_8hpp_source.html#l00048">48</a> of file <a class="el" href="Vertex_8hpp_source.html">Vertex.hpp</a>.</p>

</div>
</div>
<a id="a9e79bd05818d36c4789751908037097c" name="a9e79bd05818d36c4789751908037097c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e79bd05818d36c4789751908037097c">&#9670;&#160;</a></span>texCoords</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> sf::Vertex::texCoords {}</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Coordinates of the texture's pixel to map to the vertex NOLINT(readability-redundant-member-init) </p>

<p class="definition">Definition at line <a class="el" href="Vertex_8hpp_source.html#l00050">50</a> of file <a class="el" href="Vertex_8hpp_source.html">Vertex.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="Vertex_8hpp_source.html">Vertex.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 &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
