1 | /*
|
---|
2 | *
|
---|
3 | * Copyright (c) 2002, NVIDIA Corporation.
|
---|
4 | *
|
---|
5 | *
|
---|
6 | *
|
---|
7 | * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
|
---|
8 | * of your agreement to the following terms, and your use, installation,
|
---|
9 | * modification or redistribution of this NVIDIA software constitutes
|
---|
10 | * acceptance of these terms. If you do not agree with these terms, please do
|
---|
11 | * not use, install, modify or redistribute this NVIDIA software.
|
---|
12 | *
|
---|
13 | *
|
---|
14 | *
|
---|
15 | * In consideration of your agreement to abide by the following terms, and
|
---|
16 | * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
|
---|
17 | * under NVIDIAs copyrights in this original NVIDIA software (the "NVIDIA
|
---|
18 | * Software"), to use, reproduce, modify and redistribute the NVIDIA
|
---|
19 | * Software, with or without modifications, in source and/or binary forms;
|
---|
20 | * provided that if you redistribute the NVIDIA Software, you must retain the
|
---|
21 | * copyright notice of NVIDIA, this notice and the following text and
|
---|
22 | * disclaimers in all such redistributions of the NVIDIA Software. Neither the
|
---|
23 | * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
|
---|
24 | * to endorse or promote products derived from the NVIDIA Software without
|
---|
25 | * specific prior written permission from NVIDIA. Except as expressly stated
|
---|
26 | * in this notice, no other rights or licenses express or implied, are granted
|
---|
27 | * by NVIDIA herein, including but not limited to any patent rights that may be
|
---|
28 | * infringed by your derivative works or by other works in which the NVIDIA
|
---|
29 | * Software may be incorporated. No hardware is licensed hereunder.
|
---|
30 | *
|
---|
31 | *
|
---|
32 | *
|
---|
33 | * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
|
---|
34 | * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
|
---|
35 | * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
---|
36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
|
---|
37 | * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
|
---|
38 | *
|
---|
39 | *
|
---|
40 | *
|
---|
41 | * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
---|
42 | * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
|
---|
43 | * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
---|
44 | * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
|
---|
45 | * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
|
---|
46 | * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
|
---|
47 | * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
|
---|
48 | * OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
49 | *
|
---|
50 | */
|
---|
51 |
|
---|
52 | #ifndef _cggl_h
|
---|
53 | #define _cggl_h
|
---|
54 |
|
---|
55 |
|
---|
56 |
|
---|
57 | #include <Cg/cg.h>
|
---|
58 |
|
---|
59 | /* Set up for either Win32 import/export/lib. */
|
---|
60 | #ifndef CGGLDLL_API
|
---|
61 | #if WIN32
|
---|
62 | # include <windows.h>
|
---|
63 | #ifdef CGGLDLL_EXPORTS
|
---|
64 | #define CGGLDLL_API __declspec(dllexport)
|
---|
65 | #elif defined (CG_LIB)
|
---|
66 | #define CGGLDLL_API
|
---|
67 | #else
|
---|
68 | #define CGGLDLL_API __declspec(dllimport)
|
---|
69 | #endif
|
---|
70 | #else
|
---|
71 | #define CGGLDLL_API
|
---|
72 | #endif
|
---|
73 | #endif
|
---|
74 |
|
---|
75 | #ifdef __APPLE__
|
---|
76 | #include <OpenGL/gl.h>
|
---|
77 | #else
|
---|
78 | #include <GL/gl.h>
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | #ifdef __cplusplus
|
---|
82 | extern "C" {
|
---|
83 | #endif
|
---|
84 |
|
---|
85 | /*****************************************************************************/
|
---|
86 | /*** cgGL Type Definitions ***/
|
---|
87 | /*****************************************************************************/
|
---|
88 |
|
---|
89 | typedef enum
|
---|
90 | {
|
---|
91 | CG_GL_MATRIX_IDENTITY = 0,
|
---|
92 | CG_GL_MATRIX_TRANSPOSE = 1,
|
---|
93 | CG_GL_MATRIX_INVERSE = 2,
|
---|
94 | CG_GL_MATRIX_INVERSE_TRANSPOSE = 3,
|
---|
95 |
|
---|
96 | CG_GL_MODELVIEW_MATRIX,
|
---|
97 | CG_GL_PROJECTION_MATRIX,
|
---|
98 | CG_GL_TEXTURE_MATRIX,
|
---|
99 | CG_GL_MODELVIEW_PROJECTION_MATRIX,
|
---|
100 |
|
---|
101 | CG_GL_VERTEX,
|
---|
102 | CG_GL_FRAGMENT,
|
---|
103 |
|
---|
104 | } CGGLenum;
|
---|
105 |
|
---|
106 |
|
---|
107 | #ifndef CGGL_EXPLICIT
|
---|
108 |
|
---|
109 | /******************************************************************************
|
---|
110 | *** Profile Functions
|
---|
111 | *****************************************************************************/
|
---|
112 |
|
---|
113 | CGGLDLL_API CGbool cgGLIsProfileSupported(CGprofile profile);
|
---|
114 |
|
---|
115 | CGGLDLL_API void cgGLEnableProfile(CGprofile profile);
|
---|
116 | CGGLDLL_API void cgGLDisableProfile(CGprofile profile);
|
---|
117 |
|
---|
118 | CGGLDLL_API CGprofile cgGLGetLatestProfile(CGGLenum profile_type);
|
---|
119 | CGGLDLL_API void cgGLSetOptimalOptions(CGprofile profile);
|
---|
120 |
|
---|
121 | /******************************************************************************
|
---|
122 | *** Program Managment Functions
|
---|
123 | *****************************************************************************/
|
---|
124 |
|
---|
125 | CGGLDLL_API void cgGLLoadProgram(CGprogram program);
|
---|
126 | CGGLDLL_API CGbool cgGLIsProgramLoaded(CGprogram program);
|
---|
127 | CGGLDLL_API void cgGLBindProgram(CGprogram program);
|
---|
128 | CGGLDLL_API void cgGLUnbindProgram(CGprofile profile);
|
---|
129 | CGGLDLL_API GLuint cgGLGetProgramID(CGprogram program);
|
---|
130 |
|
---|
131 | /******************************************************************************
|
---|
132 | *** Parameter Managment Functions
|
---|
133 | *****************************************************************************/
|
---|
134 |
|
---|
135 | CGGLDLL_API void cgGLSetParameter1f(CGparameter param,
|
---|
136 | float x);
|
---|
137 |
|
---|
138 | CGGLDLL_API void cgGLSetParameter2f(CGparameter param,
|
---|
139 | float x,
|
---|
140 | float y);
|
---|
141 |
|
---|
142 | CGGLDLL_API void cgGLSetParameter3f(CGparameter param,
|
---|
143 | float x,
|
---|
144 | float y,
|
---|
145 | float z);
|
---|
146 |
|
---|
147 | CGGLDLL_API void cgGLSetParameter4f(CGparameter param,
|
---|
148 | float x,
|
---|
149 | float y,
|
---|
150 | float z,
|
---|
151 | float w);
|
---|
152 |
|
---|
153 | CGGLDLL_API void cgGLSetParameter1fv(CGparameter param, const float *v);
|
---|
154 |
|
---|
155 | CGGLDLL_API void cgGLSetParameter2fv(CGparameter param, const float *v);
|
---|
156 |
|
---|
157 | CGGLDLL_API void cgGLSetParameter3fv(CGparameter param, const float *v);
|
---|
158 |
|
---|
159 | CGGLDLL_API void cgGLSetParameter4fv(CGparameter param, const float *v);
|
---|
160 |
|
---|
161 | CGGLDLL_API void cgGLSetParameter1d(CGparameter param,
|
---|
162 | double x);
|
---|
163 |
|
---|
164 | CGGLDLL_API void cgGLSetParameter2d(CGparameter param,
|
---|
165 | double x,
|
---|
166 | double y);
|
---|
167 |
|
---|
168 | CGGLDLL_API void cgGLSetParameter3d(CGparameter param,
|
---|
169 | double x,
|
---|
170 | double y,
|
---|
171 | double z);
|
---|
172 |
|
---|
173 | CGGLDLL_API void cgGLSetParameter4d(CGparameter param,
|
---|
174 | double x,
|
---|
175 | double y,
|
---|
176 | double z,
|
---|
177 | double w);
|
---|
178 |
|
---|
179 | CGGLDLL_API void cgGLSetParameter1dv(CGparameter param, const double *v);
|
---|
180 |
|
---|
181 | CGGLDLL_API void cgGLSetParameter2dv(CGparameter param, const double *v);
|
---|
182 |
|
---|
183 | CGGLDLL_API void cgGLSetParameter3dv(CGparameter param, const double *v);
|
---|
184 |
|
---|
185 | CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
|
---|
186 |
|
---|
187 | CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
|
---|
188 |
|
---|
189 | CGGLDLL_API void cgGLGetParameter1f(CGparameter param, float *v);
|
---|
190 |
|
---|
191 | CGGLDLL_API void cgGLGetParameter2f(CGparameter param, float *v);
|
---|
192 |
|
---|
193 | CGGLDLL_API void cgGLGetParameter3f(CGparameter param, float *v);
|
---|
194 |
|
---|
195 | CGGLDLL_API void cgGLGetParameter4f(CGparameter param, float *v);
|
---|
196 |
|
---|
197 | CGGLDLL_API void cgGLGetParameter1d(CGparameter param, double *v);
|
---|
198 |
|
---|
199 | CGGLDLL_API void cgGLGetParameter2d(CGparameter param, double *v);
|
---|
200 |
|
---|
201 | CGGLDLL_API void cgGLGetParameter3d(CGparameter param, double *v);
|
---|
202 |
|
---|
203 | CGGLDLL_API void cgGLGetParameter4d(CGparameter param, double *v);
|
---|
204 |
|
---|
205 | CGGLDLL_API void cgGLSetParameterArray1f(CGparameter param,
|
---|
206 | long offset,
|
---|
207 | long nelements,
|
---|
208 | const float *v);
|
---|
209 |
|
---|
210 | CGGLDLL_API void cgGLSetParameterArray2f(CGparameter param,
|
---|
211 | long offset,
|
---|
212 | long nelements,
|
---|
213 | const float *v);
|
---|
214 |
|
---|
215 | CGGLDLL_API void cgGLSetParameterArray3f(CGparameter param,
|
---|
216 | long offset,
|
---|
217 | long nelements,
|
---|
218 | const float *v);
|
---|
219 |
|
---|
220 | CGGLDLL_API void cgGLSetParameterArray4f(CGparameter param,
|
---|
221 | long offset,
|
---|
222 | long nelements,
|
---|
223 | const float *v);
|
---|
224 |
|
---|
225 | CGGLDLL_API void cgGLSetParameterArray1d(CGparameter param,
|
---|
226 | long offset,
|
---|
227 | long nelements,
|
---|
228 | const double *v);
|
---|
229 |
|
---|
230 | CGGLDLL_API void cgGLSetParameterArray2d(CGparameter param,
|
---|
231 | long offset,
|
---|
232 | long nelements,
|
---|
233 | const double *v);
|
---|
234 |
|
---|
235 | CGGLDLL_API void cgGLSetParameterArray3d(CGparameter param,
|
---|
236 | long offset,
|
---|
237 | long nelements,
|
---|
238 | const double *v);
|
---|
239 |
|
---|
240 | CGGLDLL_API void cgGLSetParameterArray4d(CGparameter param,
|
---|
241 | long offset,
|
---|
242 | long nelements,
|
---|
243 | const double *v);
|
---|
244 |
|
---|
245 | CGGLDLL_API void cgGLGetParameterArray1f(CGparameter param,
|
---|
246 | long offset,
|
---|
247 | long nelements,
|
---|
248 | float *v);
|
---|
249 |
|
---|
250 | CGGLDLL_API void cgGLGetParameterArray2f(CGparameter param,
|
---|
251 | long offset,
|
---|
252 | long nelements,
|
---|
253 | float *v);
|
---|
254 |
|
---|
255 | CGGLDLL_API void cgGLGetParameterArray3f(CGparameter param,
|
---|
256 | long offset,
|
---|
257 | long nelements,
|
---|
258 | float *v);
|
---|
259 |
|
---|
260 | CGGLDLL_API void cgGLGetParameterArray4f(CGparameter param,
|
---|
261 | long offset,
|
---|
262 | long nelements,
|
---|
263 | float *v);
|
---|
264 |
|
---|
265 | CGGLDLL_API void cgGLGetParameterArray1d(CGparameter param,
|
---|
266 | long offset,
|
---|
267 | long nelements,
|
---|
268 | double *v);
|
---|
269 |
|
---|
270 | CGGLDLL_API void cgGLGetParameterArray2d(CGparameter param,
|
---|
271 | long offset,
|
---|
272 | long nelements,
|
---|
273 | double *v);
|
---|
274 |
|
---|
275 | CGGLDLL_API void cgGLGetParameterArray3d(CGparameter param,
|
---|
276 | long offset,
|
---|
277 | long nelements,
|
---|
278 | double *v);
|
---|
279 |
|
---|
280 | CGGLDLL_API void cgGLGetParameterArray4d(CGparameter param,
|
---|
281 | long offset,
|
---|
282 | long nelements,
|
---|
283 | double *v);
|
---|
284 |
|
---|
285 | CGGLDLL_API void cgGLSetParameterPointer(CGparameter param,
|
---|
286 | GLint fsize,
|
---|
287 | GLenum type,
|
---|
288 | GLsizei stride,
|
---|
289 | const GLvoid *pointer);
|
---|
290 |
|
---|
291 | CGGLDLL_API void cgGLEnableClientState(CGparameter param);
|
---|
292 | CGGLDLL_API void cgGLDisableClientState(CGparameter param);
|
---|
293 |
|
---|
294 | /******************************************************************************
|
---|
295 | *** Matrix Parameter Managment Functions
|
---|
296 | *****************************************************************************/
|
---|
297 |
|
---|
298 | CGGLDLL_API void cgGLSetMatrixParameterdr(CGparameter param,
|
---|
299 | const double *matrix);
|
---|
300 | CGGLDLL_API void cgGLSetMatrixParameterfr(CGparameter param,
|
---|
301 | const float *matrix);
|
---|
302 | CGGLDLL_API void cgGLSetMatrixParameterdc(CGparameter param,
|
---|
303 | const double *matrix);
|
---|
304 | CGGLDLL_API void cgGLSetMatrixParameterfc(CGparameter param,
|
---|
305 | const float *matrix);
|
---|
306 |
|
---|
307 | CGGLDLL_API void cgGLGetMatrixParameterdr(CGparameter param, double *matrix);
|
---|
308 | CGGLDLL_API void cgGLGetMatrixParameterfr(CGparameter param, float *matrix);
|
---|
309 | CGGLDLL_API void cgGLGetMatrixParameterdc(CGparameter param, double *matrix);
|
---|
310 | CGGLDLL_API void cgGLGetMatrixParameterfc(CGparameter param, float *matrix);
|
---|
311 |
|
---|
312 | CGGLDLL_API void cgGLSetStateMatrixParameter(CGparameter param,
|
---|
313 | CGGLenum matrix,
|
---|
314 | CGGLenum transform);
|
---|
315 |
|
---|
316 | CGGLDLL_API void cgGLSetMatrixParameterArrayfc(CGparameter param,
|
---|
317 | long offset,
|
---|
318 | long nelements,
|
---|
319 | const float *matrices);
|
---|
320 |
|
---|
321 | CGGLDLL_API void cgGLSetMatrixParameterArrayfr(CGparameter param,
|
---|
322 | long offset,
|
---|
323 | long nelements,
|
---|
324 | const float *matrices);
|
---|
325 |
|
---|
326 | CGGLDLL_API void cgGLSetMatrixParameterArraydc(CGparameter param,
|
---|
327 | long offset,
|
---|
328 | long nelements,
|
---|
329 | const double *matrices);
|
---|
330 |
|
---|
331 | CGGLDLL_API void cgGLSetMatrixParameterArraydr(CGparameter param,
|
---|
332 | long offset,
|
---|
333 | long nelements,
|
---|
334 | const double *matrices);
|
---|
335 |
|
---|
336 | CGGLDLL_API void cgGLGetMatrixParameterArrayfc(CGparameter param,
|
---|
337 | long offset,
|
---|
338 | long nelements,
|
---|
339 | float *matrices);
|
---|
340 |
|
---|
341 | CGGLDLL_API void cgGLGetMatrixParameterArrayfr(CGparameter param,
|
---|
342 | long offset,
|
---|
343 | long nelements,
|
---|
344 | float *matrices);
|
---|
345 |
|
---|
346 | CGGLDLL_API void cgGLGetMatrixParameterArraydc(CGparameter param,
|
---|
347 | long offset,
|
---|
348 | long nelements,
|
---|
349 | double *matrices);
|
---|
350 |
|
---|
351 | CGGLDLL_API void cgGLGetMatrixParameterArraydr(CGparameter param,
|
---|
352 | long offset,
|
---|
353 | long nelements,
|
---|
354 | double *matrices);
|
---|
355 |
|
---|
356 | /******************************************************************************
|
---|
357 | *** Texture Parameter Managment Functions
|
---|
358 | *****************************************************************************/
|
---|
359 |
|
---|
360 | CGGLDLL_API void cgGLSetTextureParameter(CGparameter param, GLuint texobj);
|
---|
361 | CGGLDLL_API GLuint cgGLGetTextureParameter(CGparameter param);
|
---|
362 | CGGLDLL_API void cgGLEnableTextureParameter(CGparameter param);
|
---|
363 | CGGLDLL_API void cgGLDisableTextureParameter(CGparameter param);
|
---|
364 | CGGLDLL_API GLenum cgGLGetTextureEnum(CGparameter param);
|
---|
365 | CGGLDLL_API void cgGLSetManageTextureParameters(CGcontext ctx, CGbool flag);
|
---|
366 | CGGLDLL_API CGbool cgGLGetManageTextureParameters(CGcontext ctx);
|
---|
367 |
|
---|
368 | #endif
|
---|
369 |
|
---|
370 | #ifdef __cplusplus
|
---|
371 | }
|
---|
372 | #endif
|
---|
373 |
|
---|
374 |
|
---|
375 | #endif
|
---|