This helper class provides shorter alternative for saving and restoring active program in renderer.
Instead of using code like below
IProgram *old_program{ renderer->ActiveProgram };
...
// Change active program in renderer
...
renderer->ActivateProgram(old_program);
you may shorten it to the following one.
CStoreProgram store{ renderer };
...
// Change active program in renderer
...
class CStoreProgram final
{
public:
CStoreProgram(IRenderer *renderer);
~CStoreProgram();
};
Namespace: | nitisa |
Include: | Nitisa/Render/StoreProgram.h |