Added debugging pragma message.
[mesa.git] / src / glu / mesa / tess.h
1 /* $Id: tess.h,v 1.6 1999/09/15 02:12:16 gareth Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.1
6 *
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27 /*
28 * $Log: tess.h,v $
29 * Revision 1.6 1999/09/15 02:12:16 gareth
30 * Added debugging pragma message.
31 *
32 * Revision 1.5 1999/09/14 22:46:02 gareth
33 * Added debugging output.
34 *
35 * Revision 1.4 1999/09/13 22:20:13 gareth
36 * Fixed file headers. Tracking down macro bugs.
37 *
38 */
39
40 /*****************************************************************************
41 *
42 * GLU 1.3 Polygon Tessellation by Gareth Hughes <garethh@lucent.com>
43 *
44 *****************************************************************************/
45
46 #ifndef __GLU_TESS_H__
47 #define __GLU_TESS_H__
48
49 #include <stdarg.h>
50 #include <stdio.h>
51
52 #include "gluP.h"
53
54 #include "tess_typedefs.h"
55 #include "tess_heap.h"
56 #if 0
57 #include "tess_grid.h"
58 #endif
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63
64 /*****************************************************************************
65 * The GLUtesselator structure:
66 *****************************************************************************/
67 struct GLUtesselator
68 {
69 tess_callbacks_t callbacks;
70 GLboolean boundary_only;
71 GLenum winding_rule;
72 GLdouble tolerance;
73 tess_plane_t plane;
74 GLuint contour_count;
75 tess_contour_t *contours, *last_contour;
76 tess_contour_t *current_contour;
77 GLdouble mins[2], maxs[2];
78 GLuint vertex_count;
79 tess_vertex_t **sorted_vertices;
80 #if 0
81 tess_grid_t *grid; /* Not currently used... */
82 #endif
83 heap_t *heap;
84 GLenum error;
85 };
86
87
88 /*****************************************************************************
89 * Tessellation error handler:
90 *****************************************************************************/
91 extern void tess_error_callback( GLUtesselator *, GLenum, void * );
92
93
94 /*****************************************************************************
95 * Debugging output: (to be removed...)
96 *****************************************************************************/
97 #ifdef DEBUG
98 extern int tess_debug_level;
99 int vdebugstr( char *format_str, ... );
100
101 #pragma message( "tess: using DEBUGP for debugging output" )
102 #define DEBUGP(level, body) \
103 do { \
104 if ( tess_debug_level >= level ) { \
105 vdebugstr( "%11.11s:%-5d ", __FILE__, __LINE__, level ); \
106 vdebugstr body; \
107 fflush( stderr ); \
108 } \
109 } while ( 0 )
110 #define DEBUGIF(level) do { if ( tess_debug_level >= level ) {
111 #define DEBUGENDIF } } while ( 0 )
112 #else
113 #define DEBUGP(level, body)
114 #define DEBUGIF(level) while(0) {
115 #define DEBUGENDIF }
116 #endif
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif /* __GLU_TESS_H__ */