虚幻4 Slate主线程
来源:互联网 发布:淘宝上的海外专营店 编辑:程序博客网 时间:2024/05/17 23:31
总控制:
Engine_Updating\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp
void FSlateApplication::PrivateDrawWindows( TSharedPtr<SWindow> DrawOnlyThisWindow ){<span style="color:#ff0000;">DrawWindowAndChildren(CurrentWindow, DrawWindowArgs);</span>
{<span style="color:#ff0000;"></span>SLATE_CYCLE_COUNTER_SCOPE(GSlateRendererDrawWindows);<span style="color:#ff0000;">Renderer->DrawWindows( DrawWindowArgs.OutDrawBuffer );</span>}}
第一个,主线程装配所有的这一帧的UI的数据,保存在DrawWindowArgs.OutDrawBuffer里面,
然后最后调用到第二个红色的地方,用来想渲染线程发送Task。在发送task之前,会调用batcher,先把可以batch的batch到一起。
下面是装配函数:
\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp
void FSlateApplication::DrawWindowAndChildren( const TSharedRef<SWindow>& WindowToDraw, FDrawWindowArgs& DrawWindowArgs ){// Only draw visible windowsif( WindowToDraw->IsVisible() && !WindowToDraw->IsWindowMinimized() ){SLATE_CYCLE_COUNTER_SCOPE_CUSTOM(GSlateDrawWindowAndChildren, WindowToDraw->GetCreatedInLocation());// Switch to the appropriate world for drawingFScopedSwitchWorldHack SwitchWorld( WindowToDraw );//FPlatformMisc::BeginNamedEvent(FColor::Magenta, "Slate::DrawPrep");<span style="color:#ff0000;">FSlateWindowElementList& WindowElementList = DrawWindowArgs.OutDrawBuffer.AddWindowElementList( WindowToDraw );</span>//FPlatformMisc::EndNamedEvent();// Drawing is done in window space, so null out the positions and keep the size.FGeometry WindowGeometry = WindowToDraw->GetWindowGeometryInWindow();int32 MaxLayerId = 0;{//FPlatformMisc::BeginNamedEvent(FColor::Magenta, "Slate::ClearHitTestGrid");WindowToDraw->GetHittestGrid()->ClearGridForNewFrame( VirtualDesktopRect );//FPlatformMisc::EndNamedEvent();FPlatformMisc::BeginNamedEvent(FColor::Magenta, "Slate::DrawWindow");<span style="color:#ff0000;">MaxLayerId = WindowToDraw->PaintWindow(FPaintArgs(WindowToDraw.Get(), *WindowToDraw->GetHittestGrid(), WindowToDraw->GetPositionInScreen(), GetCurrentTime(), GetDeltaTime()),WindowGeometry, WindowToDraw->GetClippingRectangleInWindow(),WindowElementList,0,FWidgetStyle(),WindowToDraw->IsEnabled() );</span>
第一个红色代码,清掉上一帧的历史数据,班会一个空的buffer,
第二个红色的代码,递归调用,遍历树形结构,向WindowElementList里面填数据。
0 0
- 虚幻4 Slate主线程
- 虚幻4 主线程一直向渲染线程发送Task
- 虚幻4 主线程与渲染线程的同步。
- 虚幻4 删除Actor渲染线程和主线程的过程
- Unreal Engine 4 C++ Slate 介绍——用C++和Slate创建菜单(一)
- Unreal Engine 4 C++ Slate 介绍——用C++和Slate创建菜单(二)
- Unreal Engine 4 C++ Slate 介绍——用C++和Slate创建菜单(三)
- 主线程
- 主线程
- 虚幻4引擎
- 虚幻4引擎
- 虚幻4的Style
- 虚幻4 Editor 编程
- 虚幻4 蒙太奇
- 虚幻4编码规范
- 虚幻4目录结构
- 虚幻4 反射
- 虚幻4 材质基础
- UE4 蓝图里的 函数递归调用
- 使用工具生成mybatis所需文件
- [搜索]ElasticSearch Java Api(一) -创建索引
- 面向对象概述
- Leetcode题解 198. House Robber
- 虚幻4 Slate主线程
- dump
- java/android 设计模式学习笔记(10)---建造者模式
- Codeforces Round #358 (Div. 2)
- Fragment重叠问题引发的思考
- Hadoop计算框架shuffle过程详解
- cs231学习笔记二 线性分类器、SVM、Softmax
- C语言代码合并神器for Mac
- LeetCode 63. Unique Paths II