Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > 58828b263d8f56d90ac336dea07a4586 > files > 254

irrlicht-doc-1.6.1-1mdv2010.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Irrlicht Engine: ITexture.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table class="irrlicht" >
  <tr valign="middle"> 
    <td><font size="2"><a class="qindex" href="index.html"><font color="#FFFFFF">Home</font></a> 
      | <a class="qindex" href="namespaces.html"><font color="#FFFFFF">Namespaces</font></a> 
      | <a class="qindex" href="hierarchy.html"><font color="#FFFFFF">Hierarchy</font></a> 
      | <a class="qindex" href="classes.html"><font color="#FFFFFF">Alphabetical 
      List</font></a> | <a class="qindex" href="annotated.html"><font color="#FFFFFF"> 
      Class list</font></a> | <a class="qindex" href="files.html"><font color="#FFFFFF">Files</font></a> 
      | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> 
      Namespace&nbsp;Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class 
      members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File 
      members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td>
  </tr>
</table>
<!-- Generated by Doxygen 1.5.6 -->
<h1>ITexture.h</h1><a href="_i_texture_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2009 Nikolaus Gebhardt</span>
<a name="l00002"></a>00002 <span class="comment">// This file is part of the "Irrlicht Engine".</span>
<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __I_TEXTURE_H_INCLUDED__</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __I_TEXTURE_H_INCLUDED__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="_i_reference_counted_8h.html">IReferenceCounted.h</a>"</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include "<a class="code" href="_i_image_8h.html">IImage.h</a>"</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="dimension2d_8h.html">dimension2d.h</a>"</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="_e_driver_types_8h.html">EDriverTypes.h</a>"</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="path_8h.html">path.h</a>"</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="matrix4_8h.html">matrix4.h</a>"</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="keyword">namespace </span>irr
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017 <span class="keyword">namespace </span>video
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 
<a name="l00022"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f">00022</a> <span class="keyword">enum</span> <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f" title="Enumeration flags telling the video driver in which format textures should be created...">E_TEXTURE_CREATION_FLAG</a>
<a name="l00023"></a>00023 {
<a name="l00032"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f4fe1c1b0f4b44ef4b5da219ce66a0ae8">00032</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f4fe1c1b0f4b44ef4b5da219ce66a0ae8">ETCF_ALWAYS_16_BIT</a> = 0x00000001,
<a name="l00033"></a>00033 
<a name="l00041"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f20881e307a778c4a4fbb5327a60a93bb">00041</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f20881e307a778c4a4fbb5327a60a93bb">ETCF_ALWAYS_32_BIT</a> = 0x00000002,
<a name="l00042"></a>00042 
<a name="l00049"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876fdc5336eb55e0221ef0d7e53c1cf5a2b9">00049</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876fdc5336eb55e0221ef0d7e53c1cf5a2b9">ETCF_OPTIMIZED_FOR_QUALITY</a> = 0x00000004,
<a name="l00050"></a>00050 
<a name="l00056"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f01693eaffcfeca7de6fcd7e826a909c3">00056</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f01693eaffcfeca7de6fcd7e826a909c3">ETCF_OPTIMIZED_FOR_SPEED</a> = 0x00000008,
<a name="l00057"></a>00057 
<a name="l00059"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f288b302e9d4faaba80c7796c7bc1682c">00059</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f288b302e9d4faaba80c7796c7bc1682c">ETCF_CREATE_MIP_MAPS</a> = 0x00000010,
<a name="l00060"></a>00060 
<a name="l00062"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876fb9ce08dff03ebff9139b594610561609">00062</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876fb9ce08dff03ebff9139b594610561609">ETCF_NO_ALPHA_CHANNEL</a> = 0x00000020,
<a name="l00063"></a>00063 
<a name="l00065"></a>00065 
<a name="l00066"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f6a834e40d35e01205ab63f3ce6d71172">00066</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f6a834e40d35e01205ab63f3ce6d71172" title="Allow the Driver to use Non-Power-2-Textures.">ETCF_ALLOW_NON_POWER_2</a> = 0x00000040,
<a name="l00067"></a>00067 
<a name="l00070"></a><a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f0081685b8fa033d771f9c6a5bded8253">00070</a>         <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f0081685b8fa033d771f9c6a5bded8253">ETCF_FORCE_32_BIT_DO_NOT_USE</a> = 0x7fffffff
<a name="l00071"></a>00071 };
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 
<a name="l00075"></a>00075 
<a name="l00077"></a><a class="code" href="namespaceirr_1_1video.html#298dcfa0c273058079177b3ff087aca9">00077</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f" title="Enumeration flags telling the video driver in which format textures should be created...">E_TEXTURE_CREATION_FLAG</a> <a class="code" href="namespaceirr_1_1video.html#298dcfa0c273058079177b3ff087aca9" title="Helper function, helps to get the desired texture creation format from the flags...">getTextureFormatFromFlags</a>(<a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> flags)
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079         <span class="keywordflow">if</span> (flags &amp; <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f01693eaffcfeca7de6fcd7e826a909c3">ETCF_OPTIMIZED_FOR_SPEED</a>)
<a name="l00080"></a>00080                 <span class="keywordflow">return</span> ETCF_OPTIMIZED_FOR_SPEED;
<a name="l00081"></a>00081         <span class="keywordflow">if</span> (flags &amp; <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f4fe1c1b0f4b44ef4b5da219ce66a0ae8">ETCF_ALWAYS_16_BIT</a>)
<a name="l00082"></a>00082                 <span class="keywordflow">return</span> ETCF_ALWAYS_16_BIT;
<a name="l00083"></a>00083         <span class="keywordflow">if</span> (flags &amp; <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876f20881e307a778c4a4fbb5327a60a93bb">ETCF_ALWAYS_32_BIT</a>)
<a name="l00084"></a>00084                 <span class="keywordflow">return</span> ETCF_ALWAYS_32_BIT;
<a name="l00085"></a>00085         <span class="keywordflow">if</span> (flags &amp; <a class="code" href="namespaceirr_1_1video.html#caf6f7414534f7d62bff18c5bf11876fdc5336eb55e0221ef0d7e53c1cf5a2b9">ETCF_OPTIMIZED_FOR_QUALITY</a>)
<a name="l00086"></a>00086                 <span class="keywordflow">return</span> ETCF_OPTIMIZED_FOR_QUALITY;
<a name="l00087"></a>00087         <span class="keywordflow">return</span> ETCF_OPTIMIZED_FOR_SPEED;
<a name="l00088"></a>00088 }
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 
<a name="l00092"></a>00092 
<a name="l00100"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html">00100</a> <span class="keyword">class </span><a class="code" href="classirr_1_1video_1_1_i_texture.html" title="Interface of a Video Driver dependent Texture.">ITexture</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="classirr_1_1_i_reference_counted.html" title="Base class of most objects of the Irrlicht Engine.">IReferenceCounted</a>
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102 <span class="keyword">public</span>:
<a name="l00103"></a>00103 
<a name="l00105"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#32dbd62fef8a65f11e5b440706346c90">00105</a>         <a class="code" href="classirr_1_1video_1_1_i_texture.html#32dbd62fef8a65f11e5b440706346c90" title="constructor">ITexture</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1string.html">io::path</a>&amp; name) : <a class="code" href="classirr_1_1video_1_1_i_texture.html#60c681305a1f24a9d3c1924721cff243">Name</a>(name)
<a name="l00106"></a>00106         {
<a name="l00107"></a>00107                 <a class="code" href="classirr_1_1video_1_1_i_texture.html#60c681305a1f24a9d3c1924721cff243">Name</a>.<a class="code" href="classirr_1_1core_1_1string.html#f282ae08c7560e9b978a4bc44ff7a407" title="Makes the string lower case.">make_lower</a>();
<a name="l00108"></a>00108         }
<a name="l00109"></a>00109 
<a name="l00111"></a>00111 
<a name="l00121"></a>00121         <span class="keyword">virtual</span> <span class="keywordtype">void</span>* <a class="code" href="classirr_1_1video_1_1_i_texture.html#3c623ba8c7aef1e0c1d8c55ab50a337c" title="Lock function.">lock</a>(<span class="keywordtype">bool</span> readOnly = <span class="keyword">false</span>) = 0;
<a name="l00122"></a>00122 
<a name="l00124"></a>00124 
<a name="l00125"></a>00125         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#15b9a25aa18528ade37a492bd7b20a10" title="Unlock function. Must be called after a lock() to the texture.">unlock</a>() = 0;
<a name="l00126"></a>00126 
<a name="l00128"></a>00128 
<a name="l00136"></a>00136         <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">core::dimension2d&lt;u32&gt;</a>&amp; <a class="code" href="classirr_1_1video_1_1_i_texture.html#dbb05bcee8ec7fa11bb4ccfdb725cda8" title="Get original size of the texture.">getOriginalSize</a>() <span class="keyword">const</span> = 0;
<a name="l00137"></a>00137 
<a name="l00139"></a>00139 
<a name="l00140"></a>00140         <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">core::dimension2d&lt;u32&gt;</a>&amp; <a class="code" href="classirr_1_1video_1_1_i_texture.html#dfcf9558c0f1ae543782c03f7903c48e" title="Get dimension (=size) of the texture.">getSize</a>() <span class="keyword">const</span> = 0;
<a name="l00141"></a>00141 
<a name="l00143"></a>00143 
<a name="l00147"></a>00147         <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#e35a6de6d436c76107ad157fe42356d0" title="An enum for all types of drivers the Irrlicht Engine supports.">E_DRIVER_TYPE</a> <a class="code" href="classirr_1_1video_1_1_i_texture.html#4c6abdc0c789e6022e4e1b8a06cfab71" title="Get driver type of texture.">getDriverType</a>() <span class="keyword">const</span> = 0;
<a name="l00148"></a>00148 
<a name="l00150"></a>00150 
<a name="l00151"></a>00151         <span class="keyword">virtual</span> <a class="code" href="namespaceirr_1_1video.html#1d5e487888c32b1674a8f75116d829ed" title="An enum for the color format of textures used by the Irrlicht Engine.">ECOLOR_FORMAT</a> <a class="code" href="classirr_1_1video_1_1_i_texture.html#48bbc0208c046724fc3264406f774132" title="Get the color format of texture.">getColorFormat</a>() <span class="keyword">const</span> = 0;
<a name="l00152"></a>00152 
<a name="l00154"></a>00154 
<a name="l00157"></a>00157         <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="classirr_1_1video_1_1_i_texture.html#14fd1eba217a0dd86b40c4d792ab14ea" title="Get pitch of texture (in bytes).">getPitch</a>() <span class="keyword">const</span> = 0;
<a name="l00158"></a>00158 
<a name="l00160"></a>00160 
<a name="l00161"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#37444068f2f292c43c2ffd516a32a764">00161</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#37444068f2f292c43c2ffd516a32a764" title="Check whether the texture has MipMaps.">hasMipMaps</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00162"></a>00162 
<a name="l00164"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#38b90ca5d956bd9772f2aa8032b38cd5">00164</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#38b90ca5d956bd9772f2aa8032b38cd5" title="Returns if the texture has an alpha channel.">hasAlpha</a>()<span class="keyword"> const </span>{
<a name="l00165"></a>00165                 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#48bbc0208c046724fc3264406f774132" title="Get the color format of texture.">getColorFormat</a> () == <a class="code" href="namespaceirr_1_1video.html#1d5e487888c32b1674a8f75116d829ed55c57d63efff39efe33ee733fe962df0" title="Default 32 bit color format. 8 bits are used for every component: red, green, blue...">video::ECF_A8R8G8B8</a> || <a class="code" href="classirr_1_1video_1_1_i_texture.html#48bbc0208c046724fc3264406f774132" title="Get the color format of texture.">getColorFormat</a> () == <a class="code" href="namespaceirr_1_1video.html#1d5e487888c32b1674a8f75116d829ed1207765b5eab1701111b5dc37b68b4bf" title="16 bit color format used by the software driver.">video::ECF_A1R5G5B5</a>;
<a name="l00166"></a>00166         }
<a name="l00167"></a>00167 
<a name="l00169"></a>00169 
<a name="l00170"></a>00170         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#9fdb71df5df36c2113504a883f3b3905" title="Regenerates the mip map levels of the texture.">regenerateMipMapLevels</a>() = 0;
<a name="l00171"></a>00171 
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#b085e1f1a76a55ab4c5fcdfdeedfb45c">00174</a>         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#b085e1f1a76a55ab4c5fcdfdeedfb45c" title="Check whether the texture is a render target.">isRenderTarget</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00175"></a>00175 
<a name="l00177"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#368d4801d53e1c5d7c1972057e2ae645">00177</a>         <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1string.html">io::path</a>&amp; <a class="code" href="classirr_1_1video_1_1_i_texture.html#368d4801d53e1c5d7c1972057e2ae645" title="Get name of texture (in most cases this is the filename).">getName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1video_1_1_i_texture.html#60c681305a1f24a9d3c1924721cff243">Name</a>; }
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 <span class="keyword">protected</span>:
<a name="l00180"></a>00180 
<a name="l00181"></a><a class="code" href="classirr_1_1video_1_1_i_texture.html#60c681305a1f24a9d3c1924721cff243">00181</a>         <a class="code" href="classirr_1_1core_1_1string.html">io::path</a> <a class="code" href="classirr_1_1video_1_1_i_texture.html#60c681305a1f24a9d3c1924721cff243">Name</a>;
<a name="l00182"></a>00182 };
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 } <span class="comment">// end namespace video</span>
<a name="l00186"></a>00186 } <span class="comment">// end namespace irr</span>
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 <span class="preprocessor">#endif</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1">
<address style="align: right;">
<small> </small>
</address>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td width="0"> <div align="left"><small><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="irrlicht.png" alt="The Irrlicht Engine" align="middle" border=0 width=88 height=31></a></small></div></td>
    <td> <div align="left"><small><em><font size="2">The <a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
        Engine</a> Documentation &copy; 2003-2009 by Nikolaus Gebhardt. Generated 
        on Sun Jan 10 09:24:04 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> 
        (1.5.6)</font></em></small></div></td>
  </tr>
</table>
<address style="align: right;">
</address>
</body>
</html>