home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / samples.z / grDefines.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-10  |  1.7 KB  |  56 lines

  1. /*-------------------------------------------------------------------------
  2.  
  3.     Modified from original source by CS 488.
  4.     Copyright (c) Ivan Bowman, 1995. All rights reserved.
  5.     This code has been submitted for CS 488. 
  6.  
  7.     Ivan Bowman         90037932        itbowman@descartes
  8.  
  9.     src/defines.h -- header file for general definitions
  10.  
  11.     Modified    By              Reason
  12.     --------    --              ------
  13.     ??-???-??   CS 488          Initial implementation
  14.     18-dec-94   Ivan Bowman     Modified for assignment one
  15.     28-dec-94   Ivan Bowman     Added Events, Epsilon for assignment two
  16.  
  17.   -------------------------------------------------------------------------*/
  18.  
  19. #ifndef _GRDEFINES_H
  20. #define _GRDEFINES_H
  21.  
  22. #define grTRUE      1
  23. #define grFALSE     0
  24. #define grBoolean   int                 /* boolean values */
  25.  
  26. #define grEPSILON   0.000001            /* epsilon for graphics */
  27.  
  28. typedef unsigned uint;                  /* unsigned integer */
  29.  
  30. typedef struct grPoint {                /* STRUCTURE TO REPRESENT POINT */
  31.    float x, y;                          /* -- x/y position */
  32. } grPoint;
  33.  
  34. extern void grError( const char * );
  35.  
  36. /*
  37.  * Debugging levels:
  38.  */
  39.  
  40. #define grDBG_NONE          0x0         /* no debugging */
  41. #define grDBG_ASSERTIONS    0x1         /* turn assertions on */
  42. #define grDBG_ALL           0xffff      /* all debugging info on */
  43.  
  44. #if !defined( DEBUG )
  45. #  define DEBUG grDBG_NONE
  46. #endif
  47.  
  48. #if (DEBUG & grDBG_ASSERTIONS)
  49.    extern void grAssertion( grBoolean expr, char * ex_str, char * fl, long ln );
  50. #  define grAssert( x ) ((x)?(void)0:grAssertion( 0, #x, __FILE__, __LINE__ )
  51. #else
  52. #  define grAssert(__ignore) ((void)0)
  53. #endif
  54.  
  55. #endif /* _GRDEFINES_H */
  56.