PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

c++ newbie question about scope !

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 !
Hi Stuff,

We recommend making the *main pointer part of SHARED_DATA instead of global. Other than that, everything seems OK.
thank you.
I've finally did it like that.
I wondered if it was the best way !