If I am calling a value for example from one class to another before instantiation there is the possibility that that value is a member of an alias object not the same as hard coded when I instantiate it. How do you code for the fact that you might not know what the object being called is named until run time? Is that the 'this pointer'? How do you avoid hard-coding that object.
(This is actually the "Classes II" page, even though it is named "templates". You might want to look at all of the Classes pages from http://www.cplusplus.com/doc/tutorial/ to get a better understanding of how classes work.)
In a very garbled way I was asking about ways to make global variables class based with a global object pointer. I didn't realize at the moment that reading from many sources GLUT programming simply demands global variables and functions. Furthermore its near impossible to bring in vars outside of glut prototypes. I don't mean to sound professorial about all this, because you all know better than me. So what I did was make a global variables class and so far its worked great.
Is this set of definitions (lines 2 - 14) in a header file? If so, you could run into the problem of having a gvInstance and a pGv instantiated in every .cpp file that includes that header file. In that case, you won't actually have a global structure. Instead, you will have a collection of local structures.
You need to declare the pGv as external in the header file, and then instantiate gvInstance and assign pGv in a source file somewhere in order to get a global variable.
If this is all within a single compilation unit (source file), then lines 13 and 14 should be declared static.