home *** CD-ROM | disk | FTP | other *** search
- /****************************************/
- /* */
- /* RenderWare(TM) Graphics Library */
- /* */
- /****************************************/
-
- /*
- * This file is a product of Criterion Software Ltd.
- *
- * This file is provided as is with no warranties of any kind and is
- * provided without any obligiation on Criterion Software Ltd.
- * or Canon Inc. to assist in its use or modifiation.
- *
- * Criterion Software Ltd. and Canon Inc. will not, under any
- * circumstances, be liable for any lost revenue or other damages
- * arising from the use of this file.
- *
- * Copyright (c) 1991, 1992, 1993, 1994. Canon Inc.
- * All Rights Reserved.
- */
-
- #ifndef _RWTYPE_H
- #define _RWTYPE_H
-
- /* Common type definitions needed everywhere. */
- typedef short RwInt16;
- typedef unsigned short RwUInt16;
- typedef long RwInt32;
- typedef unsigned long RwUInt32;
- typedef RwInt32 RwBool;
-
- /* syntax sugar */
- #ifndef _MODELH
- typedef struct
- {
- void *rs0;
- }
- RwMatrix4d;
-
- typedef struct _userdraw
- {
- void *rs0;
- }
- RwUserDraw;
-
- typedef struct
- {
- void *rs0;
- }
- RwCamera;
-
- typedef struct _lite
- {
- void *rs0;
- }
- RwLight;
-
- typedef struct _clump
- {
- void *rs0;
- }
- RwClump;
-
- typedef struct _rwpolygon
- {
- void *rs0;
- }
- RwPolygon3d;
-
- typedef struct
- {
- void *rs0;
- }
- RwFont;
-
- typedef struct
- {
- void *rs0;
- }
- RwText;
-
- typedef struct
- {
- void *rs0;
- }
- RwSpline;
-
- typedef struct
- {
- void *rs0;
- }
- RwScene;
-
- typedef struct
- {
- void *rs0;
- }
- RwRaster;
-
- typedef struct _RwTexture
- {
- void *rs0;
- }
- RwTexture;
-
- typedef struct
- {
- void *rs0;
- }
- RwMaterial;
-
- #endif /* _MODEL_H */
-
- typedef enum
- {
- rwNALIGHTTYPE=0,
- rwDIRECTIONAL,
- rwPOINT,
- rwCONICAL
- }
- RwLightType;
-
- typedef enum
- {
- rwNASTATE=0,
- rwOFF,
- rwON
- }
- RwState;
-
- typedef enum
- {
- rwNACAMERAPROJECTION=0,
- rwPERSPECTIVE = 1,
- rwPARALLEL = 2 /* These are bit operators */
- }
- RwCameraProjection;
-
- typedef enum
- {
- rwNACOMBINEOPERATION=0,
- rwREPLACE,
- rwPRECONCAT,
- rwPOSTCONCAT
-
- }
- RwCombineOperation;
-
- typedef enum
- {
- rwNALIGHTSAMPLING = 0,
- rwFACET = 1,
- rwVERTEX = 2 /* These are bit operators, so next comes 4 etc. */
- }
- RwLightSampling;
-
- typedef enum
- {
- rwNAGEOMETRYSAMPLING=0,
- rwPOINTCLOUD,
- rwWIREFRAME,
- rwSOLID
- }
- RwGeometrySampling;
-
- typedef enum
- {
- rwNASPLINETYPE=0,
- rwOPENLOOP,
- rwCLOSEDLOOP
- }
- RwSplineType;
-
- typedef enum
- {
- rwNASPLINEPATH=0,
- rwSMOOTH,
- rwNICEENDS
- }
- RwSplinePath;
-
- typedef enum
- {
- rwNASEARCHMODE=0,
- rwLOCAL,
- rwGLOBAL
- }
- RwSearchMode;
-
- /* The RwDebugState type will be removed in the next release of
- RenderWare. The following defines are included for backward
- compatibility. Use RwState for new references to this type */
-
- #define RwDebugState RwState
- #define rwNADEBUGMESSAGESTATUS rwNASTATE
- #define rwDISABLE rwOFF
- #define rwENABLE rwON
-
- typedef enum
- {
- rwNADEBUGMESSAGESEVERITY=0,
- rwINFORM,
- rwWARNING,
- rwERROR
- }
- RwDebugSeverity;
-
- typedef enum
- {
- rwNATEXTUREDITHER=0,
- rwDITHERON,
- rwDITHEROFF,
- rwAUTODITHER
- }
- RwTextureDitherMode;
-
- /*
- * Pick object type. Not an enum so that we can
- * force structure packing to long word sized (which
- * is not possible in the general case with an enum).
- */
- typedef RwInt32 RwPickObject;
- #define rwNAPICKOBJECT (RwInt32)0
- #define rwPICKCLUMP (RwInt32)1
- #define rwPICKVERTEX (RwInt32)2
-
- /*
- * Clump hints
- */
- typedef RwUInt32 RwClumpHints;
- #define rwCONTAINER (RwUInt32)0x0001
- #define rwHS (RwUInt32)0x0002
- #define rwEDITABLE (RwUInt32)0x0004
-
- /*
- * Texture modes.
- */
- typedef RwUInt32 RwTextureModes;
- #define rwLIT (RwUInt32)0x0001
- #define rwFORESHORTEN (RwUInt32)0x0002
- #define rwFILTER (RwUInt32)0x0004
-
- /*
- * Raster processing options. These options determine
- * how a bitmap (either read from a file or created
- * by the system) is processed when it is converted
- * into a raster. Currently the flags control whether
- * the incoming bitmap is dithered, filtered to
- * texture size, matched against the RenderWare palette
- * and/or gamma corrected.
- */
- typedef RwUInt32 RwRasterOptions;
- #define rwAUTODITHERRASTER (RwUInt32)0x0001
- #define rwDITHERRASTER (RwUInt32)0x0002
- #define rwFITRASTER (RwUInt32)0x0004
- #define rwINDEXRASTER (RwUInt32)0x0008
- #define rwGAMMARASTER (RwUInt32)0x0010
- #define rwOFFSETRASTER (RwUInt32)0x0020
-
- /*
- * Palette processing options. These options determine
- * how a palette is processed when it is being written.
- */
- typedef RwUInt32 RwPaletteOptions;
- #define rwGAMMAPALETTE (RwUInt32)0x0001
-
- /*
- * UserDraw alignment types.
- */
- typedef RwUInt32 RwUserDrawAlignmentTypes;
- #define rwALIGNTOP (RwUInt32)0x0001
- #define rwALIGNBOTTOM (RwUInt32)0x0002
- #define rwALIGNLEFT (RwUInt32)0x0004
- #define rwALIGNRIGHT (RwUInt32)0x0008
- #define rwALIGNTOPLEFT (rwALIGNTOP | rwALIGNLEFT)
- #define rwALIGNBOTTOMRIGHT (rwALIGNBOTTOM | rwALIGNRIGHT)
-
- typedef enum
- {
- rwNAUSERDRAWTYPE=0,
- rwCLUMPALIGN,
- rwVERTEXALIGN,
- rwBBOXALIGN,
- rwVPALIGN
- } RwUserDrawType;
-
- typedef struct
- {
- RwInt32 x, y, w, h;
- } RwRect;
-
- typedef struct
- {
- RwReal x, y, z;
- }
- RwV3d;
-
- typedef struct
- {
- RwReal u, v;
- /* Possibly add more elements here in future. */
- }
- RwUV;
-
- /*
- * Called RwRGBColor as we may introduce other color models at some
- * time later, i.e. RwHSVColor.
- */
- typedef struct
- {
- RwReal r, g, b;
- }
- RwRGBColor;
-
- typedef struct
- {
- unsigned char r;
- unsigned char g;
- unsigned char b;
- unsigned char flags;
- }
- RwPaletteEntry;
-
- typedef struct
- {
- RwInt32 vindex; /* closest vertex to pick point */
- RwInt32 d2; /* distance squared in pixels */
- }
- RwPickVertexData;
-
- typedef struct
- {
- struct _clump *clump;
- struct _rwpolygon *polygon;
- RwPickVertexData vertex;
- RwV3d wcpoint;
- }
- RwPickClumpData;
-
- typedef struct
- {
- RwPickObject type;
- union
- {
- RwPickClumpData clump;
- RwPickVertexData vertex;
- }
- object;
- }
- RwPickRecord;
-
- /*
- * Clump call backs
- */
-
- typedef struct _clump *
- (*RwClumpFuncVoid) ARGS((struct _clump *target));
- typedef struct _clump *
- (*RwClumpFuncInt) ARGS((struct _clump *target, RwInt32 arg));
- typedef struct _clump *
- (*RwClumpFuncLong) ARGS((struct _clump *target, RwInt32 arg));
- typedef struct _clump *
- (*RwClumpFuncReal) ARGS((struct _clump *target, RwReal arg));
- typedef struct _clump *
- (*RwClumpFuncPointer) ARGS((struct _clump *target, void *arg));
- /*
- * Light call backs
- */
-
- typedef struct _lite *
- (*RwLightFuncVoid) ARGS((struct _lite *target));
- typedef struct _lite *
- (*RwLightFuncInt) ARGS((struct _lite *target, RwInt32 arg));
- typedef struct _lite *
- (*RwLightFuncLong) ARGS((struct _lite *target, RwInt32 arg));
- typedef struct _lite *
- (*RwLightFuncReal) ARGS((struct _lite *target, RwReal arg));
- typedef struct _lite *
- (*RwLightFuncPointer) ARGS((struct _lite *target, void *arg));
- /*
- * Polygon call backs
- */
-
- typedef struct _rwpolygon *
- (*RwPolygon3dFuncVoid) ARGS((struct _rwpolygon *target));
- typedef struct _rwpolygon *
- (*RwPolygon3dFuncInt) ARGS((struct _rwpolygon *target, RwInt32 arg));
- typedef struct _rwpolygon *
- (*RwPolygon3dFuncLong) ARGS((struct _rwpolygon *target, RwInt32 arg));
- typedef struct _rwpolygon *
- (*RwPolygon3dFuncReal) ARGS((struct _rwpolygon *target, RwReal arg));
- typedef struct _rwpolygon *
- (*RwPolygon3dFuncPointer) ARGS((struct _rwpolygon *target, void *arg));
- /*
- * Texture call backs
- */
-
- typedef struct _RwTexture *
- (*RwTextureFuncVoid) ARGS((struct _RwTexture *target));
- typedef struct _RwTexture *
- (*RwTextureFuncInt) ARGS((struct _RwTexture *target, RwInt32 arg));
- typedef struct _RwTexture *
- (*RwTextureFuncLong) ARGS((struct _RwTexture *target, RwInt32 arg));
- typedef struct _RwTexture *
- (*RwTextureFuncReal) ARGS((struct _RwTexture *target, RwReal arg));
- typedef struct _RwTexture *
- (*RwTextureFuncPointer) ARGS((struct _RwTexture *target, void *arg));
- /*
- * UserDraw call backs
- */
-
- typedef struct _userdraw *
- (*RwUserDrawFuncVoid) ARGS((struct _userdraw *target));
- typedef struct _userdraw *
- (*RwUserDrawFuncInt) ARGS((struct _userdraw *target, RwInt32 arg));
- typedef struct _userdraw *
- (*RwUserDrawFuncLong) ARGS((struct _userdraw *target, RwInt32 arg));
- typedef struct _userdraw *
- (*RwUserDrawFuncReal) ARGS((struct _userdraw *target, RwReal arg));
- typedef struct _userdraw *
- (*RwUserDrawFuncPointer) ARGS((struct _userdraw *target, void *arg));
-
- /*
- * The User Draw Function Prototype
- */
- typedef struct _userdraw *(*RwUserDrawCallBack) ARGS((struct _userdraw *userdraw,
- void *ddimage,
- RwRect *rect,
- void *data));
-
- /* clump axis alignment types */
-
- typedef enum
- {
- rwNAAXISALIGNMENT=0,
- rwNOAXISALIGNMENT,
- rwALIGNAXISZORIENTX,
- rwALIGNAXISZORIENTY,
- rwALIGNAXISXYZ
- } RwAxisAlignment;
-
- /* codes used for interogating system information */
-
- typedef enum
- {
- rwNASYSTEMINFO=0,
- rwVERSIONSTRING,
- rwVERSIONMAJOR,
- rwVERSIONMINOR,
- rwVERSIONRELEASE,
- rwFIXEDPOINTLIB,
- rwDEBUGGINGLIB
- } RwSystemInfo;
-
- /*
- * Device info type.
- * Note this is defined as a int rather than an enumerated type
- * to make it simpler for individual devices to specify
- * addional pieces of device info.
- */
- typedef RwUInt32 RwDeviceInfo;
-
- /* Generic device info. */
- #define rwNADEVICEINFO (RwUInt32)0
- #define rwRENDERDEPTH (RwUInt32)1
- #define rwINDEXEDRENDERING (RwUInt32)2
- #define rwPALETTEBASED (RwUInt32)3
-
- /* For output devices with a hardware palette. */
- #define rwPALETTE (RwUInt32)4
- #define rwPALETTESIZE (RwUInt32)5
- #define rwFIRSTPALETTEENTRY (RwUInt32)6
- #define rwLASTPALETTEENTRY (RwUInt32)7
-
- /*First code available for device specific info types. */
- #define rwDEVICESPECIFICINFO (RwUInt32)1000
-
- typedef RwUInt32 RwDeviceAction;
-
- /* Generic device control actions. */
- #define rwNADEVICEACTION (RwUInt32)0
-
- /* First code available for device specific action types. */
- #define rwDEVICESPECIFICACTION (RwUInt32)1000
-
- /*
- * RwOpenExt paramater type. Contains a attribute-value pair for
- * device opening.
- */
- typedef RwUInt32 RwOpenOption;
- typedef struct
- {
- RwOpenOption option;
- void *value;
- } RwOpenArgument;
-
- /* Generic RwOpenExt paramaters. */
- #define rwNAOPENOPTION (RwUInt32)0
- #define rwNOOPENOPTION (RwUInt32)1
-
- #define rwGAMMACORRECT (RwUInt32)2
-
- /* First code available for device specific open options. */
- #define rwDEVICESPECIFICOPEN (RwUInt32)1000
-
- #define RWMAXPATHLEN 1024
-
- #endif
-