]> Dogcows Code - chaz/rasterize/blob - config.hh
finishing fifth project
[chaz/rasterize] / config.hh
1
2 /*
3 * CS5600 University of Utah
4 * Charles McGarvey
5 * mcgarvey@eng.utah.edu
6 */
7
8 #ifndef _CONFIG_H_
9 #define _CONFIG_H_
10
11 /*
12 * DOUBLE_FLOAT
13 * If enabled, scalars will be of type double. This provides and insane level
14 * of precision at a performance cost. The default behavior just uses floats.
15 */
16 #if DOUBLE_FLOAT
17 #define IF_DOUBLE_FLOAT(X) X
18 #else
19 #define IF_DOUBLE_FLOAT(X)
20 #endif
21
22 /*
23 * EXPORT_BMP
24 * If enabled, each scene rasterization will be saved as a BMP image file.
25 * This is on unless explicitly disabled.
26 */
27 #ifndef EXPORT_BMP
28 #define EXPORT_BMP 1
29 #endif
30 #if EXPORT_BMP
31 #define IF_EXPORT_BMP(X) X
32 #else
33 #define IF_EXPORT_BMP(X)
34 #endif
35
36 /*
37 * EXPORT_PPM
38 * If enabled, each scene rasterization will be saved as a PPM image file.
39 * This is on unless explicitly disabled.
40 */
41 #ifndef EXPORT_PPM
42 #define EXPORT_PPM 1
43 #endif
44 #if EXPORT_PPM
45 #define IF_EXPORT_PPM(X) X
46 #else
47 #define IF_EXPORT_PPM(X)
48 #endif
49
50 /*
51 * EXTRA_INLINE
52 * If enabled, functions that are defined in interface files will be marked as
53 * inline. The compiler will generally inline functions according to its own
54 * optimization heuristics, and this inline marking may persuade the compiler
55 * to inline a function that it otherwise would not. This option may bring a
56 * small performance boost, but it can also increase the size of the program
57 * executable.
58 */
59 #if EXTRA_INLINE
60 #define IF_EXTRA_INLINE(X) X
61 #else
62 #define IF_EXTRA_INLINE(X)
63 #endif
64
65 /*
66 * NDEBUG
67 * If enabled, assertions and other nonessential checks will not be compiled
68 * into the programs.
69 */
70 #if NDEBUG
71 #define IF_NDEBUG(X) X
72 #else
73 #define IF_NDEBUG(X)
74 #endif
75
76 /*
77 * SHADOWS
78 * If enabled, scene elements will cast shadows on other elements.
79 */
80 #if SHADOWS
81 #define IF_SHADOWS(X) X
82 #else
83 #define IF_SHADOWS(X)
84 #endif
85
86 /*
87 * TEXTURING
88 * If enabled, the first element of a scene will be textured with the
89 * raster from texture.ppm or texture.bmp.
90 */
91 #if TEXTURING
92 #define IF_TEXTURING(X) X
93 #else
94 #define IF_TEXTURING(X)
95 #endif
96
97 /*
98 * QUIRKS
99 * If enabled, compatibility quirks particular to the project assignment
100 * will be turned on, causing the output to match more closely with the
101 * provided examples.
102 */
103 #if QUIRKS
104 #define IF_QUIRKS(X) X
105 #else
106 #define IF_QUIRKS(X)
107 #endif
108
109 /*
110 * VERBOSITY
111 * If enabled, a description of what is happening will be printed to stdout.
112 * Otherwise, nothing is printed. The behavior of this option is effected by
113 * its precise value:
114 * 1 Print just a few very general descriptions.
115 * 2 After rasterization, also print the triangle count and other
116 * information that may be interesting.
117 * 3 Also print the number of seconds it took to render the entire scene,
118 * according to wall time.
119 * 4 Also print the number of triangles as they are being rastered. This
120 * uses ANSI escape codes which may not be supported on all terminals.
121 * It also causes a lot to be printed, so it can actually decrease render
122 * performance, especially on a slow (or remote) terminal.
123 * The default setting for this option is 3.
124 */
125 #ifndef VERBOSITY
126 #define VERBOSITY 3
127 #endif
128 #if VERBOSITY >= 2
129 #define IF_RASTER_STATS(X) X
130 #else
131 #define IF_RASTER_STATS(X)
132 #endif
133 #if VERBOSITY >= 3
134 #define IF_RENDER_TIMER(X) X
135 #else
136 #define IF_RENDER_TIMER(X)
137 #endif
138 #if VERBOSITY >= 4
139 #define IF_RENDER_PROGRESS(X) X
140 #else
141 #define IF_RENDER_PROGRESS(X)
142 #endif
143
144 #endif // _CONFIG_H_
145
This page took 0.037557 seconds and 4 git commands to generate.