BsEditorApplication.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsApplication.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT EditorApplication : public Application
  7. {
  8. public:
  9. EditorApplication(RenderSystemPlugin renderSystemPlugin);
  10. virtual ~EditorApplication();
  11. static void startUp(RenderSystemPlugin renderSystemPlugin);
  12. bool isProjectLoaded() const;
  13. bool isGameViewFocused() const;
  14. bool isSceneViewFocused() const;
  15. const Path& getProjectPath() const;
  16. const WString& getProjectName() const;
  17. /**
  18. * @brief Returns the absolute path to the built-in managed editor assembly file.
  19. */
  20. Path getEditorAssemblyPath() const;
  21. /**
  22. * @brief Returns the absolute path of the managed editor script assembly file.
  23. */
  24. Path getEditorScriptAssemblyPath() const;
  25. /**
  26. * @copydoc Application::getScriptAssemblyFolder
  27. */
  28. Path getScriptAssemblyFolder() const override;
  29. EditorSettingsPtr getEditorSettings() const { return mEditorSettings; }
  30. private:
  31. virtual void onStartUp();
  32. virtual void onShutDown();
  33. virtual void preUpdate() override;
  34. virtual void postUpdate() override;
  35. EditorWidgetLayoutPtr loadWidgetLayout();
  36. void saveWidgetLayout(const EditorWidgetLayoutPtr& layout);
  37. static void closeModalWindow(RenderWindowPtr window, HSceneObject sceneObject);
  38. /**
  39. * @copydoc Application::getShaderIncludeHandler
  40. */
  41. virtual ShaderIncludeHandlerPtr getShaderIncludeHandler() const;
  42. private:
  43. static const Path WIDGET_LAYOUT_PATH;
  44. static const Path BUILD_DATA_PATH;
  45. RenderSystemPlugin mActiveRSPlugin;
  46. EditorSettingsPtr mEditorSettings;
  47. DynLib* mSBansheeEditorPlugin;
  48. // DEBUG ONLY
  49. HShader mTestShader;
  50. HMaterial mTestMaterial;
  51. HTexture mTestTexRef;
  52. HMesh mDbgMeshRef;
  53. };
  54. BS_ED_EXPORT EditorApplication& gEditorApplication();
  55. }