Hi,
I am looking for best practices when it comes to passing a reference to the last element on a chain of classes.
For example, lest say I have the following setup:
- testApp
- Flock
- vector of Boids
- Fish
testApp creates a Flock instance, Flock creates a bunch of Boids and Boids create an instance of Fish
I want to load all the fish texture images in testApp, and then pass a reference to all the images to the Fish objects
So a couple of questions:
1- Which method should I use to store the images?
A- vector * images;
B- vector <ofImage*> images;
2- Is there a shortcut to get the images vector from testApp to the Fish class directly? or do I have to create an pointer to images in Flock, Boid, Fish, so testApp pass a reference of images to Flock, Flock pass to Boids, Boids pass to Fish?
Any help will be much appreciated
PS. I dont want to abuse of your kindness but I also need help here http://forum.openframeworks.cc/t/vertex-array-texture-help/4120/0 its driving me crazy :roll:
Cheers
rS