fixes to make old GLU code compile with new GLU 1.3 header
[mesa.git] / src / glu / mesa / tess.h
1 /* $Id: tess.h,v 1.18 2001/03/20 17:56:10 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 * Copyright (C) 1995-2000 Brian Paul
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23
24 /*
25 * This file is part of the polygon tesselation code contributed by
26 * Bogdan Sikorski
27 */
28
29
30 #ifndef TESS_H
31 #define TESS_H
32
33
34 #include "gluP.h"
35
36 #define EPSILON 1e-06 /* epsilon for double precision compares */
37
38 typedef enum
39 {
40 OXY,
41 OYZ,
42 OXZ
43 }
44 projection_type;
45
46 typedef struct callbacks_str
47 {
48 void (GLCALLBACK * begin) (GLenum mode);
49 void (GLCALLBACK * edgeFlag) (GLboolean flag);
50 void (GLCALLBACK * vertex) (GLvoid * v);
51 void (GLCALLBACK * end) (void);
52 void (GLCALLBACK * error) (GLenum err);
53 }
54 tess_callbacks;
55
56 typedef struct vertex_str
57 {
58 void *data;
59 GLdouble location[3];
60 GLdouble x, y;
61 GLboolean edge_flag;
62 struct vertex_str *shadow_vertex;
63 struct vertex_str *next, *previous;
64 }
65 tess_vertex;
66
67 typedef struct contour_str
68 {
69 GLenum type;
70 GLuint vertex_cnt;
71 GLdouble area;
72 GLenum orientation;
73 struct vertex_str *vertices, *last_vertex;
74 struct contour_str *next, *previous;
75 }
76 tess_contour;
77
78 typedef struct polygon_str
79 {
80 GLuint vertex_cnt;
81 GLdouble A, B, C, D;
82 GLdouble area;
83 GLenum orientation;
84 struct vertex_str *vertices, *last_vertex;
85 }
86 tess_polygon;
87
88 struct GLUtesselator
89 {
90 tess_contour *contours, *last_contour;
91 GLuint contour_cnt;
92 tess_callbacks callbacks;
93 tess_polygon *current_polygon;
94 GLenum error;
95 GLdouble A, B, C, D;
96 projection_type projection;
97 };
98
99
100 extern void tess_call_user_error(GLUtriangulatorObj *, GLenum);
101 extern void tess_test_polygon(GLUtriangulatorObj *);
102 extern void tess_find_contour_hierarchies(GLUtriangulatorObj *);
103 extern void tess_handle_holes(GLUtriangulatorObj *);
104 extern void tess_tesselate(GLUtriangulatorObj *);
105 extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *);
106
107
108 #endif