[692] | 1 | <html> |
---|
| 2 | <head> |
---|
| 3 | <title>OgreFont.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
| 4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
| 5 | </head> |
---|
| 6 | |
---|
| 7 | <body> |
---|
| 8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
| 9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
| 10 | <h1>OgreFont.h</h1><a href="OgreFont_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*-------------------------------------------------------------------------</span> |
---|
| 11 | 00002 <span class="comment">This source file is a part of OGRE</span> |
---|
| 12 | 00003 <span class="comment">(Object-oriented Graphics Rendering Engine)</span> |
---|
| 13 | 00004 <span class="comment"></span> |
---|
| 14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
| 15 | 00006 <span class="comment"></span> |
---|
| 16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
| 17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
| 18 | 00009 <span class="comment"></span> |
---|
| 19 | 00010 <span class="comment">This library is free software; you can redistribute it and/or modify it</span> |
---|
| 20 | 00011 <span class="comment">under the terms of the GNU Lesser General Public License (LGPL) as </span> |
---|
| 21 | 00012 <span class="comment">published by the Free Software Foundation; either version 2.1 of the </span> |
---|
| 22 | 00013 <span class="comment">License, or (at your option) any later version.</span> |
---|
| 23 | 00014 <span class="comment"></span> |
---|
| 24 | 00015 <span class="comment">This library is distributed in the hope that it will be useful, but </span> |
---|
| 25 | 00016 <span class="comment">WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY </span> |
---|
| 26 | 00017 <span class="comment">or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public </span> |
---|
| 27 | 00018 <span class="comment">License for more details.</span> |
---|
| 28 | 00019 <span class="comment"></span> |
---|
| 29 | 00020 <span class="comment">You should have received a copy of the GNU Lesser General Public License </span> |
---|
| 30 | 00021 <span class="comment">along with this library; if not, write to the Free Software Foundation, </span> |
---|
| 31 | 00022 <span class="comment">Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or go to</span> |
---|
| 32 | 00023 <span class="comment">http://www.gnu.org/copyleft/lesser.txt</span> |
---|
| 33 | 00024 <span class="comment">-------------------------------------------------------------------------*/</span> |
---|
| 34 | 00025 |
---|
| 35 | 00026 <span class="preprocessor">#ifndef _Font_H__</span> |
---|
| 36 | 00027 <span class="preprocessor"></span><span class="preprocessor">#define _Font_H__</span> |
---|
| 37 | 00028 <span class="preprocessor"></span> |
---|
| 38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
| 39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreResource_8h.html">OgreResource.h</a>"</span> |
---|
| 40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreTexture_8h.html">OgreTexture.h</a>"</span> |
---|
| 41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreMaterial_8h.html">OgreMaterial.h</a>"</span> |
---|
| 42 | 00033 |
---|
| 43 | 00034 <span class="keyword">namespace </span>Ogre |
---|
| 44 | 00035 { |
---|
| 45 | 00036 <span class="comment">// Define the number of glyphs allowed</span> |
---|
| 46 | 00037 <span class="comment">// We ignore 0-31 since these are control characters</span> |
---|
| 47 | 00038 <span class="preprocessor">#if OGRE_WCHAR_T_STRINGS</span> |
---|
| 48 | 00039 <span class="preprocessor"></span> <span class="comment">// Allow wide chars</span> |
---|
| 49 | 00040 <span class="preprocessor"> #define OGRE_NUM_GLYPHS (1024 - 32)</span> |
---|
| 50 | 00041 <span class="preprocessor"></span><span class="preprocessor">#else</span> |
---|
| 51 | 00042 <span class="preprocessor"></span> <span class="comment">// Allow 8-bit ASCII </span> |
---|
| 52 | 00043 <span class="comment">// (we don't want to offend people with charcodes 127-256 in their name eh cearny? ;)</span> |
---|
| 53 | 00044 <span class="comment">// Only chars 33+ are any use though</span> |
---|
| 54 | <a name="l00045"></a><a class="code" href="OgreFont_8h.html#a0">00045</a> <span class="preprocessor"> #define OGRE_NUM_GLYPHS (256 - 32)</span> |
---|
| 55 | 00046 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
---|
| 56 | 00047 <span class="preprocessor"></span> |
---|
| 57 | 00048 <span class="comment">// How to look up chars</span> |
---|
| 58 | <a name="l00049"></a><a class="code" href="OgreFont_8h.html#a1">00049</a> <span class="preprocessor"> #define OGRE_GLYPH_INDEX(c) c - 33</span> |
---|
| 59 | 00050 <span class="preprocessor"></span> |
---|
| 60 | <a name="l00052"></a><a class="code" href="namespaceOgre.html#a655">00052</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a655">FontType</a> |
---|
| 61 | 00053 { |
---|
| 62 | 00055 <a class="code" href="namespaceOgre.html#a655a154">FT_TRUETYPE</a> = 1, |
---|
| 63 | 00057 <a class="code" href="namespaceOgre.html#a655a155">FT_IMAGE</a> = 2 |
---|
| 64 | 00058 }; |
---|
| 65 | 00059 |
---|
| 66 | 00060 |
---|
| 67 | <a name="l00074"></a><a class="code" href="classOgre_1_1Font.html">00074</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> Font : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Resource.html">Resource</a>, <span class="keyword">public</span> <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a> |
---|
| 68 | 00075 { |
---|
| 69 | 00076 <span class="keyword">protected</span>: |
---|
| 70 | <a name="l00078"></a><a class="code" href="classOgre_1_1Font_1_1CmdType.html">00078</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> CmdType : <span class="keyword">public</span> <a class="code" href="classOgre_1_1ParamCommand.html">ParamCommand</a> |
---|
| 71 | 00079 { |
---|
| 72 | 00080 <span class="keyword">public</span>: |
---|
| 73 | 00081 <a class="code" href="namespaceOgre.html#a471">String</a> doGet(<span class="keyword">const</span> <span class="keywordtype">void</span>* target) <span class="keyword">const</span>; |
---|
| 74 | 00082 <span class="keywordtype">void</span> doSet(<span class="keywordtype">void</span>* target, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& val); |
---|
| 75 | 00083 }; |
---|
| 76 | <a name="l00085"></a><a class="code" href="classOgre_1_1Font_1_1CmdSource.html">00085</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> CmdSource : <span class="keyword">public</span> <a class="code" href="classOgre_1_1ParamCommand.html">ParamCommand</a> |
---|
| 77 | 00086 { |
---|
| 78 | 00087 <span class="keyword">public</span>: |
---|
| 79 | 00088 <a class="code" href="namespaceOgre.html#a471">String</a> doGet(<span class="keyword">const</span> <span class="keywordtype">void</span>* target) <span class="keyword">const</span>; |
---|
| 80 | 00089 <span class="keywordtype">void</span> doSet(<span class="keywordtype">void</span>* target, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& val); |
---|
| 81 | 00090 }; |
---|
| 82 | <a name="l00092"></a><a class="code" href="classOgre_1_1Font_1_1CmdSize.html">00092</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> CmdSize : <span class="keyword">public</span> <a class="code" href="classOgre_1_1ParamCommand.html">ParamCommand</a> |
---|
| 83 | 00093 { |
---|
| 84 | 00094 <span class="keyword">public</span>: |
---|
| 85 | 00095 <a class="code" href="namespaceOgre.html#a471">String</a> doGet(<span class="keyword">const</span> <span class="keywordtype">void</span>* target) <span class="keyword">const</span>; |
---|
| 86 | 00096 <span class="keywordtype">void</span> doSet(<span class="keywordtype">void</span>* target, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& val); |
---|
| 87 | 00097 }; |
---|
| 88 | <a name="l00099"></a><a class="code" href="classOgre_1_1Font_1_1CmdResolution.html">00099</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> CmdResolution : <span class="keyword">public</span> <a class="code" href="classOgre_1_1ParamCommand.html">ParamCommand</a> |
---|
| 89 | 00100 { |
---|
| 90 | 00101 <span class="keyword">public</span>: |
---|
| 91 | 00102 <a class="code" href="namespaceOgre.html#a471">String</a> doGet(<span class="keyword">const</span> <span class="keywordtype">void</span>* target) <span class="keyword">const</span>; |
---|
| 92 | 00103 <span class="keywordtype">void</span> doSet(<span class="keywordtype">void</span>* target, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& val); |
---|
| 93 | 00104 }; |
---|
| 94 | 00105 |
---|
| 95 | 00106 <span class="comment">// Command object for setting / getting parameters</span> |
---|
| 96 | <a name="l00107"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontt0">00107</a> <span class="keyword">static</span> CmdType msTypeCmd; |
---|
| 97 | <a name="l00108"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontt1">00108</a> <span class="keyword">static</span> CmdSource msSourceCmd; |
---|
| 98 | <a name="l00109"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontt2">00109</a> <span class="keyword">static</span> CmdSize msSizeCmd; |
---|
| 99 | <a name="l00110"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontt3">00110</a> <span class="keyword">static</span> CmdResolution msResolutionCmd; |
---|
| 100 | 00111 |
---|
| 101 | <a name="l00113"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp0">00113</a> <a class="code" href="namespaceOgre.html#a655">FontType</a> mType; |
---|
| 102 | 00114 |
---|
| 103 | <a name="l00116"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp1">00116</a> <a class="code" href="namespaceOgre.html#a471">String</a> mSource; |
---|
| 104 | 00117 |
---|
| 105 | <a name="l00119"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp2">00119</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mTtfSize; |
---|
| 106 | <a name="l00121"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp3">00121</a> <a class="code" href="namespaceOgre.html#a468">uint</a> mTtfResolution; |
---|
| 107 | 00122 |
---|
| 108 | 00123 |
---|
| 109 | <a name="l00125"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp4">00125</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mTexCoords_u1[<a class="code" href="OgreFont_8h.html#a0">OGRE_NUM_GLYPHS</a>]; |
---|
| 110 | <a name="l00127"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp5">00127</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mTexCoords_u2[<a class="code" href="OgreFont_8h.html#a0">OGRE_NUM_GLYPHS</a>]; |
---|
| 111 | <a name="l00129"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp6">00129</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mTexCoords_v1[<a class="code" href="OgreFont_8h.html#a0">OGRE_NUM_GLYPHS</a>]; |
---|
| 112 | <a name="l00131"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp7">00131</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mTexCoords_v2[<a class="code" href="OgreFont_8h.html#a0">OGRE_NUM_GLYPHS</a>]; |
---|
| 113 | 00132 |
---|
| 114 | <a name="l00134"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp8">00134</a> <a class="code" href="namespaceOgre.html#a465">Real</a> mAspectRatio[<a class="code" href="OgreFont_8h.html#a0">OGRE_NUM_GLYPHS</a>]; |
---|
| 115 | 00135 |
---|
| 116 | <a name="l00137"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp9">00137</a> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a> mpMaterial; |
---|
| 117 | 00138 |
---|
| 118 | <a name="l00140"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp10">00140</a> <a class="code" href="classOgre_1_1TexturePtr.html">TexturePtr</a> mTexture; |
---|
| 119 | 00141 |
---|
| 120 | <a name="l00143"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontp11">00143</a> <span class="keywordtype">bool</span> mAntialiasColour; |
---|
| 121 | 00144 |
---|
| 122 | 00146 <span class="keywordtype">void</span> createTextureFromFont(<span class="keywordtype">void</span>); |
---|
| 123 | 00147 |
---|
| 124 | 00149 <span class="keyword">virtual</span> <span class="keywordtype">void</span> loadImpl(); |
---|
| 125 | 00151 <span class="keyword">virtual</span> <span class="keywordtype">void</span> unloadImpl(); |
---|
| 126 | <a name="l00153"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fontb3">00153</a> size_t calculateSize(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } <span class="comment">// permanent resource is in the texture </span> |
---|
| 127 | 00154 <span class="keyword">public</span>: |
---|
| 128 | 00155 |
---|
| 129 | 00159 Font(<a class="code" href="classOgre_1_1ResourceManager.html">ResourceManager</a>* creator, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& name, <a class="code" href="namespaceOgre.html#a529">ResourceHandle</a> handle, |
---|
| 130 | 00160 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& group, <span class="keywordtype">bool</span> isManual = <span class="keyword">false</span>, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader = 0); |
---|
| 131 | 00161 <span class="keyword">virtual</span> ~Font(); |
---|
| 132 | 00162 |
---|
| 133 | 00164 <span class="keywordtype">void</span> setType(FontType ftype); |
---|
| 134 | 00165 |
---|
| 135 | 00167 <a class="code" href="namespaceOgre.html#a655">FontType</a> getType(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
| 136 | 00168 |
---|
| 137 | 00182 <span class="keywordtype">void</span> setSource(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& source); |
---|
| 138 | 00183 |
---|
| 139 | 00186 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& getSource(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
| 140 | 00187 |
---|
| 141 | 00193 <span class="keywordtype">void</span> setTrueTypeSize(<a class="code" href="namespaceOgre.html#a465">Real</a> ttfSize); |
---|
| 142 | 00198 <span class="keywordtype">void</span> setTrueTypeResolution(<a class="code" href="namespaceOgre.html#a468">uint</a> ttfResolution); |
---|
| 143 | 00199 |
---|
| 144 | 00206 <a class="code" href="namespaceOgre.html#a465">Real</a> getTrueTypeSize(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
| 145 | 00211 <a class="code" href="namespaceOgre.html#a468">uint</a> getTrueTypeResolution(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
| 146 | 00212 |
---|
| 147 | 00215 std::pair< uint, uint > StrBBox( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a> & text, <a class="code" href="namespaceOgre.html#a465">Real</a> char_height, <a class="code" href="classOgre_1_1RenderWindow.html">RenderWindow</a> & window ); |
---|
| 148 | 00216 |
---|
| 149 | 00217 |
---|
| 150 | <a name="l00223"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta11">00223</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> getGlyphTexCoords(OgreChar <span class="keywordtype">id</span>, <a class="code" href="namespaceOgre.html#a465">Real</a>& u1, <a class="code" href="namespaceOgre.html#a465">Real</a>& v1, <a class="code" href="namespaceOgre.html#a465">Real</a>& u2, <a class="code" href="namespaceOgre.html#a465">Real</a>& v2 )<span class="keyword"> const</span> |
---|
| 151 | 00224 <span class="keyword"> </span>{ |
---|
| 152 | 00225 <span class="keywordtype">unsigned</span> <a class="code" href="OgrePrerequisites_8h.html#a6">OgreChar</a> idx = <a class="code" href="OgreFont_8h.html#a1">OGRE_GLYPH_INDEX</a>(<span class="keywordtype">id</span>); |
---|
| 153 | 00226 u1 = mTexCoords_u1[ idx ]; |
---|
| 154 | 00227 v1 = mTexCoords_v1[ idx ]; |
---|
| 155 | 00228 u2 = mTexCoords_u2[ idx ]; |
---|
| 156 | 00229 v2 = mTexCoords_v2[ idx ]; |
---|
| 157 | 00230 } |
---|
| 158 | 00231 |
---|
| 159 | <a name="l00238"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta12">00238</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setGlyphTexCoords( OgreChar <span class="keywordtype">id</span>, <a class="code" href="namespaceOgre.html#a465">Real</a> u1, <a class="code" href="namespaceOgre.html#a465">Real</a> v1, <a class="code" href="namespaceOgre.html#a465">Real</a> u2, <a class="code" href="namespaceOgre.html#a465">Real</a> v2 ) |
---|
| 160 | 00239 { |
---|
| 161 | 00240 <span class="keywordtype">unsigned</span> <a class="code" href="OgrePrerequisites_8h.html#a6">OgreChar</a> idx = <a class="code" href="OgreFont_8h.html#a1">OGRE_GLYPH_INDEX</a>(<span class="keywordtype">id</span>); |
---|
| 162 | 00241 mTexCoords_u1[ idx ] = u1; |
---|
| 163 | 00242 mTexCoords_v1[ idx ] = v1; |
---|
| 164 | 00243 mTexCoords_u2[ idx ] = u2; |
---|
| 165 | 00244 mTexCoords_v2[ idx ] = v2; |
---|
| 166 | 00245 mAspectRatio[ idx ] = ( u2 - u1 ) / ( v2 - v1 ); |
---|
| 167 | 00246 } |
---|
| 168 | <a name="l00248"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta13">00248</a> <span class="keyword">inline</span> <a class="code" href="namespaceOgre.html#a465">Real</a> getGlyphAspectRatio( OgreChar <span class="keywordtype">id</span> )<span class="keyword"> const</span> |
---|
| 169 | 00249 <span class="keyword"> </span>{ |
---|
| 170 | 00250 <span class="keywordtype">unsigned</span> <a class="code" href="OgrePrerequisites_8h.html#a6">OgreChar</a> idx = <a class="code" href="OgreFont_8h.html#a1">OGRE_GLYPH_INDEX</a>(<span class="keywordtype">id</span>); |
---|
| 171 | 00251 <span class="keywordflow">return</span> mAspectRatio[ idx ]; |
---|
| 172 | 00252 } |
---|
| 173 | <a name="l00258"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta14">00258</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setGlyphAspectRatio( OgreChar <span class="keywordtype">id</span>, <a class="code" href="namespaceOgre.html#a465">Real</a> ratio ) |
---|
| 174 | 00259 { |
---|
| 175 | 00260 <span class="keywordtype">unsigned</span> <a class="code" href="OgrePrerequisites_8h.html#a6">OgreChar</a> idx = <a class="code" href="OgreFont_8h.html#a1">OGRE_GLYPH_INDEX</a>(<span class="keywordtype">id</span>); |
---|
| 176 | 00261 mAspectRatio[ idx ] = ratio; |
---|
| 177 | 00262 } |
---|
| 178 | <a name="l00267"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta15">00267</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& getMaterial()<span class="keyword"> const</span> |
---|
| 179 | 00268 <span class="keyword"> </span>{ |
---|
| 180 | 00269 <span class="keywordflow">return</span> mpMaterial; |
---|
| 181 | 00270 } |
---|
| 182 | <a name="l00275"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta16">00275</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& getMaterial() |
---|
| 183 | 00276 { |
---|
| 184 | 00277 <span class="keywordflow">return</span> mpMaterial; |
---|
| 185 | 00278 } |
---|
| 186 | <a name="l00290"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta17">00290</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setAntialiasColour(<span class="keywordtype">bool</span> enabled) |
---|
| 187 | 00291 { |
---|
| 188 | 00292 mAntialiasColour = enabled; |
---|
| 189 | 00293 } |
---|
| 190 | 00294 |
---|
| 191 | <a name="l00298"></a><a class="code" href="classOgre_1_1Font.html#Ogre_1_1Fonta18">00298</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> getAntialiasColour(<span class="keywordtype">void</span>)<span class="keyword"> const</span> |
---|
| 192 | 00299 <span class="keyword"> </span>{ |
---|
| 193 | 00300 <span class="keywordflow">return</span> mAntialiasColour; |
---|
| 194 | 00301 } |
---|
| 195 | 00302 |
---|
| 196 | 00306 <span class="keywordtype">void</span> loadResource(<a class="code" href="classOgre_1_1Resource.html">Resource</a>* resource); |
---|
| 197 | 00307 }; |
---|
| 198 | <a name="l00314"></a><a class="code" href="classOgre_1_1FontPtr.html">00314</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> FontPtr : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Font> |
---|
| 199 | 00315 { |
---|
| 200 | 00316 <span class="keyword">public</span>: |
---|
| 201 | <a name="l00317"></a><a class="code" href="classOgre_1_1FontPtr.html#Ogre_1_1FontPtra0">00317</a> FontPtr() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Font>() {} |
---|
| 202 | <a name="l00318"></a><a class="code" href="classOgre_1_1FontPtr.html#Ogre_1_1FontPtra1">00318</a> <span class="keyword">explicit</span> FontPtr(Font* rep) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Font>(rep) {} |
---|
| 203 | <a name="l00319"></a><a class="code" href="classOgre_1_1FontPtr.html#Ogre_1_1FontPtra2">00319</a> FontPtr(<span class="keyword">const</span> FontPtr& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Font>(r) {} |
---|
| 204 | <a name="l00320"></a><a class="code" href="classOgre_1_1FontPtr.html#Ogre_1_1FontPtra3">00320</a> FontPtr(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Font>() |
---|
| 205 | 00321 { |
---|
| 206 | 00322 <span class="comment">// lock & copy other mutex pointer</span> |
---|
| 207 | 00323 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
| 208 | 00324 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
| 209 | 00325 pRep = static_cast<Font*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
| 210 | 00326 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
| 211 | 00327 <span class="keywordflow">if</span> (pUseCount) |
---|
| 212 | 00328 { |
---|
| 213 | 00329 ++(*pUseCount); |
---|
| 214 | 00330 } |
---|
| 215 | 00331 } |
---|
| 216 | 00332 |
---|
| 217 | <a name="l00334"></a><a class="code" href="classOgre_1_1FontPtr.html#Ogre_1_1FontPtra4">00334</a> FontPtr& operator=(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) |
---|
| 218 | 00335 { |
---|
| 219 | 00336 <span class="keywordflow">if</span> (pRep == static_cast<Font*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
| 220 | 00337 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
| 221 | 00338 release(); |
---|
| 222 | 00339 <span class="comment">// lock & copy other mutex pointer</span> |
---|
| 223 | 00340 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
| 224 | 00341 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
| 225 | 00342 pRep = static_cast<Font*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
| 226 | 00343 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
| 227 | 00344 <span class="keywordflow">if</span> (pUseCount) |
---|
| 228 | 00345 { |
---|
| 229 | 00346 ++(*pUseCount); |
---|
| 230 | 00347 } |
---|
| 231 | 00348 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
| 232 | 00349 } |
---|
| 233 | 00350 }; |
---|
| 234 | 00351 } |
---|
| 235 | 00352 |
---|
| 236 | 00353 <span class="preprocessor">#endif</span> |
---|
| 237 | </pre></div><hr> |
---|
| 238 | <p> |
---|
| 239 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
| 240 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
| 241 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
| 242 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
| 243 | <Work rdf:about=""> |
---|
| 244 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
| 245 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
| 246 | </Work> |
---|
| 247 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
| 248 | |
---|
| 249 | Last modified Sun Mar 12 14:37:40 2006 |
---|
| 250 | </p> |
---|
| 251 | </body> |
---|
| 252 | </html> |
---|