I am using the Direct2D API to draw some graphics for my program. I have a function that I call every time the Window redraws that draws the frame. I can't hardcode every object to be drawn into the function, if I want it to be dynamic. What is the common practice for solving this?