type
status
date
slug
summary
tags
category
icon
password
UE的入口点就在LuanchWindows.cpp的WinMain中

在LaunchWindowsStartup函数内处理输入的参数后进入GuardedMain

GuardedMain函数内初始化引擎各个模块之后不断地tick引擎直到退出

接下来通过一次简单的鼠标点击事件来看ue是怎么处理消息的。
首先通过将在初始化的时候将AppWndProc函数绑定到windows的lnfnWndProc上,并且用ProcessMessage不断处理发送过来的msg。


然后ProcessMessage中会调用DeferMessage,在某些条件下msg不会被马上处理,会放到DeferredMessages数组中,通过ProcessDeferredEvents统一处理。ProcessDeferredMessage会通过MessageHandler处理,这里的MessageHandler是SlateApplication的MessageHandler,也就是说,这个鼠标点击事件会交给slate去处理,slate是ue实现的ui框架,它会处理这个msg,或者将这个msg交给其他模块去处理


- Author:lltouchingfish
- URL:https://tangly1024.com/article/210be847-332a-80e1-a110-ea3246d2807f
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!