Hello.
I would like to load all my game data from a vector list so I can load one block(List Item)at a time
and report back to the render function on its progress or even a block at a time( a numer of items).
But I have came across the issue where say for my menu classes there all derived from a base menu class
like this
class basemenu;//do stuff
class MainMenu :public basemenu
{
do stuff
};
then I allocate them like so
basemenu[0] = new MainMenu();//this is the part I can't pass in
basemenu[1] = new AboutMenu();
How Would I create a base class to contain the different classes that need allocation
I was going down this here path when I got to the part to create a block to add to the loadstream class
class basestreamloaderdata;
class StreamLoaderMenuItem : public basestreamloaderdata
{
public:
StreamLoaderMenuItem (void){}
virtual ~StreamLoaderMenuItem (void){}
//data each menu item need to load
Camera *cam;
basemenu *menu;//this is where I need to new each class type
//someobj that takes the new data loaded
ObjDataOwner *owner;//where the new data it to go
//other suff
};//end StreamLoaderMenuItem
this class StreamLoaderMenuItem, is 1 menu that can be loaded later.
At the moment I allocate the menu pointers, when I add the item to the vector for later process.
I don't want to have a base class for each menu type.
I'm not to sure on template classes I have used them in the past., but not for allocation of different types