ABSTRACT

While examining the Torque source, you will see the following rules applied to functions, classes, and methods.

10.4 Torque Data Types The C and C++ languages have built-in (intrinsic) types. A list of these types includes int, char, float, and other type names. For general computing, these types and type names are suffi cient, but in a multi-platform game engine, these types suddenly becoming lacking. To solve this problem, Torque supplies its own set of data types, which are frequently used instead of the intrinsic types. These types are part of the Torque porting layer we discussed above. Table 10.2 lists these types and their intrinsic matches. TGE was designed with portability and future compatibility in mind. Also, much attention was given to reducing ambiguity. Lastly,

because data is often sent across networks, it is crucial to know the exact bit widths of that data. The Torque data types were designed to enable and provide these features. As you examine the engine code, you will see that both Torque data types and intrinsic data types are used. This raises the question, “When should I use a Torque data type?” The answer is, “You should always use Torque data types when writing engine code that will be transmitted over a network or exposed to the console.” Alternatively, simply using Torque data types all of the time is also valid. For the most part, the engine header fi les will already sub-include the header fi le that defi nes these types. So, you can use these types just like you use intrinsic types.