g_pApp Instantiation

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • g_pApp Instantiation

      Hello,

      I'm trying to locate in the code where the singleton class GameCodeApp gets instantiated. I found the global extern pointer: GameCodeApp* g_pApp but I cant seem to find where it gets "newed up". In the text it says it points to global object that stores the game's application layer. I appreciate any assistance!

      I found the lines:
      g_pApp = NULL in GameCode.cpp at global scope.
      g_pApp = this in the GameCodeApp constructor in GameCode.cpp

      I did a string search for "new GameCodeApp()" but couldn't find anything.

      The post was edited 1 time, last by synk113 ().

    • TeapotWars.cpp on line 60:

      Source Code

      1. TeapotWarsApp g_TeapotWarsApp;


      TeapotWarsApp inherits from GameCodeApp so when that constructor is run, it calls the base GameCodeApp constructor, which in turn sets the global g_pApp pointer.

      -Rez