Page 1 of 1

c++ newbie question about scope !

PostPosted: Jun 9, 2007 @ 1:08pm
by stuff
I've used the "Create a complete game" tutorial to start coding my game.

The only thing I can't manage to do is using ClassMain simple methods like GetFPS or Log within a "module". What is the correct way to do this ?

(I managed to use them, by declaring ClassMain *main as a global var, which is the worst thing to do IMO...)

could someone help ?

thx !

PostPosted: Jun 11, 2007 @ 2:47pm
by edge
Hi Stuff,

We recommend making the *main pointer part of SHARED_DATA instead of global. Other than that, everything seems OK.

PostPosted: Jun 11, 2007 @ 2:58pm
by stuff
thank you.
I've finally did it like that.
I wondered if it was the best way !