class EditorApplication

Inherits: Application

Primary editor class containing the editor entry point.

Public

Constructors

EditorApplication

EditorApplication()

Methods

~EditorApplication

virtual ~EditorApplication() noexcept

staticStartUp

static void StartUp()

Starts the editor with the specified render and audio systems.

staticInstance

static EditorApplication &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

IsProjectLoaded

bool IsProjectLoaded() const

Checks whether the editor currently has a project loaded.

GetProjectPath

const Path &GetProjectPath() const

Returns the path to the currently loaded project.

GetProjectName

const String &GetProjectName() const

Returns the name of the currently loaded project.

GetEditorSettings

SPtr<EditorSettings> GetEditorSettings() const

Returns a set of serializable editor settings that contain every globally customizable editor property.

GetProjectSettings

SPtr<ProjectSettings> GetProjectSettings() const

Returns a set of serializable project settings that contain every customizable property specific to a project.

GetUndoRedo

SPtr<UndoRedo> GetUndoRedo() const

Returns the global undo-redo manager.

Use this to register undoable operations that are not tied to a particular window, but rather to editor as a whole.

SaveEditorSettings

void SaveEditorSettings()

Saves the current editor settings at the default location.

SaveProjectSettings

void SaveProjectSettings()

Saves the current project settings at the default location.

Does nothing if no project is loaded.

SaveProject

void SaveProject()

Saves any project specific data, if a project is currently loaded.

UnloadProject

void UnloadProject()

Unloads the currently loaded project, if any.

LoadProject

void LoadProject(const Path &path)

Loads a new project, unloading the current one.

path
Absolute path to the root project folder. Must be pointing to a valid project.

CreateProject

void CreateProject(const Path &path)

Creates a new project at the specified path.

path
Path to the folder where to create the project in. Name of this folder will be the name of the project.

IsValidProjectPath

bool IsValidProjectPath(const Path &path)

Checks is the provided folder a valid project.

path
Absolute path to the root project folder.

SetMainScene

void SetMainScene(const SPtr<EditorSceneInstance> &scene)

Provides access to what is considered the main scene in the editor.

Main scene is the primary scene shown in the scene, game and hierarchy windows. Guaranteed not to be null except during startup and shutdown.

GetMainScene

SPtr<EditorSceneInstance> GetMainScene() const

IsEditor

bool IsEditor() const override

Returns true if the application is running in an editor, false if standalone.

Fields

OnQuitRequested

Event<void ()> OnQuitRequested

Callback when the user requests application exit.

The receiver is expected to handle shutdown if required.

Private

Methods

OnStartUp

void OnStartUp() override

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

void OnShutDown() override

Override if you want your module to be notified just before it is deleted.

PreUpdate

void PreUpdate() override

Called for each iteration of the main loop.

Called before any game objects or plugins are updated.

PostUpdate

void PostUpdate() override

Called for each iteration of the main loop.

Called after all game objects and plugins are updated.

NotifyQuitRequested

void NotifyQuitRequested() override

Issues a request for the application to close.

Application may choose to ignore the request depending on the circumstances and the implementation.

StartUpRenderer

void StartUpRenderer() override

Initializes the renderer specified during construction.

Called during initialization.

StartUpScriptManager

void StartUpScriptManager() override

Initializes the script manager.

UpdateScriptManager

void UpdateScriptManager() override

Calls per-frame update on the script manager.

GetShaderIncludeHandler

SPtr<IShaderIncludeHandler> GetShaderIncludeHandler() const override

Returns a handler that is used for resolving shader include file paths.

LoadWidgetLayout

SPtr<EditorWindowLayout> LoadWidgetLayout()

Loads the previously saved editor widget layout from the default location.

Can return null if no layout was previously saved.

SaveWidgetLayout

void SaveWidgetLayout(const SPtr<EditorWindowLayout> &layout)

Saves the provided widget layout at the default layout location.

SaveDefaultWidgetLayout

void SaveDefaultWidgetLayout(const Path &folder)

Saves the default widget layout in the provided folder.

LoadEditorSettings

void LoadEditorSettings()

Loads the previously saved editor settings from the default location.

Overwrites any current settings.

LoadProjectSettings

void LoadProjectSettings()

Loads the previously saved project settings from the default location within the active project.

Loads default settings if no project is active. Overwrites any current settings.

Fields

mEditorSettings

SPtr<EditorSettings> mEditorSettings

mProjectSettings

SPtr<ProjectSettings> mProjectSettings

mUndoRedo

SPtr<UndoRedo> mUndoRedo

mIsProjectLoaded

bool mIsProjectLoaded

mProjectPath

Path mProjectPath

mProjectName

String mProjectName

mSplashScreenTimer

Timer mSplashScreenTimer

mSplashScreenShown

bool mSplashScreenShown

mMainScene

SPtr<EditorSceneInstance> mMainScene