BsPrerequisitesUtil.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include <assert.h>
  5. /** @defgroup Layers Layers
  6. * User facing API for the engine core, categorized per layer.
  7. * @{
  8. */
  9. /** @defgroup Utility Utility
  10. * Lowest layer of the engine containing various utility and helper classes.
  11. * @{
  12. */
  13. /** @defgroup Containers Containers
  14. * Templated commonly used containers.
  15. */
  16. /** @defgroup Debug Debug
  17. * Various debugging helpers.
  18. */
  19. /** @defgroup Error Error handling
  20. * Handling and reporting errors.
  21. */
  22. /** @defgroup Filesystem File system
  23. * Manipulating, reading and writing files.
  24. */
  25. /** @defgroup General General
  26. * General utility functionality that doesn't fit in any other category.
  27. */
  28. /** @defgroup Image Image
  29. * Manipulating images.
  30. */
  31. /** @defgroup Math Math
  32. * Variety of general purpose math functionality.
  33. */
  34. /** @defgroup Memory Memory
  35. * Allocators, deallocators and memory manipulation.
  36. */
  37. /** @defgroup Platform-Utility Platform
  38. * %Platform specific functionality.
  39. */
  40. /** @defgroup RTTI RTTI
  41. * Run-time type information defining and querying.
  42. */
  43. /** @cond RTTI */
  44. /** @defgroup RTTI-Impl-Utility RTTI types
  45. * RTTI implementations for classes within the utility layer.
  46. */
  47. /** @endcond */
  48. /** @defgroup Serialization Serialization
  49. * Serialization and deserialization of native objects.
  50. */
  51. /** @defgroup String String
  52. * String manipulation.
  53. */
  54. /** @defgroup Testing Testing
  55. * Running unit tests.
  56. */
  57. /** @defgroup Threading Threading
  58. * Thread manipulation and synchronization.
  59. */
  60. /** @} */
  61. /** @} */
  62. /** @defgroup Internals Internals
  63. * Non-user-facing low-level classes and methods, useful primarily to those modifying the engine.
  64. * @{
  65. */
  66. /** @defgroup Utility-Internal Utility
  67. * Lowest layer of the engine containing various utility and helper classes.
  68. * @{
  69. */
  70. /** @defgroup Error-Internal Error handling
  71. * Handling and reporting errors.
  72. */
  73. /** @defgroup General-Internal General
  74. * Utility functionality that doesn't fit in any other category.
  75. */
  76. /** @defgroup Memory-Internal Memory
  77. * Allocators, deallocators and memory manipulation.
  78. */
  79. /** @defgroup Platform-Utility-Internal Platform
  80. * Platform specific functionality.
  81. */
  82. /** @defgroup RTTI-Internal RTTI
  83. * Run-time type information defining and querying.
  84. */
  85. /** @defgroup Serialization-Internal Serialization
  86. * Serialization and deserialization of native objects.
  87. */
  88. /** @defgroup String-Internal String
  89. * String manipulation.
  90. */
  91. /** @defgroup Threading-Internal Threading
  92. * Thread manipulation and synchronization.
  93. */
  94. /** @} */
  95. /** @} */
  96. /** @defgroup Plugins Plugins
  97. * Reference documentation for implementations of various plugins, useful primarily to those extending the engine.
  98. */
  99. /** @defgroup Implementation [IMPLEMENTATION]
  100. * Very specialized base classes, templates and helper code used for construction of more concrete types.
  101. */
  102. // 0 - No thread support
  103. // 1 - Render system is thread safe (TODO: NOT WORKING and will probably be removed)
  104. // 2 - Thread support but render system can only be accessed from main thread
  105. #define BS_THREAD_SUPPORT 2
  106. #define BS_PROFILING_ENABLED 1
  107. // Versions
  108. #define BS_VER_DEV 1
  109. #define BS_VER_PREVIEW 2
  110. #define BS_VER BS_VER_DEV
  111. // Platform-specific stuff
  112. #include "BsPlatformDefines.h"
  113. #if BS_COMPILER == BS_COMPILER_MSVC
  114. // TODO - This is not deactivated anywhere, therefore it applies to any file that includes this header.
  115. // - Right now I don't have an easier way to apply these warnings globally so I'm keeping it this way.
  116. // Secure versions aren't multiplatform, so we won't be using them
  117. #if !defined(_CRT_SECURE_NO_WARNINGS)
  118. #define _CRT_SECURE_NO_WARNINGS
  119. #endif
  120. // disable: "<type> needs to have dll-interface to be used by clients'
  121. // Happens on STL member variables which are not public therefore is ok
  122. # pragma warning (disable: 4251)
  123. // disable: 'X' Function call with parameters that may be unsafe
  124. # pragma warning(disable: 4996)
  125. // disable: decorated name length exceeded, name was truncated
  126. // Happens with really long type names. Even fairly standard use
  127. // of std::unordered_map with custom parameters, meaning I can't
  128. // really do much to avoid it. It shouldn't effect execution
  129. // but might cause problems if you compile library
  130. // with one compiler and use it in another.
  131. # pragma warning(disable: 4503)
  132. // disable: C++ exception handler used, but unwind semantics are not enabled
  133. // We don't care about this as any exception is meant to crash the program.
  134. # pragma warning(disable: 4530)
  135. #endif
  136. // Windows Settings
  137. #if BS_PLATFORM == BS_PLATFORM_WIN32
  138. // Win32 compilers use _DEBUG for specifying debug builds.
  139. // for MinGW, we set DEBUG
  140. # if defined(_DEBUG) || defined(DEBUG)
  141. # define BS_DEBUG_MODE 1
  142. # else
  143. # define BS_DEBUG_MODE 0
  144. # endif
  145. #endif
  146. // Linux/Apple Settings
  147. #if BS_PLATFORM == BS_PLATFORM_LINUX || BS_PLATFORM == BS_PLATFORM_OSX
  148. // A quick define to overcome different names for the same function
  149. # define stricmp strcasecmp
  150. # ifdef DEBUG
  151. # define BS_DEBUG_MODE 1
  152. # else
  153. # define BS_DEBUG_MODE 0
  154. # endif
  155. #endif
  156. #if BS_DEBUG_MODE
  157. #define BS_DEBUG_ONLY(x) x
  158. #define BS_ASSERT(x) assert(x)
  159. #else
  160. #define BS_DEBUG_ONLY(x)
  161. #define BS_ASSERT(x)
  162. #endif
  163. // Short-hand names for various built-in types
  164. #include "BsTypes.h"
  165. #include "BsMemoryAllocator.h"
  166. // Useful threading defines
  167. #include "BsThreadDefines.h"
  168. // Commonly used standard headers
  169. #include "BsStdHeaders.h"
  170. // Forward declarations
  171. #include "BsFwdDeclUtil.h"
  172. #include "BsRTTIPrerequisites.h"
  173. #include "BsFlags.h"
  174. #include "BsString.h"
  175. #include "BsMessageHandlerFwd.h"
  176. #include "BsUtil.h"
  177. #include "BsPath.h"
  178. #include "BsStringID.h"
  179. #include "BsEvent.h"
  180. #include "BsPlatformUtility.h"
  181. #include "BsCrashHandler.h"