Original Post
Right now I''m working on a graphic api independent renderer and I''m working on abstacting my state variables. So right now I have one base class:
class IStateVariable
{
public:
virtual ~IStateVariable();
virtual void on()
{
enabled_ = true;
}
virtual void on()
{
enabled_ = false;
}
virtual void setValue() = 0;
private:
bool enabled_;
};
From this I just inherit different variables like CullingVariable or LightingVariable. I set the api specific functions in on/off and any specified values (like a specific light) through setValue.
The problem is the large explosion of small classes. Considering one for each supported variable, and then two versions of that for OpenGL and DirectX.
How do you manage the state of your rendering interface?