Thread: can i create a treeview for my global variables?

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    9

    Smile can i create a treeview for my global variables?

    hey, i recently started game programming in XNA. problem is:

    i have a lot of global variables. can i create a treeview for them somehow so i can devide them into several groups?

    and with treeview i mean like how you can open and close namespaces / classes / voids.

    thanks in advance

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Rather than having a random scattering of globals, how about one global struct?

    Eg.
    Code:
    struct {
      Player player;
      Map map;
      NPC Npc[MAX];
    } gameState;
    The tree view follows the structure declarations (recursively).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. static global & global variables
    By aqeel in forum C Programming
    Replies: 1
    Last Post: 09-25-2009, 12:32 PM
  2. global variables
    By sandeepmhptr in forum C++ Programming
    Replies: 2
    Last Post: 11-25-2007, 08:30 PM
  3. Global variables
    By Buckshot in forum C++ Programming
    Replies: 7
    Last Post: 07-11-2005, 12:53 PM
  4. Global Variables in C++?
    By DeX in forum C++ Programming
    Replies: 9
    Last Post: 03-11-2005, 08:43 AM
  5. non global variables
    By algi in forum C++ Programming
    Replies: 1
    Last Post: 01-10-2005, 01:02 PM