source: trunk/src/opengl/glu/nurbs/interface/glrenderer.h

Last change on this file was 3079, checked in by jeroen, 26 years ago

* empty log message *

File size: 5.1 KB
Line 
1/* $Id: glrenderer.h,v 1.2 2000-03-11 09:05:02 jeroen Exp $ */
2/*
3** License Applicability. Except to the extent portions of this file are
4** made subject to an alternative license as permitted in the SGI Free
5** Software License B, Version 1.0 (the "License"), the contents of this
6** file are subject only to the provisions of the License. You may not use
7** this file except in compliance with the License. You may obtain a copy
8** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
9** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
10**
11** http://oss.sgi.com/projects/FreeB
12**
13** Note that, as provided in the License, the Software is distributed on an
14** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
15** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
16** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
17** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18**
19** Original Code. The Original Code is: OpenGL Sample Implementation,
20** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
21** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
22** Copyright in any portions created by third parties is as indicated
23** elsewhere herein. All Rights Reserved.
24**
25** Additional Notice Provisions: The application programming interfaces
26** established by SGI in conjunction with the Original Code are The
27** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
28** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
29** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
30** Window System(R) (Version 1.3), released October 19, 1998. This software
31** was created using the OpenGL(R) version 1.2.1 Sample Implementation
32** published by SGI, but has not been independently verified as being
33** compliant with the OpenGL(R) version 1.2.1 Specification.
34*/
35
36/*
37 * glrenderer.h
38 *
39 * $Date: 2000-03-11 09:05:02 $ $Revision: 1.2 $
40 * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/opengl/glu/nurbs/interface/glrenderer.h,v 1.2 2000-03-11 09:05:02 jeroen Exp $
41 */
42
43#ifndef __gluglrenderer_h_
44#define __gluglrenderer_h_
45
46#include "gl.h"
47#include "glu.h"
48#include "nurbstess.h"
49#include "glsurfeval.h"
50#include "glcurveval.h"
51
52class GLUnurbs : public NurbsTessellator {
53
54public:
55 GLUnurbs( void );
56 void loadGLMatrices( void );
57 void useGLMatrices( const GLfloat modelMatrix[16],
58 const GLfloat projMatrix[16],
59 const GLint viewport[4] );
60 void setSamplingMatrixIdentity( void );
61
62 void errorHandler( int );
63 void bgnrender( void );
64 void endrender( void );
65 void setautoloadmode( INREAL value )
66 {
67
68 if (value) autoloadmode = GL_TRUE;
69 else autoloadmode = GL_FALSE;
70
71 }
72 GLboolean getautoloadmode( void ) { return autoloadmode; }
73
74 void (GLCALLBACK *errorCallback)( GLenum );
75 void postError( int which )
76 { if (errorCallback) (*errorCallback)( (GLenum)which ); }
77
78 void putSurfCallBack(GLenum which, GLvoid (GLCALLBACK *fn)(...))
79 {
80 curveEvaluator.putCallBack(which, fn);
81 surfaceEvaluator.putCallBack(which, fn);
82 }
83
84 int get_vertices_call_back()
85 {
86 return surfaceEvaluator.get_vertices_call_back();
87 }
88
89 void put_vertices_call_back(int flag)
90 {
91 surfaceEvaluator.put_vertices_call_back(flag);
92 }
93
94 int get_callback_auto_normal()
95 {
96 return surfaceEvaluator.get_callback_auto_normal();
97 }
98
99 void put_callback_auto_normal(int flag)
100 {
101 surfaceEvaluator.put_callback_auto_normal(flag);
102 }
103
104 void setNurbsCallbackData(void* userData)
105 {
106 curveEvaluator.set_callback_userData(userData);
107 surfaceEvaluator.set_callback_userData(userData);
108 }
109
110
111 //for LOD
112 void LOD_eval_list(int level)
113 {
114 surfaceEvaluator.LOD_eval_list(level);
115 }
116
117 //NEWCALLBACK
118 int is_callback()
119 {
120 return callbackFlag;
121 }
122 void put_callbackFlag(int flag)
123 {
124 callbackFlag = flag;
125 surfaceEvaluator.put_vertices_call_back(flag);
126 curveEvaluator.put_vertices_call_back(flag);
127 }
128
129private:
130 GLboolean autoloadmode;
131 OpenGLSurfaceEvaluator surfaceEvaluator;
132 OpenGLCurveEvaluator curveEvaluator;
133
134 void loadSamplingMatrix( const GLfloat vmat[4][4],
135 const GLint viewport[4] );
136 void loadCullingMatrix( GLfloat vmat[4][4] );
137 static void grabGLMatrix( GLfloat vmat[4][4] );
138 static void transform4d( GLfloat A[4], GLfloat B[4],
139 GLfloat mat[4][4] );
140 static void multmatrix4d( GLfloat n[4][4], GLfloat left[4][4],
141 GLfloat right[4][4] );
142
143 int callbackFlag;
144};
145
146#endif /* __gluglrenderer_h_ */
Note: See TracBrowser for help on using the repository browser.