Data Types Specification

Paradigm Development Studios, Copyright 1998



This engine uses, for the most part, its own self-defined data types. This is done for several reasons, but most importantly for portability. All data types are contained in the namespace denkoh and found in the header dnkdatatypes.h.

All integers are defined in a similar fashion. There are two chief parts to their declarations: a prefix and a size specification. With integers, the prefix is always int. A number of possible size specifications are possible as well: 8, 16, and 32 (while 64 is possible on a number of platforms, it's not yet standard enough. As for type qualifiers, such as unsigned, const, etc., C++'s built-in qualifiers are added. Here is an example: unsigned int32 value = 0;

Floating points are declared similarly to integers. They, much like integers, have the two sections to their names. Here, the prefix is real, and the possible sizes are 32 and 64. long doubles, or 80-bit floats, are not declared since they are both impractical and not supported by every compiler. Here is an example of declaring a floating-point value: const real32 sin5 = static_cast<real32>(sin((5 * 3.141592654) / 180);

Many other data types exist of this engine. Most of these reside in different namespaces because they are better suited for certain aspects of the engine. However, a few do exist in the denkoh namespace. Those are: boolean, counter, byte, word and dword. boolean is a true-false type and the two constants for these are, as expected, true and false. counter is a type used for managing loops. The remaning, byte, word and dword are 8-, 16-, and 32-bit unsigned integers respectively.

No form of hungarian notation is used--C++ sports good enough type checking to be able to get away with this. For more on notation and style, see the document on style.


<Back to Home>