diff options
author | unknown <paulx161@umn.edu> | 2021-02-03 14:22:28 -0600 |
---|---|---|
committer | unknown <paulx161@umn.edu> | 2021-02-03 14:22:28 -0600 |
commit | 9b83919815f6a6ce5d73da1c28483970d0ca5589 (patch) | |
tree | 4558864445dccc1605e5315e0bb11c46d2018da1 /dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html | |
parent | Added worksheet and support code for assignment 2 (diff) | |
download | csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.gz csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.bz2 csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.lz csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.xz csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.tar.zst csci4611-9b83919815f6a6ce5d73da1c28483970d0ca5589.zip |
added dev/MinGfx/
Diffstat (limited to 'dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html')
-rw-r--r-- | dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html | 540 |
1 files changed, 540 insertions, 0 deletions
diff --git a/dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html b/dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html new file mode 100644 index 0000000..a72804d --- /dev/null +++ b/dev/MinGfx/docs/html/classmingfx_1_1_texture2_d.html @@ -0,0 +1,540 @@ +<!-- HTML header for doxygen 1.8.9.1--> +<!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> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=9"/> +<meta name="generator" content="Doxygen 1.9.1"/> +<title>MinGfx Toolkit: mingfx::Texture2D Class Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="jquery.js"></script> +<script type="text/javascript" src="dynsections.js"></script> +<link href="search/search.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="search/searchdata.js"></script> +<script type="text/javascript" src="search/search.js"></script> +<script type="text/x-mathjax-config"> + MathJax.Hub.Config({ + extensions: ["tex2jax.js"], + jax: ["input/TeX","output/HTML-CSS"], +}); +</script> +<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> +<link href="doxygen.css" rel="stylesheet" type="text/css" /> +<link href="customdoxygen.css" rel="stylesheet" type="text/css"/> +</head> +<body> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> +<div id="titlearea"> +<table cellspacing="0" cellpadding="0"> + <tbody> + <tr style="height: 56px;"> + <td style="padding-left: 0.5em;"> + <div id="projectname">MinGfx Toolkit +  <span id="projectnumber">1.0</span> + </div> + <div id="projectbrief">A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.</div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.9.1 --> +<script type="text/javascript"> +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); +/* @license-end */ +</script> +<script type="text/javascript" src="menudata.js"></script> +<script type="text/javascript" src="menu.js"></script> +<script type="text/javascript"> +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +$(function() { + initMenu('',true,false,'search.php','Search'); + $(document).ready(function() { init_search(); }); +}); +/* @license-end */</script> +<div id="main-nav"></div> +<!-- window showing the filter options --> +<div id="MSearchSelectWindow" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + onkeydown="return searchBox.OnSearchSelectKey(event)"> +</div> + +<!-- iframe showing the search results (closed by default) --> +<div id="MSearchResultsWindow"> +<iframe src="javascript:void(0)" frameborder="0" + name="MSearchResults" id="MSearchResults"> +</iframe> +</div> + +<div id="nav-path" class="navpath"> + <ul> +<li class="navelem"><a class="el" href="namespacemingfx.html">mingfx</a></li><li class="navelem"><a class="el" href="classmingfx_1_1_texture2_d.html">Texture2D</a></li> </ul> +</div> +</div><!-- top --> +<div class="header"> + <div class="summary"> +<a href="#pub-methods">Public Member Functions</a> | +<a href="classmingfx_1_1_texture2_d-members.html">List of all members</a> </div> + <div class="headertitle"> +<div class="title">mingfx::Texture2D Class Reference</div> </div> +</div><!--header--> +<div class="contents"> +<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> +<div class="textblock"><p>A wrapper around a 2D texture that supports loading images from files or setting texture color data directly. </p> +<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="classmingfx_1_1_texture2_d.html#aa15b86ec3b7312842c220b081c39980d">Texture2D</a> tex1;</div> +<div class="line"><a class="code" href="classmingfx_1_1_texture2_d.html#aa15b86ec3b7312842c220b081c39980d">Texture2D</a> tex2(GL_CLAMP_TO_EDGE);</div> +<div class="line"> </div> +<div class="line"><span class="keywordtype">void</span> MyGraphicsApp::InitOpenGL() {</div> +<div class="line"> std::vector<std::string> search_path;</div> +<div class="line"> search_path.push_back(<span class="stringliteral">"."</span>);</div> +<div class="line"> search_path.push_back(<span class="stringliteral">"./data"</span>);</div> +<div class="line"> search_path.push_back(<span class="stringliteral">"./shaders"</span>);</div> +<div class="line"> tex1.InitFromFile(<a class="code" href="classmingfx_1_1_platform.html#a32a392f4bac832c95fabc2d10bd03ad1">Platform::FindFile</a>(<span class="stringliteral">"earth-2k.png"</span>, search_path));</div> +<div class="line"> tex2.InitFromFile(<a class="code" href="classmingfx_1_1_platform.html#a32a392f4bac832c95fabc2d10bd03ad1">Platform::FindFile</a>(<span class="stringliteral">"toon-ramp.png"</span>, search_path));</div> +<div class="line">}</div> +<div class="ttc" id="aclassmingfx_1_1_platform_html_a32a392f4bac832c95fabc2d10bd03ad1"><div class="ttname"><a href="classmingfx_1_1_platform.html#a32a392f4bac832c95fabc2d10bd03ad1">mingfx::Platform::FindFile</a></div><div class="ttdeci">static std::string FindFile(const std::string &basename, const std::vector< std::string > &searchpath)</div></div> +<div class="ttc" id="aclassmingfx_1_1_texture2_d_html_aa15b86ec3b7312842c220b081c39980d"><div class="ttname"><a href="classmingfx_1_1_texture2_d.html#aa15b86ec3b7312842c220b081c39980d">mingfx::Texture2D::Texture2D</a></div><div class="ttdeci">Texture2D(GLenum wrapMode=GL_REPEAT, GLenum filterMode=GL_LINEAR)</div><div class="ttdoc">Creates an empty texture. Optional parameters can be provided to set the texture wrap mode and filter...</div></div> +</div><!-- fragment --> +<p class="definition">Definition at line <a class="el" href="texture2d_8h_source.html#l00042">42</a> of file <a class="el" href="texture2d_8h_source.html">texture2d.h</a>.</p> +</div> +<p><code>#include <<a class="el" href="texture2d_8h_source.html">texture2d.h</a>></code></p> +<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:aa15b86ec3b7312842c220b081c39980d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#aa15b86ec3b7312842c220b081c39980d">Texture2D</a> (GLenum wrapMode=GL_REPEAT, GLenum filterMode=GL_LINEAR)</td></tr> +<tr class="memdesc:aa15b86ec3b7312842c220b081c39980d"><td class="mdescLeft"> </td><td class="mdescRight">Creates an empty texture. Optional parameters can be provided to set the texture wrap mode and filter mode. <a href="classmingfx_1_1_texture2_d.html#aa15b86ec3b7312842c220b081c39980d">More...</a><br /></td></tr> +<tr class="separator:aa15b86ec3b7312842c220b081c39980d"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aab734dbbcf6211507ab65d5bb94a4ef9"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#aab734dbbcf6211507ab65d5bb94a4ef9">~Texture2D</a> ()</td></tr> +<tr class="separator:aab734dbbcf6211507ab65d5bb94a4ef9"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a8eded044ccdf9bd3e1e5bcfe74526bdc"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a8eded044ccdf9bd3e1e5bcfe74526bdc">InitFromFile</a> (const std::string &filename)</td></tr> +<tr class="memdesc:a8eded044ccdf9bd3e1e5bcfe74526bdc"><td class="mdescLeft"> </td><td class="mdescRight">Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. Internally, this uses the stbi library to load images. It supports png, jpg, bmp, and other file formats. <a href="classmingfx_1_1_texture2_d.html#a8eded044ccdf9bd3e1e5bcfe74526bdc">More...</a><br /></td></tr> +<tr class="separator:a8eded044ccdf9bd3e1e5bcfe74526bdc"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aba57b01065096fe9f6483e8f68622944"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#aba57b01065096fe9f6483e8f68622944">InitFromBytes</a> (int <a class="el" href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869">width</a>, int <a class="el" href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88">height</a>, const unsigned char *data)</td></tr> +<tr class="memdesc:aba57b01065096fe9f6483e8f68622944"><td class="mdescLeft"> </td><td class="mdescRight">Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. With this version of Init, you may pass in your own pointer to color data. The data argument must point to an array of 4-channel color data stored as unsigned chars in RGBA format. You are responsible for managing the memory for this array. If you will never call <a class="el" href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b" title="Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom ri...">Pixel()</a>, then it is safe to free data as soon as this function returns. Otherwise, you need to make sure data does not change in memory until you destroy the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a> object. <a href="classmingfx_1_1_texture2_d.html#aba57b01065096fe9f6483e8f68622944">More...</a><br /></td></tr> +<tr class="separator:aba57b01065096fe9f6483e8f68622944"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aee8a0aad1795680cb840ffcf544ed7b8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#aee8a0aad1795680cb840ffcf544ed7b8">InitFromFloats</a> (int <a class="el" href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869">width</a>, int <a class="el" href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88">height</a>, const float *data)</td></tr> +<tr class="memdesc:aee8a0aad1795680cb840ffcf544ed7b8"><td class="mdescLeft"> </td><td class="mdescRight">Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. With this version of Init, you may pass in your own pointer to color data. The data argument must point to an array of 4-channel color data stored as floats in RGBA format. You are responsible for managing the memory for this array. If you will never call <a class="el" href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b" title="Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom ri...">Pixel()</a>, then it is safe to free data as soon as this function returns. Otherwise, you need to make sure data does not change in memory until you destroy the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a> object. <a href="classmingfx_1_1_texture2_d.html#aee8a0aad1795680cb840ffcf544ed7b8">More...</a><br /></td></tr> +<tr class="separator:aee8a0aad1795680cb840ffcf544ed7b8"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a0783ad70829ef353aa92344d320b107c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a0783ad70829ef353aa92344d320b107c">UpdateFromBytes</a> (const unsigned char *data)</td></tr> +<tr class="memdesc:a0783ad70829ef353aa92344d320b107c"><td class="mdescLeft"> </td><td class="mdescRight">This function may be called to re-read the texture data from an array formated the same as in InitFromBytes. The width and height of the texture must remain the same. <a href="classmingfx_1_1_texture2_d.html#a0783ad70829ef353aa92344d320b107c">More...</a><br /></td></tr> +<tr class="separator:a0783ad70829ef353aa92344d320b107c"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ad7640f0cbda6398a6bb80202b80dd693"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#ad7640f0cbda6398a6bb80202b80dd693">UpdateFromFloats</a> (const float *data)</td></tr> +<tr class="memdesc:ad7640f0cbda6398a6bb80202b80dd693"><td class="mdescLeft"> </td><td class="mdescRight">This function may be called to re-read the texture data from an array formated the same as in InitFromFloats. The width and height of the texture must remain the same. <a href="classmingfx_1_1_texture2_d.html#ad7640f0cbda6398a6bb80202b80dd693">More...</a><br /></td></tr> +<tr class="separator:ad7640f0cbda6398a6bb80202b80dd693"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a15d5c319cf7e012e703668f4d4e7be87"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a15d5c319cf7e012e703668f4d4e7be87">initialized</a> () const</td></tr> +<tr class="memdesc:a15d5c319cf7e012e703668f4d4e7be87"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the texture data has been successfully transferred to OpenGL. <a href="classmingfx_1_1_texture2_d.html#a15d5c319cf7e012e703668f4d4e7be87">More...</a><br /></td></tr> +<tr class="separator:a15d5c319cf7e012e703668f4d4e7be87"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a401629d948aa144be81b94fe21938869"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869">width</a> () const</td></tr> +<tr class="memdesc:a401629d948aa144be81b94fe21938869"><td class="mdescLeft"> </td><td class="mdescRight">Returns the width in pixels of the texture. <a href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869">More...</a><br /></td></tr> +<tr class="separator:a401629d948aa144be81b94fe21938869"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a3c396193b466053f23803894039d8d88"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88">height</a> () const</td></tr> +<tr class="memdesc:a3c396193b466053f23803894039d8d88"><td class="mdescLeft"> </td><td class="mdescRight">Returns the height in pixels of the texture. <a href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88">More...</a><br /></td></tr> +<tr class="separator:a3c396193b466053f23803894039d8d88"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ad4e0faadfe016e6ee501e66fc0244504"><td class="memItemLeft" align="right" valign="top">GLuint </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#ad4e0faadfe016e6ee501e66fc0244504">opengl_id</a> () const</td></tr> +<tr class="memdesc:ad4e0faadfe016e6ee501e66fc0244504"><td class="mdescLeft"> </td><td class="mdescRight">Returns the unsigned int used as the texture handle by OpenGL. <a href="classmingfx_1_1_texture2_d.html#ad4e0faadfe016e6ee501e66fc0244504">More...</a><br /></td></tr> +<tr class="separator:ad4e0faadfe016e6ee501e66fc0244504"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a1c8827426f43343c0ad171e181a741ea"><td class="memItemLeft" align="right" valign="top">GLenum </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a1c8827426f43343c0ad171e181a741ea">wrap_mode</a> () const</td></tr> +<tr class="memdesc:a1c8827426f43343c0ad171e181a741ea"><td class="mdescLeft"> </td><td class="mdescRight">Returns an enumerated constant for the OpenGL wrap mode used by the texture. <a href="classmingfx_1_1_texture2_d.html#a1c8827426f43343c0ad171e181a741ea">More...</a><br /></td></tr> +<tr class="separator:a1c8827426f43343c0ad171e181a741ea"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:af0052203fcfd9bbb903a40d14700b13b"><td class="memItemLeft" align="right" valign="top">GLenum </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#af0052203fcfd9bbb903a40d14700b13b">filter_mode</a> () const</td></tr> +<tr class="memdesc:af0052203fcfd9bbb903a40d14700b13b"><td class="mdescLeft"> </td><td class="mdescRight">Returns an enumerated constant for the OpenGL filter mode used by the texture. <a href="classmingfx_1_1_texture2_d.html#af0052203fcfd9bbb903a40d14700b13b">More...</a><br /></td></tr> +<tr class="separator:af0052203fcfd9bbb903a40d14700b13b"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aa5cbe3396e4560ec0746e91dbc55bc9f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#aa5cbe3396e4560ec0746e91dbc55bc9f">set_wrap_mode</a> (GLenum wrapMode)</td></tr> +<tr class="memdesc:aa5cbe3396e4560ec0746e91dbc55bc9f"><td class="mdescLeft"> </td><td class="mdescRight">Uses the OpenGL texture wrap mode arguments. <a href="classmingfx_1_1_texture2_d.html#aa5cbe3396e4560ec0746e91dbc55bc9f">More...</a><br /></td></tr> +<tr class="separator:aa5cbe3396e4560ec0746e91dbc55bc9f"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a4a3b2b550fefdf79f0fb392b04e7b013"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a4a3b2b550fefdf79f0fb392b04e7b013">set_filter_mode</a> (GLenum filterMode)</td></tr> +<tr class="memdesc:a4a3b2b550fefdf79f0fb392b04e7b013"><td class="mdescLeft"> </td><td class="mdescRight">Uses the OpenGL texture filter mode arguments. <a href="classmingfx_1_1_texture2_d.html#a4a3b2b550fefdf79f0fb392b04e7b013">More...</a><br /></td></tr> +<tr class="separator:a4a3b2b550fefdf79f0fb392b04e7b013"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a1e843f3d8904f9c7a99f7614f87de73b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b">Pixel</a> (int x, int y) const</td></tr> +<tr class="memdesc:a1e843f3d8904f9c7a99f7614f87de73b"><td class="mdescLeft"> </td><td class="mdescRight">Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom right is (<a class="el" href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869" title="Returns the width in pixels of the texture.">width()</a>-1, <a class="el" href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88" title="Returns the height in pixels of the texture.">height()</a>-1). <a href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b">More...</a><br /></td></tr> +<tr class="separator:a1e843f3d8904f9c7a99f7614f87de73b"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<h2 class="groupheader">Constructor & Destructor Documentation</h2> +<a id="aa15b86ec3b7312842c220b081c39980d"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aa15b86ec3b7312842c220b081c39980d">◆ </a></span>Texture2D()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">mingfx::Texture2D::Texture2D </td> + <td>(</td> + <td class="paramtype">GLenum </td> + <td class="paramname"><em>wrapMode</em> = <code>GL_REPEAT</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">GLenum </td> + <td class="paramname"><em>filterMode</em> = <code>GL_LINEAR</code> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates an empty texture. Optional parameters can be provided to set the texture wrap mode and filter mode. </p> + +</div> +</div> +<a id="aab734dbbcf6211507ab65d5bb94a4ef9"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aab734dbbcf6211507ab65d5bb94a4ef9">◆ </a></span>~Texture2D()</h2> + +<div class="memitem"> +<div class="memproto"> +<table class="mlabels"> + <tr> + <td class="mlabels-left"> + <table class="memname"> + <tr> + <td class="memname">virtual mingfx::Texture2D::~Texture2D </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> + </td> + <td class="mlabels-right"> +<span class="mlabels"><span class="mlabel">virtual</span></span> </td> + </tr> +</table> +</div><div class="memdoc"> + +</div> +</div> +<h2 class="groupheader">Member Function Documentation</h2> +<a id="af0052203fcfd9bbb903a40d14700b13b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#af0052203fcfd9bbb903a40d14700b13b">◆ </a></span>filter_mode()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">GLenum mingfx::Texture2D::filter_mode </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns an enumerated constant for the OpenGL filter mode used by the texture. </p> + +</div> +</div> +<a id="a3c396193b466053f23803894039d8d88"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a3c396193b466053f23803894039d8d88">◆ </a></span>height()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int mingfx::Texture2D::height </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns the height in pixels of the texture. </p> + +</div> +</div> +<a id="aba57b01065096fe9f6483e8f68622944"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aba57b01065096fe9f6483e8f68622944">◆ </a></span>InitFromBytes()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::InitFromBytes </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>width</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"><em>height</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const unsigned char * </td> + <td class="paramname"><em>data</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. With this version of Init, you may pass in your own pointer to color data. The data argument must point to an array of 4-channel color data stored as unsigned chars in RGBA format. You are responsible for managing the memory for this array. If you will never call <a class="el" href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b" title="Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom ri...">Pixel()</a>, then it is safe to free data as soon as this function returns. Otherwise, you need to make sure data does not change in memory until you destroy the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a> object. </p> + +</div> +</div> +<a id="a8eded044ccdf9bd3e1e5bcfe74526bdc"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a8eded044ccdf9bd3e1e5bcfe74526bdc">◆ </a></span>InitFromFile()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::InitFromFile </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"><em>filename</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. Internally, this uses the stbi library to load images. It supports png, jpg, bmp, and other file formats. </p> + +</div> +</div> +<a id="aee8a0aad1795680cb840ffcf544ed7b8"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aee8a0aad1795680cb840ffcf544ed7b8">◆ </a></span>InitFromFloats()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::InitFromFloats </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>width</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"><em>height</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const float * </td> + <td class="paramname"><em>data</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Call this from within the InitOpenGL() function since it will initialize not just the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a>'s internal data but also an OpenGL texture to be stored on the graphics card. With this version of Init, you may pass in your own pointer to color data. The data argument must point to an array of 4-channel color data stored as floats in RGBA format. You are responsible for managing the memory for this array. If you will never call <a class="el" href="classmingfx_1_1_texture2_d.html#a1e843f3d8904f9c7a99f7614f87de73b" title="Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom ri...">Pixel()</a>, then it is safe to free data as soon as this function returns. Otherwise, you need to make sure data does not change in memory until you destroy the <a class="el" href="classmingfx_1_1_texture2_d.html" title="A wrapper around a 2D texture that supports loading images from files or setting texture color data d...">Texture2D</a> object. </p> + +</div> +</div> +<a id="a15d5c319cf7e012e703668f4d4e7be87"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a15d5c319cf7e012e703668f4d4e7be87">◆ </a></span>initialized()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::initialized </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns true if the texture data has been successfully transferred to OpenGL. </p> + +</div> +</div> +<a id="ad4e0faadfe016e6ee501e66fc0244504"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad4e0faadfe016e6ee501e66fc0244504">◆ </a></span>opengl_id()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">GLuint mingfx::Texture2D::opengl_id </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns the unsigned int used as the texture handle by OpenGL. </p> + +</div> +</div> +<a id="a1e843f3d8904f9c7a99f7614f87de73b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a1e843f3d8904f9c7a99f7614f87de73b">◆ </a></span>Pixel()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classmingfx_1_1_color.html">Color</a> mingfx::Texture2D::Pixel </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>x</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"><em>y</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom right is (<a class="el" href="classmingfx_1_1_texture2_d.html#a401629d948aa144be81b94fe21938869" title="Returns the width in pixels of the texture.">width()</a>-1, <a class="el" href="classmingfx_1_1_texture2_d.html#a3c396193b466053f23803894039d8d88" title="Returns the height in pixels of the texture.">height()</a>-1). </p> + +</div> +</div> +<a id="a4a3b2b550fefdf79f0fb392b04e7b013"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a4a3b2b550fefdf79f0fb392b04e7b013">◆ </a></span>set_filter_mode()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void mingfx::Texture2D::set_filter_mode </td> + <td>(</td> + <td class="paramtype">GLenum </td> + <td class="paramname"><em>filterMode</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Uses the OpenGL texture filter mode arguments. </p> + +</div> +</div> +<a id="aa5cbe3396e4560ec0746e91dbc55bc9f"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aa5cbe3396e4560ec0746e91dbc55bc9f">◆ </a></span>set_wrap_mode()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void mingfx::Texture2D::set_wrap_mode </td> + <td>(</td> + <td class="paramtype">GLenum </td> + <td class="paramname"><em>wrapMode</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Uses the OpenGL texture wrap mode arguments. </p> + +</div> +</div> +<a id="a0783ad70829ef353aa92344d320b107c"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a0783ad70829ef353aa92344d320b107c">◆ </a></span>UpdateFromBytes()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::UpdateFromBytes </td> + <td>(</td> + <td class="paramtype">const unsigned char * </td> + <td class="paramname"><em>data</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>This function may be called to re-read the texture data from an array formated the same as in InitFromBytes. The width and height of the texture must remain the same. </p> + +</div> +</div> +<a id="ad7640f0cbda6398a6bb80202b80dd693"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad7640f0cbda6398a6bb80202b80dd693">◆ </a></span>UpdateFromFloats()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool mingfx::Texture2D::UpdateFromFloats </td> + <td>(</td> + <td class="paramtype">const float * </td> + <td class="paramname"><em>data</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>This function may be called to re-read the texture data from an array formated the same as in InitFromFloats. The width and height of the texture must remain the same. </p> + +</div> +</div> +<a id="a401629d948aa144be81b94fe21938869"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a401629d948aa144be81b94fe21938869">◆ </a></span>width()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int mingfx::Texture2D::width </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns the width in pixels of the texture. </p> + +</div> +</div> +<a id="a1c8827426f43343c0ad171e181a741ea"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a1c8827426f43343c0ad171e181a741ea">◆ </a></span>wrap_mode()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">GLenum mingfx::Texture2D::wrap_mode </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Returns an enumerated constant for the OpenGL wrap mode used by the texture. </p> + +</div> +</div> +<hr/>The documentation for this class was generated from the following file:<ul> +<li>src/<a class="el" href="texture2d_8h_source.html">texture2d.h</a></li> +</ul> +</div><!-- contents --> +<!-- HTML footer for doxygen 1.8.9.1--> +<!-- start footer part --> +<hr class="footer"/><address class="footer"><small> +Generated by  <a href="http://www.doxygen.org/index.html"> +<img class="footer" src="doxygen.png" alt="doxygen"/> +</a> 1.9.1 +</small></address> +</body> +</html> |