home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povsrc20 / os2conf.h < prev    next >
C/C++ Source or Header  |  1993-09-27  |  8KB  |  170 lines

  1. /****************************************************************************
  2. *                os2conf.h
  3. *
  4. *  This header file contains all constants and types required to compile a
  5. *  text mode only EXE of POV-Ray for use with OS/2 2.x.
  6. *  RENAME this file to CONFIG.H before compiling.
  7. *
  8. *  Developed for & with IBM's CSet/2 C/C++ compiler.
  9. *
  10. *  From Persistence of Vision Raytracer 
  11. *  Copyright 1991, 1992, 1993 Persistence of Vision Team
  12. *  Bill Pulver 2-1-93
  13. *---------------------------------------------------------------------------
  14. *  NOTICE: This source code file is provided so that users may experiment
  15. *  with enhancements to POV-Ray and to port the software to platforms other
  16. *  than those supported by the POV-Ray Team.  There are strict rules under
  17. *  which you are permitted to use this file.  The rules are in the file
  18. *  named POVLEGAL.DOC which should be distributed with this file. If
  19. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  20. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  21. *  Forum. (GO GRAPHDEV) The latest version of POV-Ray may be found there 
  22. *  as well.
  23. *
  24. * This program is based on the popular DKB raytracer version 2.12.
  25. * DKBTrace was originally written by David K. Buck.
  26. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  27. *
  28. *****************************************************************************/
  29. /*  Below are several defines needed by the generic parts of POV.  You
  30. *   may redefine them as needed in this config.h file.
  31. *
  32. *   The following constants are needed by various POV modules.  Each has
  33. *   a default (shown below) which is will be defined in frame.h if you don't 
  34. *   define them here.
  35. *
  36. *   #define EPSILON 1.0e-10               - a small value used for POLY
  37. *   #define FILE_NAME_LENGTH 150          - default file name length
  38. *   #define HUGE_VAL 1.0e+17              - a really big number
  39. *   #define DBL_FORMAT_STRING "%lf"       - the string to use for scanfs of doubles
  40. *   #define DEFAULT_OUTPUT_FORMAT  'd'    - the default +f format
  41. *   #define RED_RAW_FILE_EXTENSION ".red" - for +fr, this is the extension for the
  42. *                                           red file
  43. *   #define GREEN_RAW_FILE_EXTENSION ".grn"  - ditto for the green file
  44. *   #define BLUE_RAW_FILE_EXTENSION ".blu"   - ditto again for the blue file
  45. *   #define FILENAME_SEPARATOR "/"        - the character that separates names
  46. *                                           in a path.
  47. *   #define CASE_SENSITIVE_DEFAULT 2     - controls case sensitivity in DAT files
  48. *   #define READ_FILE_STRING "rb"        - special binary (raw, uncooked) 
  49. *   #define WRITE_FILE_STRING "wb"         modes of fopen()
  50. *   #define APPEND_FILE_STRING "ab"
  51. *   #define NORMAL '0'                   - machine-specific PaletteOption settings 
  52. *   #define GREY   'G'
  53. *
  54. *   These routines are required by POV to compute trace times.  The defaults 
  55. *   shown below are defined in most versions of C.  You may redefine them if
  56. *   your compiler doesn't support these.  If time is completely unsupported 
  57. *   define them as 0.
  58. *
  59. *   #define START_TIME time(&tstart);     
  60. *   #define STOP_TIME  time(&tstop);
  61. *   #define TIME_ELAPSED difftime (tstop, tstart);
  62. *
  63. *   Note difftime can be replaced with: #define TIME_ELAPSED (tstop - tstart); 
  64. *   in some cases. 
  65. *
  66. *   These are optional routines that POV calls.  You may define them
  67. *   or if undefined they will be defined as empty in frame.h.
  68. *
  69. *   #define STARTUP_POVRAY       - first executable statement of main
  70. *                                  (useful for initialization)
  71. *   #define PRINT_OTHER_CREDITS  - used for people who extend the machine specific modules
  72. *                                  (put your own printf's here)
  73. *   #define TEST_ABORT           - code to test for ^C or abort
  74. *                                  (called on each pixel)
  75. *   #define FINISH_POVRAY        - last statement before exiting normally
  76. *   #define COOPERATE            - called for multi-tasking
  77. *  
  78. *   These items are standard on some C compilers.  If they are not defined
  79. *   on your compiler or are called something different you may define your 
  80. *   own or use the defaults supplied in frame.h as shown below.
  81. *
  82. *   #define DBL double                    - floating point precision
  83. *   #define ACOS acos                     - arc cosine of DBL
  84. *   #define SQRT sqrt                     - square root of DBL
  85. *   #define POW pow                       - x to the y power - x, y DBL
  86. *   #define COS cos                       - cosine of DBL
  87. *   #define SIN sin                       - sine of DBL
  88. *   #define labs(x) (long) ((x<0)?-x:x)   - Returns the absolute value of long integer x
  89. *   #define max (x,y) ((x<y)?y:x)         - greater of x and y
  90. *
  91. *   On some systems "sprintf" returns the string rather than the length
  92. *   of the string.  If the string is returned, define the following:
  93. *   #define STRLN(x) strlen(x)
  94. *
  95. *   #define setvbuf(w,x,y,z)              - some systems don't understand setvbuf.
  96. *                                           If not, just define it away - it's
  97. *                                           not critical to the raytracer.  It
  98. *                                           just buffers disk accesses.
  99. *   This macro controls prototyping and is required by POV.  Choose one
  100. *   of the two options below or if left undefined it will default to ANSI 
  101. *   in frame.h
  102. *
  103. *   #define PARAMS (x) x                  - do ANSI prototyping
  104. *   #define PARAMS (x) ()                 - do K&R non-ANSI prototyping
  105. *
  106. *   These allow command line vs non-command line versions and alternate
  107. *   main routines.  Normally they should be undefined.  Define them 1 if needed.
  108. *   #define ALTMAIN 1
  109. *   #define NOCMDLINE 1
  110. ****************************************************/
  111.  
  112. #ifdef _STDC_
  113. #define PARAMS(x) x
  114. #else
  115. #define PARAMS(x) ()
  116. #define volatile
  117. #endif
  118.  
  119. #define COMPILER_VER ".ibmCset/2++"
  120. #define DBL double
  121.  
  122.  
  123. /* Mask floating point underflow, etc. for IBM C Set/2, 2 ways are          */
  124. /* defined below.                                                           */
  125. /* IBM C Set/2 does not trap open matherr, we must use _control87 to trap   */
  126. /* them. We must also disable stream buffering. NOTE: The I/O buffer        */
  127. /* disabling is handled as MACRO invoked from the makefile in this case.    */
  128. /* (NOPRNBUF)                                                               */
  129.  
  130. #include <conio.h>                       
  131. #include <float.h>
  132.  
  133. /* #define CONFIG_MATH _control87 (CW_DEFAULT + EM_UNDERFLOW + EM_OVERFLOW + EM_ZERODIVIDE, MCW_EM);*/
  134. #define CONFIG_MATH _control87(MCW_EM, MCW_EM);
  135.  
  136. #ifdef NOPRNBUF
  137. void Initialize (void)
  138. {
  139.   /* Disable buffering for ...printf calls for C Set/2 */
  140.   setvbuf (stdout, NULL, _IONBF, 0);
  141.   setvbuf (stderr, NULL, _IONBF, 0);
  142. }
  143. #define STARTUP_POVRAY Initialize ();
  144. #endif
  145.  
  146.  
  147.  
  148. /* Define default output file format as TARGA */
  149. #define DEFAULT_OUTPUT_FORMAT   't'
  150.  
  151.  
  152.  
  153. /* Allow Keyboard abort, slows down rendering quite a bit under OS/2 due to */
  154. /* KB polling. IDLE_TIME may be able to compensate to a certain extent....  */
  155. /* NOTE THAT YOU MAY NEED TO ADD/DELETE UNDERSCORES IN FRONT OF kbhit AND   */
  156. /* getch. It compiles fine either way for me but did not work for another   */
  157. /* person until the "_"'s were deleted.......                               */
  158.  
  159. #define TEST_ABORT if (Options & EXITENABLE) if (kbhit()) { Stop_Flag = TRUE; getch(); }
  160.  
  161. #define EPSILON 1.0e-15
  162.  
  163.  
  164. /* Need prototypes for these standard routines */
  165.  
  166. char *getenv PARAMS((char *name));
  167. char *malloc PARAMS((int size));
  168. void free PARAMS((void *));
  169. #define MAIN_TYPE int
  170.