BsApplication.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsCoreApplication.h"
  4. #include "BsEvent.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Types of available render systems.
  9. */
  10. enum class RenderSystemPlugin
  11. {
  12. DX11,
  13. DX9,
  14. OpenGL
  15. };
  16. /**
  17. * @brief Types of available renderers.
  18. */
  19. enum class RendererPlugin
  20. {
  21. Default
  22. };
  23. /**
  24. * @brief Primary entry point for Banshee engine. Handles startup and shutdown.
  25. */
  26. class BS_EXPORT Application : public CoreApplication
  27. {
  28. public:
  29. Application(RENDER_WINDOW_DESC& primaryWindowDesc, RenderSystemPlugin renderSystem, RendererPlugin renderer);
  30. virtual ~Application();
  31. /**
  32. * @brief Starts the Banshee engine.
  33. *
  34. * @param primaryWindowDesc Description of the primary render window that will be created on startup.
  35. * @param renderSystem Render system to use.
  36. * @param renderer Renderer to use.
  37. */
  38. static void startUp(RENDER_WINDOW_DESC& primaryWindowDesc, RenderSystemPlugin renderSystem, RendererPlugin renderer = RendererPlugin::Default);
  39. /**
  40. * @brief Returns the primary viewport of the application.
  41. *
  42. * @note e.g. player or game view.
  43. */
  44. ViewportPtr getPrimaryViewport() const;
  45. protected:
  46. /**
  47. * @copydoc Module::onStartUp
  48. */
  49. virtual void onStartUp();
  50. /**
  51. * @copydoc CoreApplication::update.
  52. */
  53. virtual void update();
  54. private:
  55. /**
  56. * @brief Translates render system type into library name.
  57. */
  58. static const String& getLibNameForRenderSystem(RenderSystemPlugin plugin);
  59. /**
  60. * @brief Translates renderer type into library name.
  61. */
  62. static const String& getLibNameForRenderer(RendererPlugin plugin);
  63. DynLib* mMonoPlugin;
  64. DynLib* mSBansheeEnginePlugin;
  65. };
  66. /**
  67. * @copydoc Application
  68. */
  69. BS_EXPORT Application& gApplication();
  70. }