BsApplication.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPrerequisites.h"
  5. #include "BsCoreApplication.h"
  6. #include "BsEvent.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Application-Engine
  10. * @{
  11. */
  12. /** Types of available render systems. */
  13. enum class RenderAPIPlugin
  14. {
  15. DX11,
  16. DX9,
  17. OpenGL
  18. };
  19. /** Types of available renderers. */
  20. enum class RendererPlugin
  21. {
  22. Default
  23. };
  24. /** Primary entry point for Banshee engine. Handles startup and shutdown. */
  25. class BS_EXPORT Application : public CoreApplication
  26. {
  27. public:
  28. Application(RENDER_WINDOW_DESC primaryWindowDesc, RenderAPIPlugin renderAPI, RendererPlugin renderer,
  29. const Vector<String>& importers);
  30. virtual ~Application();
  31. /**
  32. * Starts the Banshee engine.
  33. *
  34. * @param[in] primaryWindowDesc Description of the primary render window that will be created on startup.
  35. * @param[in] renderAPI Render API plugin to use.
  36. * @param[in] renderer Renderer plugin to use.
  37. * @param[in] importers A list of importer plugins to load on startup.
  38. */
  39. static void startUp(RENDER_WINDOW_DESC& primaryWindowDesc, RenderAPIPlugin renderAPI,
  40. RendererPlugin renderer = RendererPlugin::Default, const Vector<String>& importers = Vector<String>());
  41. /** Returns the absolute path to the builtin managed engine assembly file. */
  42. Path getEngineAssemblyPath() const;
  43. /** Returns the absolute path to the game managed assembly file. */
  44. Path getGameAssemblyPath() const;
  45. /** Returns the absolute path to the folder where script assemblies are located in. */
  46. virtual Path getScriptAssemblyFolder() const;
  47. protected:
  48. /** @copydoc Module::onStartUp */
  49. virtual void onStartUp() override;
  50. /** @copydoc Module::onShutDown */
  51. virtual void onShutDown() override;
  52. /** @copydoc CoreApplication::preUpdate */
  53. virtual void preUpdate() override;
  54. /** @copydoc CoreApplication::postUpdate */
  55. virtual void postUpdate() override;
  56. /** @copydoc CoreApplication::startUpRenderer */
  57. virtual void startUpRenderer() override;
  58. /** @copydoc CoreApplication::getShaderIncludeHandler */
  59. SPtr<IShaderIncludeHandler> getShaderIncludeHandler() const override;
  60. /** Loads the script system and all script libraries. */
  61. virtual void loadScriptSystem();
  62. /** Unloads script libraries and shuts down the script system. */
  63. virtual void unloadScriptSystem();
  64. /** Returns the absolute path to the folder where built-in assemblies are located in. */
  65. virtual Path getBuiltinAssemblyFolder() const;
  66. /** Translates render system type into library name. */
  67. static String getLibNameForRenderAPI(RenderAPIPlugin plugin);
  68. /** Translates renderer type into library name. */
  69. static String getLibNameForRenderer(RendererPlugin plugin);
  70. DynLib* mMonoPlugin;
  71. DynLib* mSBansheeEnginePlugin;
  72. };
  73. /** Easy way to access Application. */
  74. BS_EXPORT Application& gApplication();
  75. /** @} */
  76. }