can i create a treeview for my global variables?

This is a discussion on can i create a treeview for my global variables? within the Game Programming forums, part of the General Programming Boards category; hey, i recently started game programming in XNA. problem is: i have a lot of global variables. can i create ...

  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
    32,848
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 01: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, 01: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21