class Object
{
public:
bool MarkedForDeletion;
float locx, locy, locz;
virtual void GetRenderInformation(){}
virtual void GetPhysicsInformation(){}
virtual void GetSoundInformation(){}
virtual void Update(){}
};
class Ship : public Object
{
public:
Ship(float x, float y, float z)
{
x = locx;
y = locy;
z = locz;
}
void GetRenderInformation()
{
}
void GetPhysicsInformation()
{
}
void GetSoundInformation()
{
}
void Update()
{
}
protected:
// Cross specific functions go here
};
Help, with um, my class composition?
What the heck is the syntax for returning a pointer?
like this?
like this?
MS3DModel *GetRenderInformation() { return Model1; }
The same way you'd return anything else.
MyModelClass* Model = new MyModelClass("awesome.3ds", REALLY_COOL);
return Model;
would return a pointer to MyModelClass.
EDIT: That is, a pointer to that instance of MyModelClass, 'course.
MyModelClass* Model = new MyModelClass("awesome.3ds", REALLY_COOL);
return Model;
would return a pointer to MyModelClass.
EDIT: That is, a pointer to that instance of MyModelClass, 'course.
Okay, so lets talk about resource management now...
Where in the world do I declare the pointer for Model....
Do I have a resource management class that simply creates pointers for each model that I load and throws them into a vector...
And then have the getrenderdata function look in that container of pointers for model?
Where in the world do I declare the pointer for Model....
Do I have a resource management class that simply creates pointers for each model that I load and throws them into a vector...
And then have the getrenderdata function look in that container of pointers for model?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement