Visitor-pattern vs inheritance for rendering
- by akaltar
I have a game engine that currently uses inheritance to provide a generic interface to do rendering:
class renderable
{
public:
void render();
};
Each class calls the gl_* functions itself, this makes the code hard to optimize and hard to implement something like setting the quality of rendering:
class sphere : public renderable
{
public:
…