source: OGRE/trunk/ogrenew/Docs/api/html/OgrePlatform_8h-source.html @ 657

Revision 657, 20.3 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1<html>
2<head>
3<title>OgrePlatform.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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
10<h1>OgrePlatform.h</h1><a href="OgrePlatform_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="preprocessor">#ifndef __Platform_H_</span>
3500026 <span class="preprocessor"></span><span class="preprocessor">#define __Platform_H_</span>
3600027 <span class="preprocessor"></span>
3700028 <span class="preprocessor">#include "<a class="code" href="OgreConfig_8h.html">OgreConfig.h</a>"</span>
3800029
3900030 <span class="keyword">namespace </span>Ogre {
4000031 <span class="comment">/* Initial platform/compiler-related stuff to set.</span>
4100032 <span class="comment">*/</span>
42<a name="l00033"></a><a class="code" href="OgrePlatform_8h.html#a0">00033</a> <span class="preprocessor">#define OGRE_PLATFORM_WIN32 1</span>
43<a name="l00034"></a><a class="code" href="OgrePlatform_8h.html#a1">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_PLATFORM_LINUX 2</span>
44<a name="l00035"></a><a class="code" href="OgrePlatform_8h.html#a2">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_PLATFORM_APPLE 3</span>
4500036 <span class="preprocessor"></span>
46<a name="l00037"></a><a class="code" href="OgrePlatform_8h.html#a3">00037</a> <span class="preprocessor">#define OGRE_COMPILER_MSVC 1</span>
47<a name="l00038"></a><a class="code" href="OgrePlatform_8h.html#a4">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_COMPILER_GNUC 2</span>
48<a name="l00039"></a><a class="code" href="OgrePlatform_8h.html#a5">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_COMPILER_BORL 3</span>
4900040 <span class="preprocessor"></span>
50<a name="l00041"></a><a class="code" href="OgrePlatform_8h.html#a6">00041</a> <span class="preprocessor">#define OGRE_ENDIAN_LITTLE 1</span>
51<a name="l00042"></a><a class="code" href="OgrePlatform_8h.html#a7">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_ENDIAN_BIG 2</span>
5200043 <span class="preprocessor"></span>
53<a name="l00044"></a><a class="code" href="OgrePlatform_8h.html#a8">00044</a> <span class="preprocessor">#define OGRE_ARCHITECTURE_32 1</span>
54<a name="l00045"></a><a class="code" href="OgrePlatform_8h.html#a9">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_ARCHITECTURE_64 2</span>
5500046 <span class="preprocessor"></span>
5600047 <span class="comment">/* Finds the compiler type and version.</span>
5700048 <span class="comment">*/</span>
5800049 <span class="preprocessor">#if defined( _MSC_VER )</span>
5900050 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMPILER OGRE_COMPILER_MSVC</span>
6000051 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMP_VER _MSC_VER</span>
6100052 <span class="preprocessor"></span>
6200053 <span class="preprocessor">#elif defined( __GNUC__ )</span>
6300054 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMPILER OGRE_COMPILER_GNUC</span>
6400055 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMP_VER (((__GNUC__)*100) + \</span>
6500056 <span class="preprocessor">        (__GNUC_MINOR__*10) + \</span>
6600057 <span class="preprocessor">        __GNUC_PATCHLEVEL__)</span>
6700058 <span class="preprocessor"></span>
6800059 <span class="preprocessor">#elif defined( __BORLANDC__ )</span>
6900060 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMPILER OGRE_COMPILER_BORL</span>
7000061 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_COMP_VER __BCPLUSPLUS__</span>
7100062 <span class="preprocessor"></span>
7200063 <span class="preprocessor">#else</span>
7300064 <span class="preprocessor"></span><span class="preprocessor">#   pragma error "No known compiler. Abort! Abort!"</span>
7400065 <span class="preprocessor"></span>
7500066 <span class="preprocessor">#endif</span>
7600067 <span class="preprocessor"></span>
7700068 <span class="comment">/* See if we can use __forceinline or if we need to use __inline instead */</span>
7800069 <span class="preprocessor">#if OGRE_COMPILER == OGRE_COMPILER_MSVC </span>
7900070 <span class="preprocessor"></span><span class="preprocessor">#   if OGRE_COMP_VER &gt;= 1200</span>
8000071 <span class="preprocessor"></span><span class="preprocessor">#       define FORCEINLINE __forceinline</span>
8100072 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>
8200073 <span class="preprocessor"></span><span class="preprocessor">#else</span>
83<a name="l00074"></a><a class="code" href="OgrePlatform_8h.html#a10">00074</a> <span class="preprocessor"></span><span class="preprocessor">#   define FORCEINLINE __inline</span>
8400075 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
8500076 <span class="preprocessor"></span>
8600077 <span class="comment">/* Finds the current platform */</span>
8700078
8800079 <span class="preprocessor">#if defined( __WIN32__ ) || defined( _WIN32 )</span>
8900080 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_PLATFORM OGRE_PLATFORM_WIN32</span>
9000081 <span class="preprocessor"></span>
9100082 <span class="preprocessor">#elif defined( __APPLE_CC__)</span>
9200083 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_PLATFORM OGRE_PLATFORM_APPLE</span>
9300084 <span class="preprocessor"></span>
9400085 <span class="preprocessor">#else</span>
95<a name="l00086"></a><a class="code" href="OgrePlatform_8h.html#a11">00086</a> <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_PLATFORM OGRE_PLATFORM_LINUX</span>
9600087 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
9700088 <span class="preprocessor"></span>
9800089 <span class="comment">/* Find the arch type */</span>
9900090 <span class="preprocessor">#if defined(__x86_64__)</span>
10000091 <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64</span>
10100092 <span class="preprocessor"></span><span class="preprocessor">#else</span>
102<a name="l00093"></a><a class="code" href="OgrePlatform_8h.html#a12">00093</a> <span class="preprocessor"></span><span class="preprocessor">#   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32</span>
10300094 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
10400095 <span class="preprocessor"></span><span class="comment">// For generating compiler warnings - should work on any compiler</span>
10500096 <span class="comment">// As a side note, if you start your message with 'Warning: ', the MSVC</span>
10600097 <span class="comment">// IDE actually does catch a warning :)</span>
107<a name="l00098"></a><a class="code" href="OgrePlatform_8h.html#a13">00098</a> <span class="preprocessor">#define OGRE_QUOTE_INPLACE(x) # x</span>
108<a name="l00099"></a><a class="code" href="OgrePlatform_8h.html#a14">00099</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_QUOTE(x) OGRE_QUOTE_INPLACE(x)</span>
109<a name="l00100"></a><a class="code" href="OgrePlatform_8h.html#a15">00100</a> <span class="preprocessor"></span><span class="preprocessor">#define OGRE_WARN( x )  message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )</span>
11000101 <span class="preprocessor"></span>
11100102 <span class="comment">//----------------------------------------------------------------------------</span>
11200103 <span class="comment">// Windows Settings</span>
11300104 <span class="preprocessor">#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32</span>
11400105 <span class="preprocessor"></span>
11500106 <span class="comment">// If we're not including this from a client build, specify that the stuff</span>
11600107 <span class="comment">// should get exported. Otherwise, import it.</span>
11700108 <span class="preprocessor">#   if defined( __MINGW32__ )</span>
11800109 <span class="preprocessor"></span>        <span class="comment">// Linux compilers don't have symbol import/export directives.</span>
11900110 <span class="preprocessor">#       define _OgreExport</span>
12000111 <span class="preprocessor"></span><span class="preprocessor">#       define _OgrePrivate</span>
12100112 <span class="preprocessor"></span><span class="preprocessor">#   else</span>
12200113 <span class="preprocessor"></span><span class="preprocessor">#       if defined( OGRE_NONCLIENT_BUILD )</span>
12300114 <span class="preprocessor"></span><span class="preprocessor">#           define _OgreExport __declspec( dllexport )</span>
12400115 <span class="preprocessor"></span><span class="preprocessor">#       else</span>
12500116 <span class="preprocessor"></span><span class="preprocessor">#           define _OgreExport __declspec( dllimport )</span>
12600117 <span class="preprocessor"></span><span class="preprocessor">#       endif</span>
12700118 <span class="preprocessor"></span><span class="preprocessor">#       define _OgrePrivate</span>
12800119 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>
12900120 <span class="preprocessor"></span><span class="comment">// Win32 compilers use _DEBUG for specifying debug builds.</span>
13000121 <span class="preprocessor">#   ifdef _DEBUG</span>
13100122 <span class="preprocessor"></span><span class="preprocessor">#       define OGRE_DEBUG_MODE 1</span>
13200123 <span class="preprocessor"></span><span class="preprocessor">#   else</span>
13300124 <span class="preprocessor"></span><span class="preprocessor">#       define OGRE_DEBUG_MODE 0</span>
13400125 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>
13500126 <span class="preprocessor"></span>
13600127 <span class="preprocessor">#if defined( __MINGW32__ )</span>
13700128 <span class="preprocessor"></span><span class="preprocessor">    #define EXT_HASH</span>
13800129 <span class="preprocessor"></span><span class="preprocessor">#else</span>
13900130 <span class="preprocessor"></span><span class="preprocessor">    #define snprintf _snprintf</span>
14000131 <span class="preprocessor"></span><span class="preprocessor">    #define vsnprintf _vsnprintf</span>
14100132 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
14200133 <span class="preprocessor"></span>
14300134 <span class="preprocessor">#if OGRE_DEBUG_MODE</span>
14400135 <span class="preprocessor"></span><span class="preprocessor">    #define OGRE_PLATFORM_LIB "OgrePlatform_d.dll"</span>
14500136 <span class="preprocessor"></span><span class="preprocessor">#else</span>
14600137 <span class="preprocessor"></span><span class="preprocessor">    #define OGRE_PLATFORM_LIB "OgrePlatform.dll"</span>
14700138 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
14800139 <span class="preprocessor"></span>
14900140 <span class="preprocessor">#endif</span>
15000141 <span class="preprocessor"></span><span class="comment">//----------------------------------------------------------------------------</span>
15100142
15200143 <span class="comment">//----------------------------------------------------------------------------</span>
15300144 <span class="comment">// Linux/Apple Settings</span>
15400145 <span class="preprocessor">#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE</span>
15500146 <span class="preprocessor"></span>
15600147 <span class="comment">// Enable GCC 4.0 symbol visibility </span>
15700148 <span class="preprocessor">#   if OGRE_COMP_VER &gt;= 400</span>
15800149 <span class="preprocessor"></span><span class="preprocessor">#       define _OgreExport  __attribute__ ((visibility("default")))</span>
15900150 <span class="preprocessor"></span><span class="preprocessor">#       define _OgrePrivate __attribute__ ((visibility("hidden")))</span>
16000151 <span class="preprocessor"></span><span class="preprocessor">#   else</span>
161<a name="l00152"></a><a class="code" href="OgrePlatform_8h.html#a16">00152</a> <span class="preprocessor"></span><span class="preprocessor">#       define _OgreExport</span>
162<a name="l00153"></a><a class="code" href="OgrePlatform_8h.html#a17">00153</a> <span class="preprocessor"></span><span class="preprocessor">#       define _OgrePrivate</span>
16300154 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>
16400155 <span class="preprocessor"></span>
16500156 <span class="comment">// A quick define to overcome different names for the same function</span>
166<a name="l00157"></a><a class="code" href="OgrePlatform_8h.html#a18">00157</a> <span class="preprocessor">#   define stricmp strcasecmp</span>
16700158 <span class="preprocessor"></span>
16800159 <span class="comment">// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when</span>
16900160 <span class="comment">// specifying a debug build.</span>
17000161 <span class="preprocessor">#   ifdef DEBUG</span>
17100162 <span class="preprocessor"></span><span class="preprocessor">#       define OGRE_DEBUG_MODE 1</span>
17200163 <span class="preprocessor"></span><span class="preprocessor">#   else</span>
173<a name="l00164"></a><a class="code" href="OgrePlatform_8h.html#a19">00164</a> <span class="preprocessor"></span><span class="preprocessor">#       define OGRE_DEBUG_MODE 0</span>
17400165 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>
17500166 <span class="preprocessor"></span>
17600167 <span class="preprocessor">#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE</span>
17700168 <span class="preprocessor"></span><span class="preprocessor">    #define OGRE_PLATFORM_LIB "OgrePlatform.bundle"</span>
17800169 <span class="preprocessor"></span><span class="preprocessor">#else</span>
17900170 <span class="preprocessor"></span>    <span class="comment">//OGRE_PLATFORM_LINUX</span>
180<a name="l00171"></a><a class="code" href="OgrePlatform_8h.html#a20">00171</a> <span class="preprocessor">    #define OGRE_PLATFORM_LIB "libOgrePlatform.so"</span>
18100172 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
18200173 <span class="preprocessor"></span>
18300174 <span class="preprocessor">#endif</span>
18400175 <span class="preprocessor"></span>
18500176 <span class="comment">//For apple, we always have a custom config.h file</span>
18600177 <span class="preprocessor">#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE</span>
18700178 <span class="preprocessor"></span><span class="preprocessor">#    include "config.h"</span>
18800179 <span class="comment">//SDL_main must be included in the file that contains</span>
18900180 <span class="comment">//the application's main() function.</span>
19000181 <span class="preprocessor">#ifndef OGRE_NONCLIENT_BUILD</span>
19100182 <span class="preprocessor"></span><span class="preprocessor">#   include &lt;SDL/SDL_main.h&gt;</span>
19200183 <span class="preprocessor">#endif</span>
19300184 <span class="preprocessor"></span>
19400185 <span class="preprocessor">#endif</span>
19500186 <span class="preprocessor"></span>
19600187 <span class="comment">//----------------------------------------------------------------------------</span>
19700188
19800189 <span class="comment">//----------------------------------------------------------------------------</span>
19900190 <span class="comment">// Endian Settings</span>
20000191 <span class="comment">// check for BIG_ENDIAN config flag, set OGRE_ENDIAN correctly</span>
20100192 <span class="preprocessor">#ifdef CONFIG_BIG_ENDIAN</span>
20200193 <span class="preprocessor"></span><span class="preprocessor">#    define OGRE_ENDIAN OGRE_ENDIAN_BIG</span>
20300194 <span class="preprocessor"></span><span class="preprocessor">#else</span>
204<a name="l00195"></a><a class="code" href="OgrePlatform_8h.html#a21">00195</a> <span class="preprocessor"></span><span class="preprocessor">#    define OGRE_ENDIAN OGRE_ENDIAN_LITTLE</span>
20500196 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
20600197 <span class="preprocessor"></span>
20700198 <span class="comment">// Integer formats of fixed bit width</span>
208<a name="l00199"></a><a class="code" href="namespaceOgre.html#a412">00199</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespaceOgre.html#a412">uint32</a>;
209<a name="l00200"></a><a class="code" href="namespaceOgre.html#a413">00200</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="namespaceOgre.html#a413">uint16</a>;
210<a name="l00201"></a><a class="code" href="namespaceOgre.html#a414">00201</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="namespaceOgre.html#a414">uint8</a>;
21100202
21200203 }
21300204
21400205 <span class="preprocessor">#endif</span>
215</pre></div><hr>
216<p>
217Copyright &copy; 2000-2005 by The OGRE Team<br />
218<!--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/>
219This 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/>
220                <!--/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#">
221                <Work rdf:about="">
222                        <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
223        <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
224                </Work>
225                <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> -->
226
227Last modified Sun Feb 12 12:59:50 2006
228</p>
229</body>
230</html>
Note: See TracBrowser for help on using the repository browser.