All functionality that needs different implemenations per platform will go in here. More...
Functions | |
Whole | GetCPUCount () |
Get the amount of logical processors, a reasononable amount to use for thread creation. More... | |
String | GetPlatform () |
Gets the platform currently being run on. More... | |
MaxInt | GetTimeStamp () |
Get a timestamp. More... | |
Whole | GetTimeStampResolution () |
Get the resolution of the timestamp in microseconds. More... | |
void | SanitizeWindowedRes (const Whole &Width, const Whole &Height, Whole &ActualWidth, Whole &ActualHeight) |
Gets cleaned dimensions for a game window. More... | |
All functionality that needs different implemenations per platform will go in here.
If we did our jobs right You not need to change anything to compile on different platforms exvept the build target. If you want, the platform can be manually defined in this section and this should be the only place that you need to change to compile this on a supported platform. Just remark all the lines that are not your platform using "//" and unremark your platform.
Should you choose to port this to your platform, make sure that all the required libraries are installed, then make sure to write an implementation for each of the functions in crossplatform.cpp, then you should get to the nitty gritty of making the minor platforms inconsistencies work.
For most games there will be no need to directly call these functions, however if you decide you game is an exception, there is one key thing to remember about all of these functions. All of these may perform/behave slightly differently.
Whole Mezzanine::crossplatform::GetCPUCount | ( | ) |
Get the amount of logical processors, a reasononable amount to use for thread creation.
This returns whatever your OS thinks is the count of CPUs. This could include Hyperthreading unit on Intel's chip, or it might not, it could include the threads from Niagra CPUs or it might not, it could return just about any value on a given piece of and should return a reasonable value for how many threads should be used.
Definition at line 111 of file crossplatform.cpp.
String Mezzanine::crossplatform::GetPlatform | ( | ) |
Gets the platform currently being run on.
Definition at line 78 of file crossplatform.cpp.
MaxInt Mezzanine::crossplatform::GetTimeStamp | ( | ) |
Get a timestamp.
Definition at line 105 of file crossplatform.cpp.
Whole Mezzanine::crossplatform::GetTimeStampResolution | ( | ) |
Get the resolution of the timestamp in microseconds.
Definition at line 108 of file crossplatform.cpp.
void Mezzanine::crossplatform::SanitizeWindowedRes | ( | const Whole & | Width, |
const Whole & | Height, | ||
Whole & | ActualWidth, | ||
Whole & | ActualHeight | ||
) |
Gets cleaned dimensions for a game window.
Width | The desired width of the window area. |
Height | The desired height of the window area. |
ActualWidth | The modified value of the rendering width, after window decorations have been taken into account. |
ActualHeight | The modified value of the rendering height, after window decorations have been taken into account. |
Definition at line 91 of file crossplatform.cpp.