home *** CD-ROM | disk | FTP | other *** search
- #if !defined(_RWVIEW_H)
- #define _RWVIEW_H
-
- /**********************************************************************
- *
- * File : rwview.h
- *
- * Abstract : Common definitions shared by all modules in the
- * RenderWare 3D Object Viewer.
- *
- * This application had been written to be compatible with
- * both the fixed and floating-point versions of the
- * RenderWare library, i.e., it uses the macros CREAL,
- * INT2REAL, RAdd, RDiv, RSub etc. If your application is
- * intended for the floating-point version of the library
- * only these macros are not necessary.
- *
- * Please note that this application is intended for
- * demonstration purposes only. No support will be
- * provided for this code and it comes with no warranty.
- *
- **********************************************************************
- *
- * 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 obligation on Criterion Software Ltd. or
- * Canon Inc. to assist in its use or modification.
- *
- * Criterion Software Ltd. will not, under any
- * circumstances, be liable for any lost revenue or other damages arising
- * from the use of this file.
- *
- * Copyright (c) 1994, 1995 Criterion Software Ltd.
- * All Rights Reserved.
- *
- * RenderWare is a trademark of Canon Inc.
- *
- **********************************************************************/
-
- /**********************************************************************
- *
- * Header files.
- *
- **********************************************************************/
-
- /**********************************************************************
- *
- * Global data.
- *
- **********************************************************************/
-
- /*
- * The application instance handle (from rwview.c).
- */
- extern HINSTANCE AppInstance;
-
- /**********************************************************************
- *
- * Macro functions.
- *
- **********************************************************************/
-
- /*
- * Macros to convert real numbers in the range CREAL(0.0) to CREAL(1.0)
- * (which RenderWare uses to represent the value of a color channel) to
- * integers in the range 0 to 255 (which Windows uses to represent the
- * value of the a color channel). We use the Windows style in the user
- * interface because users are more used to 0 to 255.
- */
- #define BYTETOREAL(v) (RDiv(INT2REAL((RwInt32)(v)), CREAL(255.0)))
- #define REALTOBYTE(r) ((int)(REAL2INT(RMul((r), CREAL(255.0)))))
-
- /*
- * A macro to convert a RenderWare RwRGBColor to a Windows COLORREF.
- */
- #define RWTOCOLORREF(rgb) \
- (PALETTERGB(REALTOBYTE((rgb)->r), REALTOBYTE((rgb)->g), REALTOBYTE((rgb)->b)))
-
- /**********************************************************************
- *
- * Functions.
- *
- **********************************************************************/
-
- /*
- * Convert a RenderWare RwRGBColor to a Windows COLORREF.
- */
- extern COLORREF RGBToColorRef(RwRGBColor *rgb);
-
- /*
- * Convert a Windows COLORREF to a RenderWare RwRGBColor.
- */
- extern RwRGBColor *ColorRefToRGB(COLORREF color, RwRGBColor *rgb);
-
- /**********************************************************************/
-
- #endif /* !defined(_RWVIEW_H) */
-