Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

Real Types
[Fundamental Types]


Typedefs

typedef float  RwReal
typedef int  RwFixed

Detailed Description

Real Types

Typedef Documentation

RwFixed
 

RenderWare supports a single RwFixed fixed-point type.

Although popular in the days when integer mathematics was much faster than floating point mathematics, fixed-point math is now rarely used. It is provided because it is still useful for some processes.

The maximum and minimum size of an RwFixed value are defined by the constants RWFIX_MAX and RWFIX_MIN respectively.

The following macros are provided to help you work with RwFixed datatypes:

  • RwFixedToInt(x) Convert an RwFixed to an integer. (The fractional portion is lost.)
  • RwFixedToFloat(x) Convert an RwFixed to a float.
  • RwFixedToReal(x) Convert an RwFixed to an RwReal.
  • RwRealToFixed(x) Convert an RwReal to an RwFixed. (Some precision may be lost.)
  • RwIntToFixed(x) Convert an RwInt32 to an RwFixed. (Some precision may be lost.)
RwReal
 

RenderWare supports a single RwReal floating-point type to aid portability across platforms. This type should be used in applications in preference to the underlying native type.

The constants RwRealMAXVAL and RwRealMINVAL are provided for determining the maximum and minimum values possible using the RwReal type.

In addition, the following macros are available for operations on RwReal types:

  • RwRealMin2(a, b) Find the minimum of two RwReal values.
  • RwRealMax2(a, b) Find the maximum of two RwReal values.
  • RwRealMin3(a, b, c) Find the minimum of three RwReal values.
  • RwRealMax3(a, b, c) Find the maximum of three RwReal values.
  • RwRealAbs(x) Find the absolute value of a RwReal value.
See also:
Integer Types

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:12 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)