xref: /reactos/dll/opengl/glu32/src/libutil/glue.c (revision 8a978a17)
1 /*
2  * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3  * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice including the dates of first publication and
13  * either this permission notice or a reference to
14  * http://oss.sgi.com/projects/FreeB/
15  * shall be included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  *
25  * Except as contained in this notice, the name of Silicon Graphics, Inc.
26  * shall not be used in advertising or otherwise to promote the sale, use or
27  * other dealings in this Software without prior written authorization from
28  * Silicon Graphics, Inc.
29  */
30 
31 //#include <stdlib.h>
32 //#include "gluint.h"
33 
34 static unsigned char *__gluNurbsErrors[] = {
35     (unsigned char*) " ",
36     (unsigned char*) "spline order un-supported",
37     (unsigned char*) "too few knots",
38     (unsigned char*) "valid knot range is empty",
39     (unsigned char*) "decreasing knot sequence knot",
40     (unsigned char*) "knot multiplicity greater than order of spline",
41     (unsigned char*) "gluEndCurve() must follow gluBeginCurve()",
42     (unsigned char*) "gluBeginCurve() must precede gluEndCurve()",
43     (unsigned char*) "missing or extra geometric data",
44     (unsigned char*) "can't draw piecewise linear trimming curves",
45     (unsigned char*) "missing or extra domain data",
46     (unsigned char*) "missing or extra domain data",
47     (unsigned char*) "gluEndTrim() must precede gluEndSurface()",
48     (unsigned char*) "gluBeginSurface() must precede gluEndSurface()",
49     (unsigned char*) "curve of improper type passed as trim curve",
50     (unsigned char*) "gluBeginSurface() must precede gluBeginTrim()",
51     (unsigned char*) "gluEndTrim() must follow gluBeginTrim()",
52     (unsigned char*) "gluBeginTrim() must precede gluEndTrim()",
53     (unsigned char*) "invalid or missing trim curve",
54     (unsigned char*) "gluBeginTrim() must precede gluPwlCurve()",
55     (unsigned char*) "piecewise linear trimming curve referenced twice",
56     (unsigned char*) "piecewise linear trimming curve and nurbs curve mixed",
57     (unsigned char*) "improper usage of trim data type",
58     (unsigned char*) "nurbs curve referenced twice",
59     (unsigned char*) "nurbs curve and piecewise linear trimming curve mixed",
60     (unsigned char*) "nurbs surface referenced twice",
61     (unsigned char*) "invalid property",
62     (unsigned char*) "gluEndSurface() must follow gluBeginSurface()",
63     (unsigned char*) "intersecting or misoriented trim curves",
64     (unsigned char*) "intersecting trim curves",
65     (unsigned char*) "UNUSED",
66     (unsigned char*) "unconnected trim curves",
67     (unsigned char*) "unknown knot error",
68     (unsigned char*) "negative vertex count encountered",
69     (unsigned char*) "negative byte-stride encounteed",
70     (unsigned char*) "unknown type descriptor",
71     (unsigned char*) "null control point reference",
72     (unsigned char*) "duplicate point on piecewise linear trimming curve",
73 };
74 
75 const unsigned char *__gluNURBSErrorString( int errnum )
76 {
77     return __gluNurbsErrors[errnum];
78 }
79 
80 static unsigned char *__gluTessErrors[] = {
81     (unsigned char*) " ",
82     (unsigned char*) "gluTessBeginPolygon() must precede a gluTessEndPolygon()",
83     (unsigned char*) "gluTessBeginContour() must precede a gluTessEndContour()",
84     (unsigned char*) "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
85     (unsigned char*) "gluTessEndContour() must follow a gluTessBeginContour()",
86     (unsigned char*) "a coordinate is too large",
87     (unsigned char*) "need combine callback",
88 };
89 
90 const unsigned char *__gluTessErrorString( int errnum )
91 {
92     return __gluTessErrors[errnum];
93 } /* __glTessErrorString() */
94