BsEditorApplication.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 update();
  34. EditorWidgetLayoutPtr loadWidgetLayout();
  35. void saveWidgetLayout(const EditorWidgetLayoutPtr& layout);
  36. static void closeModalWindow(RenderWindowPtr window, HSceneObject sceneObject);
  37. private:
  38. static const Path WIDGET_LAYOUT_PATH;
  39. static const Path BUILD_DATA_PATH;
  40. RenderSystemPlugin mActiveRSPlugin;
  41. EditorSettingsPtr mEditorSettings;
  42. DynLib* mSBansheeEditorPlugin;
  43. // DEBUG ONLY
  44. HGpuProgram mFragProgRef;
  45. HGpuProgram mVertProgRef;
  46. HShader mTestShader;
  47. TechniquePtr mNewTechniqueGL;
  48. PassPtr mNewPassGL;
  49. TechniquePtr mNewTechniqueDX;
  50. PassPtr mNewPassDX;
  51. TechniquePtr mNewTechniqueDX11;
  52. PassPtr mNewPassDX11;
  53. HMaterial mTestMaterial;
  54. HTexture mTestTexRef;
  55. HMesh mDbgMeshRef;
  56. };
  57. BS_ED_EXPORT EditorApplication& gEditorApplication();
  58. }