本文主要是介绍【UE4源代码观察】观察FEngineLoop中各函数的调用顺序,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
当启动编辑器时,Launch模块是启动模块,在Windows平台中 LaunchWindows.cpp 的 WinMain函数是入口,而 FEngineLoop 管理了程序的初始化与主循环。他的成员函数如下:
public:/*** Pre-Initialize the main loop, and generates the commandline from standard ArgC/ArgV from main().** @param ArgC The number of strings in ArgV.* @param ArgV The command line parameters (ArgV[0] is expected to be the executable name).* @param AdditionalCommandLine Optional string to append to the command line (after ArgV is put together).* @return Returns the error level, 0 if successful and > 0 if there were errors.*/ int32 PreInit(int32 ArgC, TCHAR* ArgV[], const TCHAR* AdditionalCommandline = nullptr);/*** Pre-Initialize the main loop - parse command line, sets up GIsEditor, etc.** @param CmdLine The command line.* @return The error level; 0 if successful, > 0 if there were errors.*/ int32 PreInit(const TCHAR* CmdLine);/** First part of PreInit. */int32 PreInitPreStartupScreen(const TCHAR* CmdLine);/** Second part of PreInit. */int32 PreInitPostStartupScreen(const TCHAR* CmdLine);/** Load all modules needed before Init. */ void LoadPreInitModules();/** Load core modules. */bool LoadCoreModules();#if WITH_ENGINE/** Load all core modules needed at startup time. */bool LoadStartupCoreModules();/** Load all modules needed at startup time. */bool LoadStartupModules();/*** Initialize the main loop (the rest of the initialization).** @return The error level; 0 if successful, > 0 if there were errors.*/ virtual int32 Init() override;/** Initialize the timing options from the command line. */ void InitTime();/** Performs shut down. */void Exit();/** Whether the engine should operate in an idle mode that uses no CPU or GPU time. */bool ShouldUseIdleMode() const;/** Advances the main loop. */virtual void Tick() override;/** Removes references to any objects pending cleanup by deleting them. */virtual void ClearPendingCleanupObjects() override;#endif // WITH_ENGINE/** RHI post-init initialization */static void PostInitRHI();/** Pre-init HMD device (if necessary). */static void PreInitHMDDevice();public:/** Initializes the application. */static bool AppInit();/*** Prepares the application for shutdown.** This function is called from within guarded exit code, only during non-error exits.*/static void AppPreExit();/*** Shuts down the application.** This function called outside guarded exit code, during all exits (including error exits).*/static void AppExit();private:/** Utility function that processes Slate operations. */void ProcessLocalPlayerSlateOperations() const;
我想搞清这些函数的调用次序,于是插入断点观察堆栈,画出了下面的顺序图:
这篇关于【UE4源代码观察】观察FEngineLoop中各函数的调用顺序的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!