View Single Post
Old 09-01-2020, 01:14 AM   #6
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,142
Default

Actually pGraphics->Draw() calls pControl->Draw(), so there is no recursion.

Anyway, this is how it should work: If you change a parameter, then the control is marked as dirty by calling pControl->SetDirty(). The next time pGraphics->IsDirty() is called it will detect that one or more controls are dirty by checking IControl->IsDirty(). If dirty then pGraphics->Draw() will draw controls by calling pControl->Draw() for each of them, and then mark the control as clean by calling pControl->SetClean(). Then the next time pGraphics->IsDirty() is called no controls will be dirty, and so nothing will be redrawn until there is another change.

Now, if you set mDirty to true in pControl->SetClean(), then pGraphics->IsDirty() will always return true, and so pGraphics->Draw() will be called each and every time, by default at 24 FPS.

BTW, you can disable strict drawing by calling pGraphics->SetStrictDrawing(false), but by default strict drawing is enabled.
Tale is offline   Reply With Quote