Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Basetype.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  BASETYPE.H                                                                          */
00003 /*                                                                                      */
00004 /*  Author:                                                                             */
00005 /*  Description: Basic type definitions and calling convention defines                  */
00006 /*                                                                                      */
00007 /*  The contents of this file are subject to the Genesis3D Public License               */
00008 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00009 /*  compliance with the License. You may obtain a copy of the License at                */
00010 /*  http://www.genesis3d.com                                                            */
00011 /*                                                                                      */
00012 /*  Software distributed under the License is distributed on an "AS IS"                 */
00013 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00014 /*  the License for the specific language governing rights and limitations              */
00015 /*  under the License.                                                                  */
00016 /*                                                                                      */
00017 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00018 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00019 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00020 /*                                                                                      */
00021 /****************************************************************************************/
00022 #ifndef GE_BASETYPE_H
00023 #define GE_BASETYPE_H
00024  
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 /******** The Genesis Calling Conventions ***********/ 
00030 
00031 #define GENESISCC       _fastcall
00032 
00033 #if     defined(BUILDGENESIS) && defined(GENESISDLLVERSION)
00034   #define GENESISAPI    _declspec(dllexport)
00035 #else
00036   #if   defined(GENESISDLLVERSION)
00037     #define GENESISAPI  _declspec(dllimport)
00038   #else
00039     #define GENESISAPI
00040   #endif
00041 #endif
00042 
00043 /******** The Basic Types ****************************/
00044 
00045 typedef signed int geBoolean;
00046 #define GE_FALSE        (0)
00047 #define GE_TRUE         (1)
00048 
00049 typedef float geFloat;
00050 typedef double geDouble;
00051 
00052 #ifndef NULL
00053 /* #define NULL ((void *)0) */
00054 #define NULL 0
00055 #endif
00056 
00057 typedef signed long     int32;
00058 typedef signed short    int16;
00059 typedef signed char     int8 ;
00060 typedef unsigned long  uint32;
00061 typedef unsigned short uint16;
00062 typedef unsigned char  uint8 ;
00063 
00064 /******** Macros on Genesis basic types *************/
00065 
00066 #define GE_ABS(x)                               ( (x) < 0 ? (-(x)) : (x) )
00067 #define GE_CLAMP(x,lo,hi)               ( (x) < (lo) ? (lo) : ( (x) > (hi) ? (hi) : (x) ) )
00068 #define GE_CLAMP8(x)                    GE_CLAMP(x,0,255)
00069 #define GE_CLAMP16(x)                   GE_CLAMP(x,0,65536)
00070 #define GE_BOOLSAME(x,y)                ( ( (x) && (y) ) || ( !(x) && !(y) ) )
00071 
00072 #define GE_EPSILON                              ((geFloat)0.000797f)
00073 #define GE_FLOATS_EQUAL(x,y)    ( GE_ABS((x) - (y)) < GE_EPSILON )
00074 #define GE_FLOAT_ISZERO(x)              GE_FLOATS_EQUAL(x,0.0f)
00075 
00076 #define GE_PI                                   ((geFloat)3.14159265358979323846f)
00077 
00078 /****************************************************/
00079 
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083 
00084 #endif
00085  

Generated on Tue Sep 30 12:35:16 2003 for GTestAndEngine by doxygen 1.3.2