1 /* $Id: nurbs.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
4 * Mesa 3-D graphics library
6 * Copyright (C) 1995-2000 Brian Paul
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.
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.
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.
25 * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
26 * See README2 for more info.
41 call_user_error(GLUnurbsObj
* nobj
, GLenum error
)
44 if (nobj
->error_callback
!= NULL
) {
45 (*(nobj
->error_callback
)) (error
);
48 printf("NURBS error %d %s\n", error
, (char *) gluErrorString(error
));
54 GLUnurbsObj
*GLAPIENTRY
55 gluNewNurbsRenderer(void)
58 GLfloat tmp_viewport
[4];
61 n
= (GLUnurbsObj
*) malloc(sizeof(GLUnurbsObj
));
68 gluDeleteNurbsRenderer(GLUnurbsObj
* nobj
)
78 gluLoadSamplingMatrices(GLUnurbsObj
* nobj
,
79 const GLfloat modelMatrix
[16],
80 const GLfloat projMatrix
[16], const GLint viewport
[4])
86 gluNurbsProperty(GLUnurbsObj
* nobj
, GLenum property
, GLfloat value
)
92 gluGetNurbsProperty(GLUnurbsObj
* nobj
, GLenum property
, GLfloat
* value
)
99 gluBeginCurve(GLUnurbsObj
* nobj
)
105 gluEndCurve(GLUnurbsObj
* nobj
)
111 gluNurbsCurve(GLUnurbsObj
* nobj
, GLint nknots
, GLfloat
* knot
,
112 GLint stride
, GLfloat
* ctlarray
, GLint order
, GLenum type
)
118 gluBeginSurface(GLUnurbsObj
* nobj
)
124 gluEndSurface(GLUnurbsObj
* nobj
)
130 gluNurbsSurface(GLUnurbsObj
* nobj
,
131 GLint sknot_count
, GLfloat
* sknot
,
132 GLint tknot_count
, GLfloat
* tknot
,
133 GLint s_stride
, GLint t_stride
,
134 GLfloat
* ctrlarray
, GLint sorder
, GLint torder
, GLenum type
)
140 gluNurbsCallback(GLUnurbsObj
* nobj
, GLenum which
, void (GLCALLBACK
* fn
) ())
145 gluBeginTrim(GLUnurbsObj
* nobj
)
150 gluPwlCurve(GLUnurbsObj
* nobj
, GLint count
, GLfloat
* array
, GLint stride
,
156 gluEndTrim(GLUnurbsObj
* nobj
)