root/OpenSceneGraph/trunk/include/osg/GLU @ 13041

Revision 13041, 8.6 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_GLU
15#define OSG_GLU 1
16
17#include <osg/GL>
18
19namespace osg
20{
21
22/* Pixel storage modes, used by gluScaleImage */
23struct OSG_EXPORT PixelStorageModes
24{
25    // sets defaults as per glGet docs in OpenGL red book
26    PixelStorageModes();
27
28    // use glGet's to retrieve all the current settings
29    void retrieveStoreModes();
30
31    // use glGet's to retrieve all the current 3D settings
32    void retrieveStoreModes3D();
33
34    GLint pack_alignment;
35    GLint pack_row_length;
36    GLint pack_skip_rows;
37    GLint pack_skip_pixels;
38    GLint pack_lsb_first;
39    GLint pack_swap_bytes;
40    GLint pack_skip_images;
41    GLint pack_image_height;
42
43    GLint unpack_alignment;
44    GLint unpack_row_length;
45    GLint unpack_skip_rows;
46    GLint unpack_skip_pixels;
47    GLint unpack_lsb_first;
48    GLint unpack_swap_bytes;
49    GLint unpack_skip_images;
50    GLint unpack_image_height;
51} ;
52
53extern OSG_EXPORT const GLubyte * gluErrorString (GLenum error);
54
55/** OSG specific gluScaleImage function that allows you to pass in the PixelStoreModes, which
56  * enables the code to avoid glGet's that are associated with the conventional gluScaleImage function.
57  * Avoiding glGet's allows this gluScaleImage function to be called at any time, from any thread, there
58  * is no need to have a graphics context current.*/
59extern OSG_EXPORT GLint gluScaleImage (PixelStorageModes* psm, GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
60
61/** Traditional GLU gluScaleImage function that sets up the PixelStoreModes automatically by doing glGets.;
62  * The use of glGet's means that you can only call this function from a thread with a valid graphics context.
63  * The use of glGet's will also result in lower performance due to the round trip to the OpenGL driver.*/
64extern OSG_EXPORT GLint gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
65
66extern OSG_EXPORT GLint gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
67extern OSG_EXPORT GLint gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
68extern OSG_EXPORT GLint gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
69extern OSG_EXPORT GLint gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
70
71typedef void (GL_APIENTRY * GLTexImage3DProc)      ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
72
73/** Small variation on normal gluBuild3DMipmapLevels as we pass in the function pointer to glTexImage3D rather than rely on GLU style querry for this functon pointer.*/
74extern OSG_EXPORT GLint gluBuild3DMipmapLevels (GLTexImage3DProc glTextImage3DProc, GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
75
76/** Small variation on normal gluBuild3DMipmapLevels as we pass in the function pointer to glTexImage3D rather than rely on GLU style querry for this functon pointer.*/
77extern OSG_EXPORT GLint gluBuild3DMipmaps (GLTexImage3DProc glTextImage3DProc, GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
78
79/* ErrorCode */
80#define GLU_INVALID_ENUM                   100900
81#define GLU_INVALID_VALUE                  100901
82#define GLU_OUT_OF_MEMORY                  100902
83#define GLU_INCOMPATIBLE_GL_VERSION        100903
84#define GLU_INVALID_OPERATION              100904
85
86/* Boolean */
87#define GLU_FALSE                          0
88#define GLU_TRUE                           1
89
90/* QuadricDrawStyle */
91#define GLU_POINT                          100010
92#define GLU_LINE                           100011
93#define GLU_FILL                           100012
94#define GLU_SILHOUETTE                     100013
95
96/* QuadricCallback */
97/*      GLU_ERROR */
98
99/* QuadricNormal */
100#define GLU_SMOOTH                         100000
101#define GLU_FLAT                           100001
102#define GLU_NONE                           100002
103
104/* QuadricOrientation */
105#define GLU_OUTSIDE                        100020
106#define GLU_INSIDE                         100021
107
108/* TessCallback */
109#define GLU_TESS_BEGIN                     100100
110#define GLU_BEGIN                          100100
111#define GLU_TESS_VERTEX                    100101
112#define GLU_VERTEX                         100101
113#define GLU_TESS_END                       100102
114#define GLU_END                            100102
115#define GLU_TESS_ERROR                     100103
116#define GLU_TESS_EDGE_FLAG                 100104
117#define GLU_EDGE_FLAG                      100104
118#define GLU_TESS_COMBINE                   100105
119#define GLU_TESS_BEGIN_DATA                100106
120#define GLU_TESS_VERTEX_DATA               100107
121#define GLU_TESS_END_DATA                  100108
122#define GLU_TESS_ERROR_DATA                100109
123#define GLU_TESS_EDGE_FLAG_DATA            100110
124#define GLU_TESS_COMBINE_DATA              100111
125
126/* TessContour */
127#define GLU_CW                             100120
128#define GLU_CCW                            100121
129#define GLU_INTERIOR                       100122
130#define GLU_EXTERIOR                       100123
131#define GLU_UNKNOWN                        100124
132
133/* TessProperty */
134#define GLU_TESS_WINDING_RULE              100140
135#define GLU_TESS_BOUNDARY_ONLY             100141
136#define GLU_TESS_TOLERANCE                 100142
137
138/* TessError */
139#define GLU_TESS_ERROR1                    100151
140#define GLU_TESS_ERROR2                    100152
141#define GLU_TESS_ERROR3                    100153
142#define GLU_TESS_ERROR4                    100154
143#define GLU_TESS_ERROR5                    100155
144#define GLU_TESS_ERROR6                    100156
145#define GLU_TESS_ERROR7                    100157
146#define GLU_TESS_ERROR8                    100158
147#define GLU_TESS_MISSING_BEGIN_POLYGON     100151
148#define GLU_TESS_MISSING_BEGIN_CONTOUR     100152
149#define GLU_TESS_MISSING_END_POLYGON       100153
150#define GLU_TESS_MISSING_END_CONTOUR       100154
151#define GLU_TESS_COORD_TOO_LARGE           100155
152#define GLU_TESS_NEED_COMBINE_CALLBACK     100156
153
154/* TessWinding */
155#define GLU_TESS_WINDING_ODD               100130
156#define GLU_TESS_WINDING_NONZERO           100131
157#define GLU_TESS_WINDING_POSITIVE          100132
158#define GLU_TESS_WINDING_NEGATIVE          100133
159#define GLU_TESS_WINDING_ABS_GEQ_TWO       100134
160
161struct GLUtesselator;
162typedef GLUtesselator GLUtesselatorObj;
163typedef GLUtesselator GLUtriangulatorObj;
164
165#define GLU_TESS_MAX_COORD 1.0e150
166
167/* Internal convenience typedefs */
168typedef void (GL_APIENTRY * _GLUfuncptr)();
169typedef void (GL_APIENTRY * GLU_TESS_CALLBACK)();
170
171extern OSG_EXPORT GLUtesselator* GL_APIENTRY gluNewTess (void);
172extern OSG_EXPORT void GL_APIENTRY gluDeleteTess (GLUtesselator* tess);
173
174extern OSG_EXPORT void GL_APIENTRY gluTessBeginContour (GLUtesselator* tess);
175extern OSG_EXPORT void GL_APIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
176extern OSG_EXPORT void GL_APIENTRY gluTessEndContour (GLUtesselator* tess);
177extern OSG_EXPORT void GL_APIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
178extern OSG_EXPORT void GL_APIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
179extern OSG_EXPORT void GL_APIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
180extern OSG_EXPORT void GL_APIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
181extern OSG_EXPORT void GL_APIENTRY gluTessEndPolygon (GLUtesselator* tess);
182extern OSG_EXPORT void GL_APIENTRY gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value );
183
184}
185
186#endif  // __osgGLU_h
Note: See TracBrowser for help on using the browser.