BsPrerequisitesUtil.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #pragma once
  2. #include <assert.h>
  3. /** @defgroup Utility Utility
  4. * Lowest layer of the engine containing a collection of very decoupled and separate systems that are
  5. * likely to be used throughout all of the higher layers.
  6. * @{
  7. */
  8. /** @defgroup Math Math
  9. * Math utility library containing a variety of general purpose math functionality.
  10. */
  11. /** @defgroup RTTI RTTI
  12. * A set of systems for defining and using run-time type information.
  13. */
  14. /** @defgroup Serialization Serialization
  15. * A set of systems for serializing and deserializing native objects.
  16. */
  17. /** @defgroup Memory Memory
  18. * A set of methods and classes meant to manipulate memory.
  19. */
  20. /** @defgroup Containers Containers
  21. * Contains a set of templated commonly used containers.
  22. */
  23. /** @defgroup Debug Debug
  24. * Contains functionality used to help with debugging.
  25. */
  26. /** @defgroup Error Error handling
  27. * Contains functionality used for handling and reporting errors.
  28. */
  29. /** @defgroup Filesystem File system
  30. * Contains functionality used for manipulating, reading and writing files.
  31. */
  32. /** @defgroup General General
  33. * Contains general utility functionality that doesn't fit in any other category.
  34. */
  35. /** @defgroup Image Image
  36. * Contains various utility methods for manipulating images.
  37. */
  38. /** @defgroup String String
  39. * Contains functionality for manipulating strings.
  40. */
  41. /** @defgroup Testing Testing
  42. * Contains functionality for running unit tests.
  43. */
  44. /** @defgroup Threading Threading
  45. * Contains functionality for manipulating threads and thread synchronization.
  46. */
  47. /** @} */
  48. /** @defgroup Implementation Implementation
  49. * Contains various base and helper types that used by an implementation of some other type. These shouldn't even be part
  50. * of the class list but due to limitations in the documentation generation system they need to be somewhere. All elements
  51. * listed here should instead be found by browsing the public interfaces of the types that use them.
  52. */
  53. // 0 - No thread support
  54. // 1 - Render system is thread safe (TODO: NOT WORKING and will probably be removed)
  55. // 2 - Thread support but render system can only be accessed from main thread
  56. #define BS_THREAD_SUPPORT 2
  57. #define BS_PROFILING_ENABLED 1
  58. // Versions
  59. #define BS_VER_DEV 1
  60. #define BS_VER_PREVIEW 2
  61. #define BS_VER BS_VER_DEV
  62. // Platform-specific stuff
  63. #include "BsPlatformDefines.h"
  64. #if BS_COMPILER == BS_COMPILER_MSVC
  65. // TODO - This is not deactivated anywhere, therefore it applies to any file that includes this header.
  66. // - Right now I don't have an easier way to apply these warnings globally so I'm keeping it this way.
  67. // Secure versions aren't multiplatform, so we won't be using them
  68. #define _CRT_SECURE_NO_WARNINGS
  69. // disable: "<type> needs to have dll-interface to be used by clients'
  70. // Happens on STL member variables which are not public therefore is ok
  71. # pragma warning (disable: 4251)
  72. // disable: 'X' Function call with parameters that may be unsafe
  73. # pragma warning(disable: 4996)
  74. // disable: decorated name length exceeded, name was truncated
  75. // Happens with really long type names. Even fairly standard use
  76. // of std::unordered_map with custom parameters, meaning I can't
  77. // really do much to avoid it. It shouldn't effect execution
  78. // but might cause problems if you compile library
  79. // with one compiler and use it in another.
  80. # pragma warning(disable: 4503)
  81. // disable: C++ exception handler used, but unwind semantics are not enabled
  82. // We don't care about this as any exception is meant to crash the program.
  83. # pragma warning(disable: 4530)
  84. #endif
  85. // Short-hand names for various built-in types
  86. #include "BsTypes.h"
  87. #include "BsMemoryAllocator.h"
  88. // Useful threading defines
  89. #include "BsThreadDefines.h"
  90. // Commonly used standard headers
  91. #include "BsStdHeaders.h"
  92. // Forward declarations
  93. #include "BsFwdDeclUtil.h"
  94. #include "BsRTTIPrerequisites.h"
  95. #include "BsString.h"
  96. #include "BsMessageHandlerFwd.h"
  97. #include "BsUtil.h"
  98. #include "BsPath.h"
  99. #include "BsStringID.h"
  100. #include "BsEvent.h"
  101. #include "BsPlatformUtility.h"
  102. #include "BsCrashHandler.h"