I have a class called Drawable which defines the basic attributes a object needs to be rendered using openGL. So i have a drawable class, and then a Model class.
class Drawable
{
public:
// add functions to load data
private:
std::vector<GLfloat> _vertices;
std::vector<GLuint> _indices;
std::vector<GLTexture> _textures;
glm::mat4 _model, _view, _projection;
GLint _modelLoc, _viewLoc, _projLoc;
};
When should I inherit a class, and when should I just create a object of the class in my new class?
class Model : public Drawable
{
};
or
class Model
{
public:
// stuff here
private:
Drawable _drawable;
};