BsEditorApplication.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. private:
  39. static const Path WIDGET_LAYOUT_PATH;
  40. static const Path BUILD_DATA_PATH;
  41. RenderSystemPlugin mActiveRSPlugin;
  42. EditorSettingsPtr mEditorSettings;
  43. DynLib* mSBansheeEditorPlugin;
  44. // DEBUG ONLY
  45. HShader mTestShader;
  46. HMaterial mTestMaterial;
  47. HTexture mTestTexRef;
  48. HMesh mDbgMeshRef;
  49. };
  50. BS_ED_EXPORT EditorApplication& gEditorApplication();
  51. }