Spinning Topp Logo BlackTopp Studios
inc
crossplatform.h
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _crossplatform_h
41 #define _crossplatform_h
42 ///////////////////////////////////////////////////////////////////////////////
43 /// @namespace Mezzanine::crossplatform
44 /// @brief All functionality that needs different implemenations per platform will go in here
45 /// @details If we did our jobs right You not need to change anything to compile on
46 /// different platforms exvept the build target. If you want, the platform can
47 /// be manually defined in this section and this should be the only place that you
48 /// need to change to compile this on a supported platform. Just remark all the
49 /// lines that are not your platform using "//" and unremark your platform.
50 /// \n\n
51 /// Should you choose to port this to your platform, make sure that all the
52 /// required libraries are installed, then make sure to write an implementation
53 /// for each of the functions in crossplatform.cpp, then you should get to the
54 /// nitty gritty of making the minor platforms inconsistencies work.
55 /// \n\n
56 /// For most games there will be no need to directly call these functions, however if you decide
57 /// your game is an exception, there is one key thing to remember about all of these functions.
58 /// All of these may perform/behave slightly differently.
59 ///////////////////////////////////////////////////////////////////////////////
60 
61 //Unremark one of these when not compiling with code::blocks or cmake
62 //#define MEZZ_LINUX
63 //#define MEZZ_MACOSX
64 //#define MEZZ_WINDOWS
65 
66 //End Choose Your Platform
67 ///////////////////////////////////////////////////////////////////////////////
68 
69 // Includes
70 #include "crossplatformexport.h"
71 #include "datatypes.h"
72 
73 
74 // Forward declaration for compatibility
75 /// @internal
76 namespace Ogre
77 {
78  class RenderWindow;
79 }
80 
81 struct SDL_Window;
82 
83 namespace Mezzanine
84 {
85  //Forward Declarations should go here
86  class Entresol;
87 
88  namespace crossplatform
89  {
90  /// @brief Gets the platform currently being run on.
91  /// @return Returns a string based on the platform. "Windows", "Linux", or "MacOSX".
93 
94  /// @brief Get a timestamp.
95  /// @warning On some platforms this requires a static initialization, an can cause undefined behavior if called before static initializations are complete
96  /// @return The largest size integer containing a timestamp that can be compared to other timestamps, but hads no guarantees for external value.
98 
99  #ifndef SWIG
100  /// @brief Get the resolution of the timestamp in microseconds.
101  /// @return A Whole which returns in millionths of a second the smallest unit of time that GetTimeStamp can measure.
103 
104  /// @brief Get the amount of logical processors, a reasononable amount to use for thread creation.
105  /// @details This returns whatever your OS thinks is the count of CPUs. This could include
106  /// Hyperthreading unit on Intel's chip, or it might not, it could include the threads from
107  /// Niagra CPUs or it might not, it could return just about any value on a given piece of
108  /// and should return a reasonable value for how many threads should be used.
109  /// @return A Whole containing the amount of processors.
111  #endif //SWIG
112  }// Crossplatform
113 }//Mezzanine
114 
115 #endif
This file is used on some platforms to determine what data should be read and written to and from a s...
All the definitions for datatypes as well as some basic conversion functions are defined here...
Whole GetTimeStampResolution()
Get the resolution of the timestamp in microseconds.
String GetPlatform()
Gets the platform currently being run on.
#define MEZZ_LIB
Some platforms require special decorations to denote what is exported/imported in a share library...
long long MaxInt
A large integer type suitable for compile time math and long term microsecond time keeping...
Definition: datatypes.h:190
Whole GetCPUCount()
Get the amount of logical processors, a reasononable amount to use for thread creation.
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Definition: datatypes.h:151
MaxInt GetTimeStamp()
Get a timestamp.
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159