BsCorePrerequisites.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPrerequisitesUtil.h"
  5. /** @addtogroup Layers
  6. * @{
  7. */
  8. /** @defgroup Core Core
  9. * Second lowest layer that provides core engine functionality and abstract interfaces for various systems.
  10. * @{
  11. */
  12. /** @defgroup CoreThread Core thread
  13. * Core objects and interaction with the core (rendering) thread.
  14. */
  15. /** @defgroup Importer Importer
  16. * Import of resources into engine friendly format.
  17. */
  18. /** @defgroup Input Input
  19. * Input (mouse, keyboard, gamepad, etc.).
  20. */
  21. /** @defgroup Localization Localization
  22. * GUI localization.
  23. */
  24. /** @defgroup Material Material
  25. * Materials, shaders and related functionality.
  26. */
  27. /** @defgroup Platform Platform
  28. * Interface for interacting with the platform (OS).
  29. */
  30. /** @defgroup Profiling Profiling
  31. * Measuring CPU and GPU execution times and memory usage.
  32. */
  33. /** @defgroup RenderAPI RenderAPI
  34. * Interface for interacting with the render API (DirectX, OpenGL, etc.).
  35. */
  36. /** @defgroup Renderer Renderer
  37. * Abstract interface and helper functionality for rendering scene objects.
  38. */
  39. /** @defgroup Resources Resources
  40. * Core resource types and resource management functionality (loading, saving, etc.).
  41. */
  42. /** @cond RTTI */
  43. /** @defgroup RTTI-Impl-Core RTTI types
  44. * RTTI implementations for classes within the core layer.
  45. */
  46. /** @endcond */
  47. /** @defgroup Scene Scene
  48. * Managing scene objects and their hierarchy.
  49. */
  50. /** @defgroup Text Text
  51. * Generating text geometry.
  52. */
  53. /** @defgroup Utility-Core Utility
  54. * Various utility methods and types used by the core layer.
  55. */
  56. /** @defgroup Application-Core Application
  57. * Entry point into the application and other general functionality.
  58. */
  59. /** @defgroup Components-Core Components
  60. * Built-in components (elements that may be attached to scene objects).
  61. */
  62. /** @defgroup Physics Physics
  63. * Physics system: colliders, triggers, rigidbodies, joints, scene queries, etc.
  64. */
  65. /** @defgroup Internal-Core [INTERNAL]
  66. * Low-level classes and methods not meant for normal use, useful for those that are modifying the engine.
  67. * @{
  68. */
  69. /** @defgroup CoreThread-Internal Core thread
  70. * Core objects and interaction with the core (rendering) thread.
  71. */
  72. /** @defgroup Importer-Internal Importer
  73. * Import of resources into engine friendly format.
  74. */
  75. /** @defgroup Input-Internal Input
  76. * Input (mouse, keyboard, gamepad, etc.).
  77. */
  78. /** @defgroup Localization-Internal Localization
  79. * GUI localization.
  80. */
  81. /** @defgroup Material-Internal Material
  82. * Materials, shaders and related functionality.
  83. */
  84. /** @defgroup Platform-Internal Platform
  85. * Interface for interacting with the platform (OS).
  86. */
  87. /** @defgroup Profiling-Internal Profiling
  88. * Measuring CPU and GPU execution times and memory usage.
  89. */
  90. /** @defgroup RenderAPI-Internal RenderAPI
  91. * Interface for interacting with the render API (DirectX, OpenGL, etc.).
  92. */
  93. /** @defgroup Renderer-Internal Renderer
  94. * Abstract interface and helper functionality for rendering scene objects.
  95. */
  96. /** @defgroup Resources-Internal Resources
  97. * Core resource types and resource management functionality (loading, saving, etc.).
  98. */
  99. /** @defgroup Scene-Internal Scene
  100. * Managing scene objects and their hierarchy.
  101. */
  102. /** @defgroup Text-Internal Text
  103. * Generating text geometry.
  104. */
  105. /** @defgroup Utility-Core-Internal Utility
  106. * Various utility methods and types used by the core layer.
  107. */
  108. /** @defgroup Physics-Internal Physics
  109. * Physics system: colliders, triggers, rigidbodies, joints, scene queries, etc.
  110. */
  111. /** @} */
  112. /** @} */
  113. /** @} */
  114. #define BS_MAX_MULTIPLE_RENDER_TARGETS 8
  115. #define BS_FORCE_SINGLETHREADED_RENDERING 0
  116. // Windows Settings
  117. #if BS_PLATFORM == BS_PLATFORM_WIN32
  118. // If we're not including this from a client build, specify that the stuff
  119. // should get exported. Otherwise, import it.
  120. # if defined(BS_STATIC_LIB)
  121. // Linux compilers don't have symbol import/export directives.
  122. # define BS_CORE_EXPORT
  123. # else
  124. # if defined(BS_CORE_EXPORTS)
  125. # define BS_CORE_EXPORT __declspec( dllexport )
  126. # else
  127. # if defined( __MINGW32__ )
  128. # define BS_CORE_EXPORT
  129. # else
  130. # define BS_CORE_EXPORT __declspec( dllimport )
  131. # endif
  132. # endif
  133. # endif
  134. #endif
  135. // Linux/Apple Settings
  136. #if BS_PLATFORM == BS_PLATFORM_LINUX || BS_PLATFORM == BS_PLATFORM_OSX
  137. // Enable GCC symbol visibility
  138. # if defined( BS_GCC_VISIBILITY )
  139. # define BS_CORE_EXPORT __attribute__ ((visibility("default")))
  140. # define BS_HIDDEN __attribute__ ((visibility("hidden")))
  141. # else
  142. # define BS_CORE_EXPORT
  143. # define BS_HIDDEN
  144. # endif
  145. #endif
  146. #include "BsHString.h"
  147. namespace BansheeEngine
  148. {
  149. static const StringID RenderAPIAny = "AnyRenderAPI";
  150. static const StringID RendererAny = "AnyRenderer";
  151. class Color;
  152. class GpuProgram;
  153. class GpuProgramManager;
  154. class IndexBuffer;
  155. class IndexBufferCore;
  156. class OcclusionQuery;
  157. class VertexBuffer;
  158. class VertexBufferCore;
  159. class PixelBuffer;
  160. class GpuBuffer;
  161. class HighLevelGpuProgram;
  162. class GpuProgramManager;
  163. class GpuProgramFactory;
  164. class IndexData;
  165. class Pass;
  166. class Technique;
  167. class Shader;
  168. class Material;
  169. class RenderAPICore;
  170. class RenderAPICapabilities;
  171. class RenderTarget;
  172. class RenderTargetCore;
  173. class RenderTexture;
  174. class RenderTextureCore;
  175. class MultiRenderTexture;
  176. class MultiRenderTextureCore;
  177. class RenderWindow;
  178. class RenderWindowCore;
  179. class RenderTargetProperties;
  180. struct RenderOpMesh;
  181. class StringInterface;
  182. class SamplerState;
  183. class SamplerStateCore;
  184. class TextureManager;
  185. class Viewport;
  186. class VertexData;
  187. class VertexDeclaration;
  188. class Input;
  189. struct PointerEvent;
  190. class RawInputHandler;
  191. class CoreRenderer;
  192. class RendererFactory;
  193. class AsyncOp;
  194. class HardwareBufferManager;
  195. class FontManager;
  196. class DepthStencilState;
  197. class DepthStencilStateCore;
  198. class RenderStateManager;
  199. class RasterizerState;
  200. class RasterizerStateCore;
  201. class BlendState;
  202. class BlendStateCore;
  203. class GpuParamBlock;
  204. class GpuParamBlockBuffer;
  205. class GpuParams;
  206. struct GpuParamDesc;
  207. struct GpuParamDataDesc;
  208. struct GpuParamObjectDesc;
  209. struct GpuParamBlockDesc;
  210. class ShaderInclude;
  211. class TextureView;
  212. class CoreObject;
  213. class CoreObjectCore;
  214. class ImportOptions;
  215. class TextureImportOptions;
  216. class FontImportOptions;
  217. class GpuProgramImportOptions;
  218. class MeshImportOptions;
  219. struct FontBitmap;
  220. class GameObject;
  221. class GpuResourceData;
  222. struct RenderOperation;
  223. class RenderQueue;
  224. struct ProfilerReport;
  225. class VertexDataDesc;
  226. class EventQuery;
  227. class TimerQuery;
  228. class OcclusionQuery;
  229. class FrameAlloc;
  230. class FolderMonitor;
  231. class VideoMode;
  232. class VideoOutputInfo;
  233. class VideoModeInfo;
  234. class RenderableElement;
  235. class CameraCore;
  236. class MeshCoreBase;
  237. class MeshCore;
  238. struct SubMesh;
  239. class TransientMeshCore;
  240. class TextureCore;
  241. class MeshHeapCore;
  242. class VertexDeclarationCore;
  243. class GpuBufferCore;
  244. class GpuParamBlockBufferCore;
  245. class GpuParamsCore;
  246. class ShaderCore;
  247. class ViewportCore;
  248. class PassCore;
  249. class PassParametersCore;
  250. class TechniqueCore;
  251. class MaterialCore;
  252. class GpuProgramCore;
  253. class IResourceListener;
  254. class TextureProperties;
  255. class IShaderIncludeHandler;
  256. class Prefab;
  257. class PrefabDiff;
  258. class RendererMeshData;
  259. class LightCore;
  260. class Light;
  261. class Win32Window;
  262. class RenderAPIFactory;
  263. class PhysicsManager;
  264. class Physics;
  265. class FCollider;
  266. class Collider;
  267. class Rigidbody;
  268. class PhysicsMaterial;
  269. class BoxCollider;
  270. class SphereCollider;
  271. class PlaneCollider;
  272. class CapsuleCollider;
  273. class MeshCollider;
  274. class CCollider;
  275. class CRigidbody;
  276. class CBoxCollider;
  277. class CSphereCollider;
  278. class CPlaneCollider;
  279. class CCapsuleCollider;
  280. class CMeshCollider;
  281. class Joint;
  282. class FixedJoint;
  283. class DistanceJoint;
  284. class HingeJoint;
  285. class SphericalJoint;
  286. class SliderJoint;
  287. class D6Joint;
  288. class CharacterController;
  289. class CJoint;
  290. class CHingeJoint;
  291. class CDistanceJoint;
  292. class CFixedJoint;
  293. class CSphericalJoint;
  294. class CSliderJoint;
  295. class CD6Joint;
  296. class CCharacterController;
  297. class ShaderDefines;
  298. class ShaderImportOptions;
  299. // Asset import
  300. class SpecificImporter;
  301. class Importer;
  302. // Resources
  303. class Resource;
  304. class Resources;
  305. class ResourceManifest;
  306. class Texture;
  307. class Mesh;
  308. class MeshBase;
  309. class TransientMesh;
  310. class MeshHeap;
  311. class Font;
  312. class ResourceMetaData;
  313. class OSDropTarget;
  314. class StringTable;
  315. class PhysicsMaterial;
  316. class PhysicsMesh;
  317. struct CollisionData;
  318. // Scene
  319. class SceneObject;
  320. class Component;
  321. class SceneManager;
  322. // RTTI
  323. class MeshRTTI;
  324. // Desc structs
  325. struct SAMPLER_STATE_DESC;
  326. struct DEPTH_STENCIL_STATE_DESC;
  327. struct RASTERIZER_STATE_DESC;
  328. struct BLEND_STATE_DESC;
  329. struct RENDER_TARGET_BLEND_STATE_DESC;
  330. struct RENDER_TEXTURE_DESC;
  331. struct RENDER_WINDOW_DESC;
  332. struct FONT_DESC;
  333. struct CHAR_CONTROLLER_DESC;
  334. template<class T>
  335. class CoreThreadAccessor;
  336. class CommandQueueNoSync;
  337. class CommandQueueSync;
  338. }
  339. /************************************************************************/
  340. /* Shared pointer typedefs */
  341. /************************************************************************/
  342. namespace BansheeEngine
  343. {
  344. typedef std::shared_ptr<RenderAPICore> RenderAPIPtr;
  345. typedef std::shared_ptr<GpuProgram> GpuProgramPtr;
  346. typedef std::shared_ptr<PixelBuffer> PixelBufferPtr;
  347. typedef std::shared_ptr<VertexBuffer> VertexBufferPtr;
  348. typedef std::shared_ptr<IndexBuffer> IndexBufferPtr;
  349. typedef std::shared_ptr<GpuBuffer> GpuBufferPtr;
  350. typedef std::shared_ptr<VertexDeclaration> VertexDeclarationPtr;
  351. typedef std::shared_ptr<Mesh> MeshPtr;
  352. typedef std::shared_ptr<MeshBase> MeshBasePtr;
  353. typedef std::shared_ptr<MeshHeap> MeshHeapPtr;
  354. typedef std::shared_ptr<TransientMesh> TransientMeshPtr;
  355. typedef std::shared_ptr<Texture> TexturePtr;
  356. typedef std::shared_ptr<Resource> ResourcePtr;
  357. typedef std::shared_ptr<Technique> TechniquePtr;
  358. typedef std::shared_ptr<Pass> PassPtr;
  359. typedef std::shared_ptr<Shader> ShaderPtr;
  360. typedef std::shared_ptr<Material> MaterialPtr;
  361. typedef std::shared_ptr<CoreRenderer> CoreRendererPtr;
  362. typedef std::shared_ptr<RendererFactory> RendererFactoryPtr;
  363. typedef std::shared_ptr<Component> ComponentPtr;
  364. typedef std::shared_ptr<GameObject> GameObjectPtr;
  365. typedef std::shared_ptr<SceneObject> SceneObjectPtr;
  366. typedef std::shared_ptr<SamplerState> SamplerStatePtr;
  367. typedef std::shared_ptr<DepthStencilState> DepthStencilStatePtr;
  368. typedef std::shared_ptr<RasterizerState> RasterizerStatePtr;
  369. typedef std::shared_ptr<BlendState> BlendStatePtr;
  370. typedef std::shared_ptr<RenderWindow> RenderWindowPtr;
  371. typedef std::shared_ptr<RenderTarget> RenderTargetPtr;
  372. typedef std::shared_ptr<RenderTexture> RenderTexturePtr;
  373. typedef std::shared_ptr<MultiRenderTexture> MultiRenderTexturePtr;
  374. typedef std::shared_ptr<GpuParamBlockBuffer> GpuParamBlockBufferPtr;
  375. typedef std::shared_ptr<GpuParams> GpuParamsPtr;
  376. typedef std::shared_ptr<TextureView> TextureViewPtr;
  377. typedef std::shared_ptr<Viewport> ViewportPtr;
  378. typedef std::shared_ptr<ShaderInclude> ShaderIncludePtr;
  379. typedef std::shared_ptr<ImportOptions> ImportOptionsPtr;
  380. typedef std::shared_ptr<const ImportOptions> ConstImportOptionsPtr;
  381. typedef std::shared_ptr<Font> FontPtr;
  382. typedef std::shared_ptr<VertexDataDesc> VertexDataDescPtr;
  383. typedef CoreThreadAccessor<CommandQueueNoSync> CoreAccessor;
  384. typedef CoreThreadAccessor<CommandQueueSync> SyncedCoreAccessor;
  385. typedef std::shared_ptr<CoreThreadAccessor<CommandQueueNoSync>> CoreAccessorPtr;
  386. typedef std::shared_ptr<CoreThreadAccessor<CommandQueueSync>> SyncedCoreAccessorPtr;
  387. typedef std::shared_ptr<EventQuery> EventQueryPtr;
  388. typedef std::shared_ptr<TimerQuery> TimerQueryPtr;
  389. typedef std::shared_ptr<OcclusionQuery> OcclusionQueryPtr;
  390. typedef std::shared_ptr<ResourceManifest> ResourceManifestPtr;
  391. typedef std::shared_ptr<VideoModeInfo> VideoModeInfoPtr;
  392. typedef std::shared_ptr<RenderQueue> RenderQueuePtr;
  393. typedef std::shared_ptr<GpuParamDesc> GpuParamDescPtr;
  394. typedef std::shared_ptr<ResourceMetaData> ResourceMetaDataPtr;
  395. typedef std::shared_ptr<IShaderIncludeHandler> ShaderIncludeHandlerPtr;
  396. typedef std::shared_ptr<Prefab> PrefabPtr;
  397. typedef std::shared_ptr<PrefabDiff> PrefabDiffPtr;
  398. typedef std::shared_ptr<RendererMeshData> RendererMeshDataPtr;
  399. typedef std::shared_ptr<RenderAPIFactory> RenderAPIFactoryPtr;
  400. typedef std::shared_ptr<PhysicsMaterial> PhysicsMaterialPtr;
  401. typedef std::shared_ptr<PhysicsMesh> PhysicsMeshPtr;
  402. }
  403. /************************************************************************/
  404. /* RTTI */
  405. /************************************************************************/
  406. namespace BansheeEngine
  407. {
  408. enum TypeID_Core
  409. {
  410. TID_Texture = 1001,
  411. TID_Mesh = 1002,
  412. TID_MeshData = 1003,
  413. TID_VertexDeclaration = 1004,
  414. TID_VertexElementData = 1005,
  415. TID_Component = 1006,
  416. TID_ResourceHandle = 1009,
  417. TID_GpuProgram = 1010,
  418. TID_ResourceHandleData = 1011,
  419. TID_CgProgram = 1012,
  420. TID_Pass = 1014,
  421. TID_Technique = 1015,
  422. TID_Shader = 1016,
  423. TID_Material = 1017,
  424. TID_SamplerState = 1021,
  425. TID_BlendState = 1023,
  426. TID_RasterizerState = 1024,
  427. TID_DepthStencilState = 1025,
  428. TID_BLEND_STATE_DESC = 1034,
  429. TID_SHADER_DATA_PARAM_DESC = 1035,
  430. TID_SHADER_OBJECT_PARAM_DESC = 1036,
  431. TID_SHADER_PARAM_BLOCK_DESC = 1047,
  432. TID_ImportOptions = 1048,
  433. TID_Font = 1051,
  434. TID_FONT_DESC = 1052,
  435. TID_CHAR_DESC = 1053,
  436. TID_FontImportOptions = 1056,
  437. TID_FontBitmap = 1057,
  438. TID_SceneObject = 1059,
  439. TID_GameObject = 1060,
  440. TID_PixelData = 1062,
  441. TID_GpuResourceData = 1063,
  442. TID_VertexDataDesc = 1064,
  443. TID_MeshBase = 1065,
  444. TID_GameObjectHandleBase = 1066,
  445. TID_ResourceManifest = 1067,
  446. TID_ResourceManifestEntry = 1068,
  447. TID_EmulatedParamBlock = 1069,
  448. TID_TextureImportOptions = 1070,
  449. TID_ResourceMetaData = 1071,
  450. TID_ShaderInclude = 1072,
  451. TID_Viewport = 1073,
  452. TID_ResourceDependencies = 1074,
  453. TID_ShaderMetaData = 1075,
  454. TID_MeshImportOptions = 1076,
  455. TID_Prefab = 1077,
  456. TID_PrefabDiff = 1078,
  457. TID_PrefabObjectDiff = 1079,
  458. TID_PrefabComponentDiff = 1080,
  459. TID_CGUIWidget = 1081,
  460. TID_ProfilerOverlay = 1082,
  461. TID_StringTable = 1083,
  462. TID_LanguageData = 1084,
  463. TID_LocalizedStringData = 1085,
  464. TID_MaterialParamColor = 1086,
  465. TID_WeakResourceHandle = 1087,
  466. TID_TextureParamData = 1088,
  467. TID_StructParamData = 1089,
  468. TID_MaterialParams = 1090,
  469. TID_MaterialRTTIParam = 1091,
  470. TID_PhysicsMaterial = 1092,
  471. TID_CCollider = 1093,
  472. TID_CBoxCollider = 1094,
  473. TID_CSphereCollider = 1095,
  474. TID_CCapsuleCollider = 1096,
  475. TID_CPlaneCollider = 1097,
  476. TID_CRigidbody = 1098,
  477. TID_PhysicsMesh = 1099,
  478. TID_CMeshCollider = 1100,
  479. TID_CJoint = 1101,
  480. TID_CFixedJoint = 1102,
  481. TID_CDistanceJoint = 1103,
  482. TID_CHingeJoint = 1104,
  483. TID_CSphericalJoint = 1105,
  484. TID_CSliderJoint = 1106,
  485. TID_CD6Joint = 1107,
  486. TID_CCharacterController = 1108,
  487. TID_FPhysicsMesh = 1109,
  488. TID_ShaderImportOptions = 1110,
  489. };
  490. }
  491. /************************************************************************/
  492. /* Resource references */
  493. /************************************************************************/
  494. #include "BsResourceHandle.h"
  495. namespace BansheeEngine
  496. {
  497. /** @addtogroup Resources
  498. * @{
  499. */
  500. typedef ResourceHandle<Resource> HResource;
  501. typedef ResourceHandle<Texture> HTexture;
  502. typedef ResourceHandle<Mesh> HMesh;
  503. typedef ResourceHandle<Material> HMaterial;
  504. typedef ResourceHandle<ShaderInclude> HShaderInclude;
  505. typedef ResourceHandle<Font> HFont;
  506. typedef ResourceHandle<Shader> HShader;
  507. typedef ResourceHandle<Prefab> HPrefab;
  508. typedef ResourceHandle<StringTable> HStringTable;
  509. typedef ResourceHandle<PhysicsMaterial> HPhysicsMaterial;
  510. typedef ResourceHandle<PhysicsMesh> HPhysicsMesh;
  511. /** @} */
  512. }
  513. #include "BsGameObjectHandle.h"
  514. namespace BansheeEngine
  515. {
  516. /** @addtogroup Scene
  517. * @{
  518. */
  519. // Game object handles
  520. typedef GameObjectHandle<GameObject> HGameObject;
  521. typedef GameObjectHandle<SceneObject> HSceneObject;
  522. typedef GameObjectHandle<Component> HComponent;
  523. typedef GameObjectHandle<CRigidbody> HRigidbody;
  524. typedef GameObjectHandle<CCollider> HCollider;
  525. typedef GameObjectHandle<CBoxCollider> HBoxCollider;
  526. typedef GameObjectHandle<CSphereCollider> HSphereCollider;
  527. typedef GameObjectHandle<CCapsuleCollider> HCapsuleCollider;
  528. typedef GameObjectHandle<CPlaneCollider> HPlaneCollider;
  529. typedef GameObjectHandle<CJoint> HJoint;
  530. typedef GameObjectHandle<CHingeJoint> HHingeJoint;
  531. typedef GameObjectHandle<CSliderJoint> HSliderJoint;
  532. typedef GameObjectHandle<CDistanceJoint> HDistanceJoint;
  533. typedef GameObjectHandle<CSphericalJoint> HSphericalJoint;
  534. typedef GameObjectHandle<CFixedJoint> HFixedJoint;
  535. typedef GameObjectHandle<CD6Joint> HD6Joint;
  536. typedef GameObjectHandle<CCharacterController> HCharacterController;
  537. /** @} */
  538. }
  539. namespace BansheeEngine
  540. {
  541. /**
  542. * Defers function execution until the next frame. If this function is called within another deferred call, then it will
  543. * be executed the same frame, but only after all existing deferred calls are done.
  544. *
  545. * @note
  546. * This method can be used for breaking dependencies among other things. If a class A depends on class B having
  547. * something done, but class B also depends in some way on class A, you can break up the initialization into two
  548. * separate steps, queuing the second step using this method.
  549. * @note
  550. * Similar situation can happen if you have multiple classes being initialized in an undefined order but some of them
  551. * depend on others. Using this method you can defer the dependent step until next frame, which will ensure everything
  552. * was initialized.
  553. *
  554. * @param[in] callback The callback.
  555. */
  556. void BS_CORE_EXPORT deferredCall(std::function<void()> callback);
  557. // Special types for use by profilers
  558. typedef std::basic_string<char, std::char_traits<char>, StdAlloc<char, ProfilerAlloc>> ProfilerString;
  559. template <typename T, typename A = StdAlloc<T, ProfilerAlloc>>
  560. using ProfilerVector = std::vector<T, A>;
  561. template <typename T, typename A = StdAlloc<T, ProfilerAlloc>>
  562. using ProfilerStack = std::stack<T, std::deque<T, A>>;
  563. /** Banshee thread policy that performs special startup/shutdown on threads managed by thread pool. */
  564. class BS_CORE_EXPORT ThreadBansheePolicy
  565. {
  566. public:
  567. static void onThreadStarted(const String& name)
  568. {
  569. MemStack::beginThread();
  570. }
  571. static void onThreadEnded(const String& name)
  572. {
  573. MemStack::endThread();
  574. }
  575. };
  576. #define BS_ALL_LAYERS 0xFFFFFFFFFFFFFFFF
  577. }
  578. #include "BsCommonTypes.h"