Heya
How your apps are organized?
cause global vars are not advised
thx
(sorry for my poor and bad english)
program structure
You can read The C++ Programming Language (3rd Ed or Special) by Stroustrup. He describes really cool application structure (I'm now reading about Derived classes).
Globals must die
Globals must die
Open Source all the way, baby
OSRPG
OSRPG
yep I know c++ (i begin but it isn't the first programming language i have learnt). However, because of local vars, i can't write :
'cause scene manager (and the others elements of the engine) can't be reached in gameLoop for example, he has been declared in the main function... And i cannot use global vars as we said. So, how are your games/3d apps using IrrLicht structured/organized?
Thx
(yes, it's a strange question, i know )
Code: Select all
int main {
....
gameLoop();
}
void gameLoop {
updatePlayerPos();
}
void updatePlayerPos {
....
}
Thx
(yes, it's a strange question, i know )
Either I don't understand your question, or you can simply use
gameLoop (ISceneManager *smgr);
then UpdatePlayerPos (ISceneManager *smgr) {
smgr->addBlahBlahBlah (smth);
}
gameLoop (ISceneManager *smgr);
then UpdatePlayerPos (ISceneManager *smgr) {
smgr->addBlahBlahBlah (smth);
}
Open Source all the way, baby
OSRPG
OSRPG
-
- Posts: 279
- Joined: Fri Dec 24, 2004 6:37 pm
You can have a look at the structure IrrWizard uses, no global variables in sight, so you might like it.
But if that freaks you out too much, then have a look at the ICE Framework which is solving a similar problem but has a much smaller code base.
________
Motorcycle tires
But if that freaks you out too much, then have a look at the ICE Framework which is solving a similar problem but has a much smaller code base.
________
Motorcycle tires