Game Development Community

Where are the types defined?

by Craig Giannelli · in Torque Game Engine · 08/23/2001 (6:09 am) · 4 replies

Where oh where are those silly types defined?
Variables like F32, S32, F64 and so forth.
I've searched many files, climbed many mountain but have not found the sacred file where they are declared.

#1
08/23/2001 (7:38 am)
v12/engine/platform/typesWin32.h

or

v12/engine/platform/typesPPC.h

or

v12/engine/platform/typesX86UNIX.h

It depends on your platform but if you are in Windows it is the first one.
#2
08/23/2001 (7:43 am)
Thanks, just found it finally. Pulled up windows find files tool and typed in "types". They were all nicely defined in the file mentioned typesWin32.h.

This is good now I can print out the file and keep a copy near me as a handy reference. Though they're defined in a similar fashion to hungarian notation :)


-Me
#3
08/23/2001 (12:08 pm)
One thing to keep in mind is that with VC++ you can right click on variable names, type/class names, etc. and choose "Go To Definition Of Foo". Most likely, the first time you try this the IDE will ask you if you want to recompile with browse information. If you say yes after the recompile you'll often be able to use that command to instantly jump to the definition of whatever element of the code you right-clicked on.

This doesn't work all the time, of course (sometimes VC++ can't figure out where the definition for the symbol you've clicked on is and sometimes your trying to go to the definition of something that really doesn't have a definition, per se), but I have found the feature to be incredibly useful while scouring through the V12 source.

Another useful, related feature is available from the ClassView tab in the Workspace window. Right click on any class in that tab (or any of the functions or variables listed under the "globals" folder) and you'll get a contextual menu with a few useful commands, the most significant of which in my experience is "References...". The window that comes up after choosing "References..." shows what file and on what line the class you've chosen is defined, and lists the file and line numbers for each reference to that class.

This is incredibly useful if you want to see exactly how and where a particular class, function, or variable is used in the code. For instance, if you wanted to see every piece of code that used the Container class, you could go the ClassView, right click on Container and choose "References...". You would see that Container is used in sceneObject.h, camera.cc, sceneGraph.cc, and sceneObject.cc. Double-clicking any of these entries will take you to the file and line number where the reference exists.

The only reason I bring this up here is that when I saw an S32 and didn't know quite what it was, I immediately right-clicked on it and chose "Go To Definition Of S32". The IDE opened up platform/typesWin32.h for me and highlighted the part of the code where S32 was defined. There was no need to use the Find in Files command.
#4
08/25/2001 (12:17 am)
Ok another very usefull feature found in VC++ is it's Search function. You can actually search for a certain text within certain files in a directory (recursive too :). This is a more comfortable grep, well sort-of ;). So if the Definition doesn't work out go for that.
Oh and btw, go buy a VisualC++ book to get into using it, will save u time - Or RTFM :)

Greets to all, pat le cat