This helper class provides shorter alternative for saving and restoring active spline limits in renderer.
Instead of using code like below
CubicBezierSplineLimits *old_limits_ptr{ renderer->ActiveSplineLimits }, old_limits;
if (old_limits_ptr)
{
old_limits = *old_limits_ptr;
old_limits_ptr = &old_limits;
}
...
// Change active spline limits in renderer
...
renderer->ActivateSplineLimits(old_limits_ptr);
you may shorten it to the following one.
CStoreSplineLimits store{ renderer };
...
// Change active block in renderer
...
class CStoreSplineLimits final
{
public:
CStoreSplineLimits(IRenderer *renderer);
~CStoreSplineLimits();
};
Namespace: | nitisa |
Include: | Nitisa/Render/StoreSplineLimits.h |