Ok, my engine is coming along nicely. All the pieces are nearing completion and I'm approaching the part where they all need to talk to eachother. I have my engine set up in many different classes:
engine--
--renderer
--world
--console
Each class is declared in its own c++ file and they are all included in the main c++ file. Now I've run into the problem that world cannot call on console, etc. The only way I have been able to achieve this is to make a global function in the main file to parse the data like this:
void render(){
renderer.render()
}
This works, but it seems REALLY silly and wasteful to do this. Is there a way to make each global class instances see the other? What is the most effective way of doing this.
If it is not possible, then just answer me this: Can I create a pointer to class method or make a macro or something so one class can call it?
Thank you, and thanks everyone on tek-tips for your on-going support during my game devlopment.
engine--
--renderer
--world
--console
Each class is declared in its own c++ file and they are all included in the main c++ file. Now I've run into the problem that world cannot call on console, etc. The only way I have been able to achieve this is to make a global function in the main file to parse the data like this:
void render(){
renderer.render()
}
This works, but it seems REALLY silly and wasteful to do this. Is there a way to make each global class instances see the other? What is the most effective way of doing this.
If it is not possible, then just answer me this: Can I create a pointer to class method or make a macro or something so one class can call it?
Thank you, and thanks everyone on tek-tips for your on-going support during my game devlopment.