In the previous article "pure hand-drawn mygui class diagram and rendering flowchart", I probably used the rendering process of mygui to know that all rendering actions occur in basemanager. in drawoneframe (), the starting point is isubwidget, which generates vertex data to vertexbuffer. After layer-by-layer forwarding by layermanager, it is finally fed to idirect3ddevice9. drawprimitive (). However, even though another very important object widget in the mygui system is also under layernode, it seems to be isolated from the rendering process at the beginning, the logical relationship between the widget and the subwidget is not seen yet (the subwidget is understood as child
The widget is obviously incorrect .) I (liigo) manually drawn the following two sketch, basically connected to the two sides of the contact between widgets and subwidgets.
Widget. createwidget, skinitem. _ createskinitem, layeritem. attchtolayeritemnode:
Widgets inherit from skinitem, skinitem also inherits from layeritem, so the widget IS-A skinitem, And the IS-A layeritem.
All actions shown in the figure occur within the widget. createwidget. There are two steps: loading skin resource XML, creating isubwidgets, and recording it inside the widget object; attaching root widgets to the user-specified layer (for each root widget (window) create a layernode separately. Child widgets will be attached to this layernode in the future.) generate drawitem (to renderitem) based on the previously created isubwidgets and attach it to the layernode. Isubwidget is the sub-door responsible for rendering in the widget. In this sense, the "sub" also makes sense.
The above content is for easy understanding. At present, the level of understanding is limited, so it is not expected to ask for help from external users.