Plasma Engine  2.0
Loading...
Searching...
No Matches
EngineProcGameApp.h
1#pragma once
2
3#include <EditorEngineProcessFramework/EngineProcess/EngineProcessCommunicationChannel.h>
4#include <EditorEngineProcessFramework/LongOps/LongOpWorkerManager.h>
5#include <Foundation/Application/Config/FileSystemConfig.h>
6#include <Foundation/Application/Config/PluginConfig.h>
7#include <Foundation/Types/UniquePtr.h>
8#include <GameEngine/GameApplication/GameApplication.h>
9#include <Foundation/Logging/HTMLWriter.h>
10
16
18{
19public:
21
24
25 virtual plResult BeforeCoreSystemsStartup() override;
26 virtual void AfterCoreSystemsStartup() override;
27
28 virtual void BeforeCoreSystemsShutdown() override;
29
30 virtual plApplication::Execution Run() override;
31
32 void LogWriter(const plLoggingEventData& e);
33
34protected:
35 virtual void BaseInit_ConfigureLogging() override;
36 virtual void Deinit_ShutdownLogging() override;
37 virtual void Init_FileSystem_ConfigureDataDirs() override;
38 virtual bool Run_ProcessApplicationInput() override;
39 virtual plUniquePtr<plEditorEngineProcessApp> CreateEngineProcessApp();
40
41 virtual void ActivateGameStateAtStartup() override
42 { /* do nothing */
43 }
44
45private:
46 void ConnectToHost();
47 void DisableErrorReport();
48 void WaitForDebugger();
49 static bool EditorAssertHandler(const char* szSourceFile, plUInt32 uiLine, const char* szFunction, const char* szExpression, const char* szAssertMsg);
50 void AddEditorAssertHandler();
51 void RemoveEditorAssertHandler();
52
53 bool ProcessIPCMessages(bool bPendingOpInProgress);
54 void SendProjectReadyMessage();
55 void SendReflectionInformation();
56 void EventHandlerIPC(const plEngineProcessCommunicationChannel::Event& e);
57 void EventHandlerCVar(const plCVarEvent& e);
58 void EventHandlerCVarPlugin(const plPluginEvent& e);
59 void TransmitCVar(const plCVar* pCVar);
60
61 void HandleResourceUpdateMsg(const plResourceUpdateMsgToEngine& msg);
62 void HandleResourceRestoreMsg(const plRestoreResourceMsgToEngine& msg);
63
64 plEngineProcessDocumentContext* CreateDocumentContext(const plDocumentOpenMsgToEngine* pMsg);
65
66 virtual void Init_LoadProjectPlugins() override;
67
68 virtual plString FindProjectDirectory() const override;
69
70 plString m_sProjectDirectory;
71 plApplicationFileSystemConfig m_CustomFileSystemConfig;
72 plApplicationPluginConfig m_CustomPluginConfig;
75 plLongOpWorkerManager m_LongOpWorkerManager;
76 plLogWriter::HTML m_LogHTML;
77
78 plUInt32 m_uiRedrawCountReceived = 0;
79 plUInt32 m_uiRedrawCountExecuted = 0;
80};
Definition FileSystemConfig.h:8
Execution
Defines the possible return values for the plApplication::Run() function.
Definition Application.h:72
Definition PluginConfig.h:9
CVars are global variables that are used for configuring the engine.
Definition CVar.h:109
Definition EngineProcessMessages.h:218
Definition EngineProcessApp.h:26
Definition EngineProcessCommunicationChannel.h:6
A document context is the counter part to an editor document on the engine side.
Definition EngineProcessDocumentContext.h:42
Definition EngineProcGameApp.h:18
virtual void ActivateGameStateAtStartup() override
Allows to override whether a game state is created and activated at application startup.
Definition EngineProcGameApp.h:41
virtual plString FindProjectDirectory() const override
Implementation of plGameApplicationBase::FindProjectDirectory to define the 'project' special data di...
Definition EngineProcGameApp.cpp:602
virtual void AfterCoreSystemsStartup() override
This function is called after basic engine initialization has been done.
Definition EngineProcGameApp.cpp:59
virtual plApplication::Execution Run() override
Main run function which is called periodically. This function must be overridden.
Definition EngineProcGameApp.cpp:154
virtual void BeforeCoreSystemsShutdown() override
This function is called after the application main loop has run for the last time,...
Definition EngineProcGameApp.cpp:141
virtual plResult BeforeCoreSystemsStartup() override
This function is called before any kind of engine initialization is done.
Definition EngineProcGameApp.cpp:45
The base class for all typical game applications made with plEngine.
Definition GameApplication.h:36
plGameApplication(const char *szAppName, const char *szProjectPath)
szProjectPath may be nullptr, if FindProjectDirectory() is overridden.
Definition GameApplication.cpp:39
A log writer that writes out log messages to an HTML file.
Definition HTMLWriter.h:14
The LongOp worker manager is active in the engine process of the editor.
Definition LongOpWorkerManager.h:18
Definition EngineProcessMessages.h:94
Definition EngineProcessMessages.h:104
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
The data that is broadcast whenever a cvar is changed.
Definition CVar.h:65
The data that is sent through plLogInterface.
Definition Log.h:50
The data that is broadcast whenever a plugin is (un-) loaded.
Definition Plugin.h:11
Definition ProcessCommunicationChannel.h:33
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54