I need to create in c++ an array of 20 objects, because i will need to manipulate them all in order to draw them in OpenGL.
I've tried:
Animal::Cat *_listCats[20];
Then i need to inicialize them with coordinates. I have a constructor and a Seter
Cat(float _x, float _y) :
_xOffSet(_x), _yOffSet(_y) {}
void CatCoordinates(float x, float y){
_xOffSet = x;
_yOffSet = y;
}
And I've a method that draw in OpenGL a Cat
void DrawCat()
{
...do things...
}
Cat is a specific class in the namespace Animal and i call from another file. The problem is that i'm having sigsevs and I don't know how to create 20 cats and draw them efficiently with cicles.