BsEditorApplication.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. HGpuProgram mFragProgRef;
  46. HGpuProgram mVertProgRef;
  47. HShader mTestShader;
  48. TechniquePtr mNewTechniqueGL;
  49. PassPtr mNewPassGL;
  50. TechniquePtr mNewTechniqueDX;
  51. PassPtr mNewPassDX;
  52. TechniquePtr mNewTechniqueDX11;
  53. PassPtr mNewPassDX11;
  54. HMaterial mTestMaterial;
  55. HTexture mTestTexRef;
  56. HMesh mDbgMeshRef;
  57. };
  58. BS_ED_EXPORT EditorApplication& gEditorApplication();
  59. }