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