BsCorePrerequisites.h 19 KB

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