source: GTP/branches/IllumWPdeliver2008dec/IlluminationWP/demos/Standalone/Hierarchical Systems Demo [OpenGL]/RESOURCES/include/Cg/cgGL.h @ 3255

Revision 3255, 15.6 KB checked in by szirmay, 15 years ago (diff)
Line 
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 NVIDIA’s 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
82extern "C" {
83#endif
84
85/*****************************************************************************/
86/*** cgGL Type Definitions                                                 ***/
87/*****************************************************************************/
88
89typedef 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
113CGGLDLL_API CGbool cgGLIsProfileSupported(CGprofile profile);
114
115CGGLDLL_API void cgGLEnableProfile(CGprofile profile);
116CGGLDLL_API void cgGLDisableProfile(CGprofile profile);
117
118CGGLDLL_API CGprofile cgGLGetLatestProfile(CGGLenum profile_type);
119CGGLDLL_API void cgGLSetOptimalOptions(CGprofile profile);
120
121/******************************************************************************
122 *** Program Managment Functions                                 
123 *****************************************************************************/
124
125CGGLDLL_API void cgGLLoadProgram(CGprogram program);
126CGGLDLL_API CGbool cgGLIsProgramLoaded(CGprogram program);
127CGGLDLL_API void cgGLBindProgram(CGprogram program);
128CGGLDLL_API void cgGLUnbindProgram(CGprofile profile);
129CGGLDLL_API GLuint cgGLGetProgramID(CGprogram program);
130
131/******************************************************************************
132 *** Parameter Managment Functions                                 
133 *****************************************************************************/
134
135CGGLDLL_API void cgGLSetParameter1f(CGparameter param,
136                                    float x);
137
138CGGLDLL_API void cgGLSetParameter2f(CGparameter param,
139                                    float x,
140                                    float y);
141
142CGGLDLL_API void cgGLSetParameter3f(CGparameter param,
143                                    float x,
144                                    float y,
145                                    float z);
146
147CGGLDLL_API void cgGLSetParameter4f(CGparameter param,
148                                    float x,
149                                    float y,
150                                    float z,
151                                    float w);
152
153CGGLDLL_API void cgGLSetParameter1fv(CGparameter param, const float *v);
154
155CGGLDLL_API void cgGLSetParameter2fv(CGparameter param, const float *v);
156
157CGGLDLL_API void cgGLSetParameter3fv(CGparameter param, const float *v);
158
159CGGLDLL_API void cgGLSetParameter4fv(CGparameter param, const float *v);
160
161CGGLDLL_API void cgGLSetParameter1d(CGparameter param,
162                                    double x);
163
164CGGLDLL_API void cgGLSetParameter2d(CGparameter param,
165                                    double x,
166                                    double y);
167
168CGGLDLL_API void cgGLSetParameter3d(CGparameter param,
169                                    double x,
170                                    double y,
171                                    double z);
172
173CGGLDLL_API void cgGLSetParameter4d(CGparameter param,
174                                    double x,
175                                    double y,
176                                    double z,
177                                    double w);
178
179CGGLDLL_API void cgGLSetParameter1dv(CGparameter param, const double *v);
180
181CGGLDLL_API void cgGLSetParameter2dv(CGparameter param, const double *v);
182
183CGGLDLL_API void cgGLSetParameter3dv(CGparameter param, const double *v);
184
185CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
186
187CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
188
189CGGLDLL_API void cgGLGetParameter1f(CGparameter param, float *v);
190
191CGGLDLL_API void cgGLGetParameter2f(CGparameter param, float *v);
192
193CGGLDLL_API void cgGLGetParameter3f(CGparameter param, float *v);
194
195CGGLDLL_API void cgGLGetParameter4f(CGparameter param, float *v);
196
197CGGLDLL_API void cgGLGetParameter1d(CGparameter param, double *v);
198
199CGGLDLL_API void cgGLGetParameter2d(CGparameter param, double *v);
200
201CGGLDLL_API void cgGLGetParameter3d(CGparameter param, double *v);
202
203CGGLDLL_API void cgGLGetParameter4d(CGparameter param, double *v);
204
205CGGLDLL_API void cgGLSetParameterArray1f(CGparameter param,
206                                         long offset,
207                                         long nelements,
208                                         const float *v);
209
210CGGLDLL_API void cgGLSetParameterArray2f(CGparameter param,
211                                         long offset,
212                                         long nelements,
213                                         const float *v);
214
215CGGLDLL_API void cgGLSetParameterArray3f(CGparameter param,
216                                         long offset,
217                                         long nelements,
218                                         const float *v);
219
220CGGLDLL_API void cgGLSetParameterArray4f(CGparameter param,
221                                         long offset,
222                                         long nelements,
223                                         const float *v);
224
225CGGLDLL_API void cgGLSetParameterArray1d(CGparameter param,
226                                         long offset,
227                                         long nelements,
228                                         const double *v);
229
230CGGLDLL_API void cgGLSetParameterArray2d(CGparameter param,
231                                         long offset,
232                                         long nelements,
233                                         const double *v);
234
235CGGLDLL_API void cgGLSetParameterArray3d(CGparameter param,
236                                         long offset,
237                                         long nelements,
238                                         const double *v);
239
240CGGLDLL_API void cgGLSetParameterArray4d(CGparameter param,
241                                         long offset,
242                                         long nelements,
243                                         const double *v);
244
245CGGLDLL_API void cgGLGetParameterArray1f(CGparameter param,
246                                         long offset,
247                                         long nelements,
248                                         float *v);
249
250CGGLDLL_API void cgGLGetParameterArray2f(CGparameter param,
251                                         long offset,
252                                         long nelements,
253                                         float *v);
254
255CGGLDLL_API void cgGLGetParameterArray3f(CGparameter param,
256                                         long offset,
257                                         long nelements,
258                                         float *v);
259
260CGGLDLL_API void cgGLGetParameterArray4f(CGparameter param,
261                                         long offset,
262                                         long nelements,
263                                         float *v);
264
265CGGLDLL_API void cgGLGetParameterArray1d(CGparameter param,
266                                         long offset,
267                                         long nelements,
268                                         double *v);
269
270CGGLDLL_API void cgGLGetParameterArray2d(CGparameter param,
271                                         long offset,
272                                         long nelements,
273                                         double *v);
274
275CGGLDLL_API void cgGLGetParameterArray3d(CGparameter param,
276                                         long offset,
277                                         long nelements,
278                                         double *v);
279
280CGGLDLL_API void cgGLGetParameterArray4d(CGparameter param,
281                                         long offset,
282                                         long nelements,
283                                         double *v);
284
285CGGLDLL_API void cgGLSetParameterPointer(CGparameter param,
286                                         GLint fsize,
287                                         GLenum type,
288                                         GLsizei stride,
289                                         const GLvoid *pointer);
290
291CGGLDLL_API void cgGLEnableClientState(CGparameter param);
292CGGLDLL_API void cgGLDisableClientState(CGparameter param);
293
294/******************************************************************************
295 *** Matrix Parameter Managment Functions                                 
296 *****************************************************************************/
297
298CGGLDLL_API void cgGLSetMatrixParameterdr(CGparameter param,
299                                          const double *matrix);
300CGGLDLL_API void cgGLSetMatrixParameterfr(CGparameter param,
301                                          const float *matrix);
302CGGLDLL_API void cgGLSetMatrixParameterdc(CGparameter param,
303                                          const double *matrix);
304CGGLDLL_API void cgGLSetMatrixParameterfc(CGparameter param,
305                                          const float *matrix);
306
307CGGLDLL_API void cgGLGetMatrixParameterdr(CGparameter param, double *matrix);
308CGGLDLL_API void cgGLGetMatrixParameterfr(CGparameter param, float *matrix);
309CGGLDLL_API void cgGLGetMatrixParameterdc(CGparameter param, double *matrix);
310CGGLDLL_API void cgGLGetMatrixParameterfc(CGparameter param, float *matrix);
311
312CGGLDLL_API void cgGLSetStateMatrixParameter(CGparameter param,
313                                             CGGLenum matrix,
314                                             CGGLenum transform);
315
316CGGLDLL_API void cgGLSetMatrixParameterArrayfc(CGparameter param,
317                                               long offset,
318                                               long nelements,
319                                               const float *matrices);
320
321CGGLDLL_API void cgGLSetMatrixParameterArrayfr(CGparameter param,
322                                               long offset,
323                                               long nelements,
324                                               const float *matrices);
325
326CGGLDLL_API void cgGLSetMatrixParameterArraydc(CGparameter param,
327                                               long offset,
328                                               long nelements,
329                                               const double *matrices);
330
331CGGLDLL_API void cgGLSetMatrixParameterArraydr(CGparameter param,
332                                               long offset,
333                                               long nelements,
334                                               const double *matrices);
335
336CGGLDLL_API void cgGLGetMatrixParameterArrayfc(CGparameter param,
337                                               long offset,
338                                               long nelements,
339                                               float *matrices);
340
341CGGLDLL_API void cgGLGetMatrixParameterArrayfr(CGparameter param,
342                                               long offset,
343                                               long nelements,
344                                               float *matrices);
345
346CGGLDLL_API void cgGLGetMatrixParameterArraydc(CGparameter param,
347                                               long offset,
348                                               long nelements,
349                                               double *matrices);
350
351CGGLDLL_API void cgGLGetMatrixParameterArraydr(CGparameter param,
352                                               long offset,
353                                               long nelements,
354                                               double *matrices);
355
356/******************************************************************************
357 *** Texture Parameter Managment Functions
358 *****************************************************************************/
359
360CGGLDLL_API void cgGLSetTextureParameter(CGparameter param, GLuint texobj);
361CGGLDLL_API GLuint cgGLGetTextureParameter(CGparameter param);
362CGGLDLL_API void cgGLEnableTextureParameter(CGparameter param);
363CGGLDLL_API void cgGLDisableTextureParameter(CGparameter param);
364CGGLDLL_API GLenum cgGLGetTextureEnum(CGparameter param);
365CGGLDLL_API void cgGLSetManageTextureParameters(CGcontext ctx, CGbool flag);
366CGGLDLL_API CGbool cgGLGetManageTextureParameters(CGcontext ctx);
367
368#endif
369
370#ifdef __cplusplus
371}
372#endif
373
374
375#endif
Note: See TracBrowser for help on using the repository browser.