MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / renderChildControls

Method renderChildControls

Engine/source/gui/core/guiControl.cpp:555–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553//-----------------------------------------------------------------------------
554
555void GuiControl::renderChildControls(Point2I offset, const RectI &updateRect)
556{
557 // Save the current clip rect
558 // so we can restore it at the end of this method.
559 RectI savedClipRect = GFX->getClipRect();
560
561 // offset is the upper-left corner of this control in screen coordinates
562 // updateRect is the intersection rectangle in screen coords of the control
563 // hierarchy. This can be set as the clip rectangle in most cases.
564 RectI clipRect = updateRect;
565
566 iterator i;
567 for(i = begin(); i != end(); i++)
568 {
569 GuiControl *ctrl = static_cast<GuiControl *>(*i);
570 if (ctrl->mVisible)
571 {
572 Point2I childPosition = offset + ctrl->getPosition();
573 RectI childClip(childPosition, ctrl->getExtent() + Point2I(1,1));
574
575 if (childClip.intersect(clipRect))
576 {
577 GFX->setClipRect( childClip );
578 GFX->setStateBlock(mDefaultGuiSB);
579 ctrl->onRender(childPosition, childClip);
580 }
581 }
582 }
583
584 // Restore the clip rect to what it was at the start
585 // of this method.
586 GFX->setClipRect( savedClipRect );
587}
588
589//-----------------------------------------------------------------------------
590

Callers

nothing calls this directly

Calls 9

beginFunction · 0.85
endFunction · 0.85
getExtentMethod · 0.80
setStateBlockMethod · 0.80
Point2IClass · 0.50
getPositionMethod · 0.45
intersectMethod · 0.45
setClipRectMethod · 0.45
onRenderMethod · 0.45

Tested by

no test coverage detected