This helper class provides shorter alternative for saving and restoring active framebuffer in renderer.
Instead of using code like below
IFramebuffer *old_fb{ renderer->ActiveFramebuffer };
...
// Change active framebuffer in renderer
...
renderer->ActivateFramebuffer(old_fb);
you may shorten it to the following one.
CStoreFramebuffer store{ renderer };
...
// Change active framebuffer in renderer
...
class CStoreFramebuffer final
{
public:
CStoreFramebuffer(IRenderer *renderer);
~CStoreFramebuffer();
};
Namespace: | nitisa |
Include: | Nitisa/Render/StoreFramebuffer.h |