fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Base / OSGGeoPumpCommon.inl
blobec3f647c32c9932b041b2aae4659e72d0d45120a
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
15  *                                                                           *
16  *                                                                           *
17  * This library is free software; you can redistribute it and/or modify it   *
18  * under the terms of the GNU Library General Public License as published    *
19  * by the Free Software Foundation, version 2.                               *
20  *                                                                           *
21  * This library is distributed in the hope that it will be useful, but       *
22  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
24  * Library General Public License for more details.                          *
25  *                                                                           *
26  * You should have received a copy of the GNU Library General Public         *
27  * License along with this library; if not, write to the Free Software       *
28  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
29  *                                                                           *
30  *                                                                           *
31 \*---------------------------------------------------------------------------*/
32 /*---------------------------------------------------------------------------*\
33  *                                Changes                                    *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37  *                                                                           *
38  *                                                                           *
39  *                                                                           *
40 \*---------------------------------------------------------------------------*/
42 //---------------------------------------------------------------------------
43 //  Includes
44 //---------------------------------------------------------------------------
46 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
48 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
49 #pragma GCC diagnostic push
50 #pragma GCC diagnostic ignored "-Wunused-function"
51 #endif
53 namespace
55     // Pumping function definitions
57     typedef void (OSG_APIENTRY *pumpFunc      )(const UInt8  *data);
58     typedef void (OSG_APIENTRY *multiPumpFunc )(      GLenum  which, 
59                                                 const UInt8  *data);
60     typedef void (OSG_APIENTRY *attribPumpFunc)(      GLuint  index, 
61                                                 const UInt8  *data);
64     // Some helper arrays for function selection
65     // indexed by data type and dimension
67     const Int16 formatBase = GL_BYTE;
68 #ifndef OSG_OGL_NO_DOUBLE
69     const Int16 numFormats = GL_DOUBLE  - GL_BYTE + 1;
70 #else
71     const Int16 numFormats = GL_4_BYTES - GL_BYTE + 1;
72 #endif
74     const char *formatNames[] =
75     {   "GL_BYTE",
76         "GL_UNSIGNED_BYTE",
77         "GL_SHORT",
78         "GL_UNSIGNED_SHORT",
79         "GL_INT",
80         "GL_UNSIGNED_INT",
81         "GL_FLOAT",
82         "GL_2_BYTES",
83         "GL_3_BYTES",
84         "GL_4_BYTES",
85 #ifndef OSG_OGL_NO_DOUBLE
86         "GL_DOUBLE",
87         "GL_DOUBLE_EXT",  // Not used
88 #endif
89         "GL_FIXED"        // Not used
90     };
92     // little helper class for function init
94     class glextFuncInit
95     {
96       public:
98         glextFuncInit(const char   *name, 
99                             UInt32  format, 
100                             UInt32  dim,
101                             bool    normalizing = false) :
102             
103             _name       (name       ),
104             _format     (format     ),
105             _dim        (dim        ),
106             _normalizing(normalizing)
107         {
108         };
110         void init(UInt32 (&extids)[numFormats][4], UInt32 extension)
111         {
112             extids[_format - formatBase][_dim - 1] =
113                 Window::registerFunction(_name, extension);
114         }
116       private:
118         const char   *_name;
119               UInt32  _format;
120               UInt32  _dim;
121               bool    _normalizing;
122     };
125 #if !defined(OSG_OGL_COREONLY) || defined(OSG_CHECK_COREONLY)
127     const UInt32 uiNumSecColFunc = 8;
129     glextFuncInit secondaryColorInitFuncs[uiNumSecColFunc] = {
130         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3bvEXT",
131                       GL_BYTE,
132                       3),
133         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3ubvEXT",
134                       GL_UNSIGNED_BYTE,
135                       3),
136         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3svEXT",
137                       GL_SHORT,
138                       3),
139         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3usvEXT",
140                       GL_UNSIGNED_SHORT,
141                       3),
142         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3ivEXT",
143                       GL_INT,
144                       3),
145         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3uivEXT",
146                       GL_UNSIGNED_INT,
147                       3),
148         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3fvEXT",
149                       GL_FLOAT,
150                       3),
151         glextFuncInit(OSG_DLSYM_UNDERSCORE"glSecondaryColor3dvEXT",
152                       GL_DOUBLE,
153                       3)
154     };
156     const UInt32 uiNumMTexFuncs = 16;
158     glextFuncInit multiTexCoordsInitFuncs[uiNumMTexFuncs] = {
159         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord1svARB",
160                       GL_SHORT,
161                       1),
162         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord2svARB",
163                       GL_SHORT,
164                       2),
165         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord3svARB",
166                       GL_SHORT,
167                       3),
168         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord4svARB",
169                       GL_SHORT,
170                       4),
171         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord1ivARB",
172                       GL_INT,
173                       1),
174         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord2ivARB",
175                       GL_INT,
176                       2),
177         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord3ivARB",
178                       GL_INT,
179                       3),
180         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord4ivARB",
181                       GL_INT,
182                       4),
183         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord1fvARB",
184                       GL_FLOAT,
185                       1),
186         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord2fvARB",
187                       GL_FLOAT,
188                       2),
189         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord3fvARB",
190                       GL_FLOAT,
191                       3),
192         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord4fvARB",
193                       GL_FLOAT,
194                       4),
195         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord1dvARB",
196                       GL_DOUBLE,
197                       1),
198         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord2dvARB",
199                       GL_DOUBLE,
200                       2),
201         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord3dvARB",
202                       GL_DOUBLE,
203                       3),
204         glextFuncInit(OSG_DLSYM_UNDERSCORE"glMultiTexCoord4dvARB",
205                       GL_DOUBLE,
206                       4)
207     };
209 #endif
212 #ifndef OSG_OGL_NO_DOUBLE
213     const UInt32 uiNumAttribFuncs = 23;
214 #else
215     const UInt32 uiNumAttribFuncs = 19;
216 #endif
218     glextFuncInit attribInitFuncs[uiNumAttribFuncs] = {
219         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib1svARB",
220                       GL_SHORT,
221                       1),
222         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib1fvARB",
223                       GL_FLOAT,
224                       1),
225 #ifndef OSG_OGL_NO_DOUBLE
226         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib1dvARB",
227                       GL_DOUBLE,
228                       1),
229 #endif
230         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib2svARB",
231                       GL_SHORT,
232                       2),
233         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib2fvARB",
234                       GL_FLOAT,
235                       2),
236 #ifndef OSG_OGL_NO_DOUBLE
237         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib2dvARB",
238                       GL_DOUBLE,
239                       2),
240 #endif
241         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib3svARB",
242                       GL_SHORT,
243                       3),
244         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib3fvARB",
245                       GL_FLOAT,
246                       3),
247 #ifndef OSG_OGL_NO_DOUBLE
248         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib3dvARB",
249                       GL_DOUBLE,
250                       3),
251 #endif
252         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4bvARB",
253                       GL_BYTE,
254                       4),
255         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4svARB",
256                       GL_SHORT,
257                       4),
258         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4ivARB",
259                       GL_INT,
260                       4),
261         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4ubvARB",
262                       GL_UNSIGNED_BYTE,
263                       4),
264         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4usvARB",
265                       GL_UNSIGNED_SHORT,
266                       4),
267         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4uivARB",
268                       GL_UNSIGNED_INT,
269                       4),
270         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4bvARB",
271                       GL_BYTE,
272                       4),
273         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4svARB",
274                       GL_SHORT,
275                       4),
276         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4ivARB",
277                       GL_INT,
278                       4),
279         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4ubvARB",
280                       GL_UNSIGNED_BYTE,
281                       4),
282         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4usvARB",
283                       GL_UNSIGNED_SHORT,
284                       4),
285         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4uivARB",
286                       GL_UNSIGNED_INT,
287                       4),
288         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4fvARB",
289                       GL_FLOAT,
290                       4),
291 #ifndef OSG_OGL_NO_DOUBLE
292         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4dvARB",
293                       GL_DOUBLE,
294                       4),
295 #endif
296     };
298     const UInt32 uiNumNormAttribFuncs = 6;
300     glextFuncInit normAttribInitFuncs[uiNumNormAttribFuncs] = {
301         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NbvARB",
302                       GL_BYTE,
303                       4, true),
304         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NsvARB",
305                       GL_SHORT,
306                       4, true),
307         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NivARB",
308                       GL_INT,
309                       4, true),
310         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NubvARB",
311                       GL_UNSIGNED_BYTE,
312                       4, true),
313         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NusvARB",
314                       GL_UNSIGNED_SHORT,
315                       4, true),
316         glextFuncInit(OSG_DLSYM_UNDERSCORE"glVertexAttrib4NuivARB",
317                       GL_UNSIGNED_INT,
318                       4, true),
319     };
323     // Classic pumping functions
325     const UInt16 PositionsPumpSlot = 0;
326     const UInt16 NormalsPumpSlot   = 1;
327     const UInt16 ColorsPumpSlot    = 2;
328     const UInt16 TexCoordsPumpSlot = 3;
331 #if !defined(OSG_OGL_COREONLY) || defined(OSG_CHECK_COREONLY)
332     pumpFunc pumpFuncs[4][numFormats][4] = {
333         { // Positions
334             { NULL, NULL, NULL, NULL },                     // GL_BYTE
335             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_BYTE
336             { NULL,
337               reinterpret_cast<pumpFunc>(glVertex2sv),
338               reinterpret_cast<pumpFunc>(glVertex3sv),
339               reinterpret_cast<pumpFunc>(glVertex4sv) },    // GL_SHORT
340             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_SHORT
341             { NULL,
342               reinterpret_cast<pumpFunc>(glVertex2iv),
343               reinterpret_cast<pumpFunc>(glVertex3iv),
344               reinterpret_cast<pumpFunc>(glVertex4iv) },    // GL_INT
345             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_INT
346             { NULL,
347               reinterpret_cast<pumpFunc>(glVertex2fv),
348               reinterpret_cast<pumpFunc>(glVertex3fv),
349               reinterpret_cast<pumpFunc>(glVertex4fv) },    // GL_FLOAT
350             { NULL, NULL, NULL, NULL },                     // GL_2_BYTES
351             { NULL, NULL, NULL, NULL },                     // GL_3_BYTES
352             { NULL, NULL, NULL, NULL },                     // GL_4_BYTES
353             { NULL,
354               reinterpret_cast<pumpFunc>(glVertex2dv),
355               reinterpret_cast<pumpFunc>(glVertex3dv),
356               reinterpret_cast<pumpFunc>(glVertex4dv) },    // GL_DOUBLE
357         },
358         { // Normals
359             { NULL,
360               NULL,
361               reinterpret_cast<pumpFunc>(glNormal3sv),
362               NULL },                                       // GL_BYTE
363             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_BYTE
364             { NULL,
365               NULL,
366               reinterpret_cast<pumpFunc>(glNormal3sv),
367               NULL },                                       // GL_SHORT
368             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_SHORT
369             { NULL, NULL,
370               reinterpret_cast<pumpFunc>(glNormal3iv),
371               NULL },                                       // GL_INT
372             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_INT
373             { NULL,
374               NULL,
375               reinterpret_cast<pumpFunc>(glNormal3fv),
376               NULL },                                       // GL_FLOAT
377             { NULL, NULL, NULL, NULL },                     // GL_2_BYTES
378             { NULL, NULL, NULL, NULL },                     // GL_3_BYTES
379             { NULL, NULL, NULL, NULL },                     // GL_4_BYTES
380             { NULL,
381               NULL,
382               reinterpret_cast<pumpFunc>(glNormal3dv),
383               NULL }
384         },
385         { // Colors
386             { NULL,
387               NULL,
388               reinterpret_cast<pumpFunc>(glColor3bv),
389               reinterpret_cast<pumpFunc>(glColor4bv) },     // GL_BYTE
390             { NULL,
391               NULL,
392               reinterpret_cast<pumpFunc>(glColor3ubv),
393               reinterpret_cast<pumpFunc>(glColor4ubv) },    // GL_UNSIGNED_BYTE
394             { NULL,
395               NULL,
396               reinterpret_cast<pumpFunc>(glColor3sv),
397               reinterpret_cast<pumpFunc>(glColor4sv) },     // GL_SHORT
398             { NULL,
399               NULL,
400               reinterpret_cast<pumpFunc>(glColor3usv),
401               reinterpret_cast<pumpFunc>(glColor4usv) },    // GL_UNSIGNED_SHORT
402             { NULL,
403               NULL,
404               reinterpret_cast<pumpFunc>(glColor3iv),
405               reinterpret_cast<pumpFunc>(glColor4iv) },     // GL_INT
406             { NULL,
407               NULL,
408               reinterpret_cast<pumpFunc>(glColor3uiv),
409               reinterpret_cast<pumpFunc>(glColor4uiv) },    // GL_UNSIGNED_INT
410             { NULL,
411               NULL,
412               reinterpret_cast<pumpFunc>(glColor3fv),
413               reinterpret_cast<pumpFunc>(glColor4fv) },     // GL_FLOAT
414             { NULL, NULL, NULL, NULL },                     // GL_2_BYTES
415             { NULL, NULL, NULL, NULL },                     // GL_3_BYTES
416             { NULL, NULL, NULL, NULL },                     // GL_4_BYTES
417             { NULL,
418               NULL,
419               reinterpret_cast<pumpFunc>(glColor3dv),
420               reinterpret_cast<pumpFunc>(glColor4dv) },     // GL_DOUBLE
421         },
422         { // TexCoords
423             { NULL, NULL, NULL, NULL },                     // GL_BYTE
424             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_BYTE
425             { reinterpret_cast<pumpFunc>(glTexCoord1sv),
426               reinterpret_cast<pumpFunc>(glTexCoord2sv),
427               reinterpret_cast<pumpFunc>(glTexCoord3sv),
428               reinterpret_cast<pumpFunc>(glTexCoord4sv) },  // GL_SHORT
429             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_SHORT
430             { reinterpret_cast<pumpFunc>(glTexCoord1iv),
431               reinterpret_cast<pumpFunc>(glTexCoord2iv),
432               reinterpret_cast<pumpFunc>(glTexCoord3iv),
433               reinterpret_cast<pumpFunc>(glTexCoord4iv) },  // GL_INT
434             { NULL, NULL, NULL, NULL },                     // GL_UNSIGNED_INT
435             { reinterpret_cast<pumpFunc>(glTexCoord1fv),
436               reinterpret_cast<pumpFunc>(glTexCoord2fv),
437               reinterpret_cast<pumpFunc>(glTexCoord3fv),
438               reinterpret_cast<pumpFunc>(glTexCoord4fv) },  // GL_FLOAT
439             { NULL, NULL, NULL, NULL },                     // GL_2_BYTES
440             { NULL, NULL, NULL, NULL },                     // GL_3_BYTES
441             { NULL, NULL, NULL, NULL },                     // GL_4_BYTES
442             { reinterpret_cast<pumpFunc>(glTexCoord1dv),
443               reinterpret_cast<pumpFunc>(glTexCoord2dv),
444               reinterpret_cast<pumpFunc>(glTexCoord3dv),
445               reinterpret_cast<pumpFunc>(glTexCoord4dv) },  // GL_DOUBLE
446         }
447     };
448 #endif
451 #if defined(OSG_USE_OGLES_PROTOS) || defined(OSG_USE_OGL3_PROTOS) || \
452     defined(OSG_USE_OGL4_PROTOS)
454     attribPumpFunc attribPumpFuncs[numFormats][4] = {
455 #if !defined(OSG_USE_OGLES_PROTOS)
456         { NULL, NULL, NULL,                                       // GL_BYTE
457           reinterpret_cast<attribPumpFunc>(glVertexAttrib4bv) },
458         { NULL, NULL, NULL,                                       // GL_UBYTE
459           reinterpret_cast<attribPumpFunc>(glVertexAttrib4ubv) },
460         { reinterpret_cast<attribPumpFunc>(glVertexAttrib1sv),
461           reinterpret_cast<attribPumpFunc>(glVertexAttrib2sv),
462           reinterpret_cast<attribPumpFunc>(glVertexAttrib3sv),
463           reinterpret_cast<attribPumpFunc>(glVertexAttrib4sv) },  // GL_SHORT
464         { NULL, NULL, NULL,                                       // GL_USHORT
465           reinterpret_cast<attribPumpFunc>(glVertexAttrib4usv) }, 
466         { NULL, NULL, NULL,                                       // GL_INT
467           reinterpret_cast<attribPumpFunc>(glVertexAttrib4iv) }, 
468         { NULL, NULL, NULL,                                       // GL_UINT
469           reinterpret_cast<attribPumpFunc>(glVertexAttrib4uiv) },
470 #else
471         { NULL, NULL, NULL, NULL },                     // GL_BYTE   ES
472         { NULL, NULL, NULL, NULL },                     // GL_UBYTE  ES
473         { NULL, NULL, NULL, NULL },                     // GL_SHORT  ES
474         { NULL, NULL, NULL, NULL },                     // GL_USHORT ES
475         { NULL, NULL, NULL, NULL },                     // GL_INT    ES
476         { NULL, NULL, NULL, NULL },                     // GL_UINT   ES
477 #endif
478         { reinterpret_cast<attribPumpFunc>(glVertexAttrib1fv),
479           reinterpret_cast<attribPumpFunc>(glVertexAttrib2fv),
480           reinterpret_cast<attribPumpFunc>(glVertexAttrib3fv),
481           reinterpret_cast<attribPumpFunc>(glVertexAttrib4fv)  }, // GL_FLOAT
482         { NULL, NULL, NULL, NULL },                               // GL_2_BYTES
483         { NULL, NULL, NULL, NULL },                               // GL_3_BYTES
484         { NULL, NULL, NULL, NULL },                               // GL_4_BYTES
485 #if !defined(OSG_OGL_NO_DOUBLE)
486         { reinterpret_cast<attribPumpFunc>(glVertexAttrib1dv),
487           reinterpret_cast<attribPumpFunc>(glVertexAttrib2dv),
488           reinterpret_cast<attribPumpFunc>(glVertexAttrib3dv),
489           reinterpret_cast<attribPumpFunc>(glVertexAttrib4dv)  }  // GL_DOUBLE
490 #endif
491     };
494     attribPumpFunc attribNormPumpFuncs[numFormats][4] = {
495 #if !defined(OSG_USE_OGLES_PROTOS)
496         { NULL, NULL, NULL,                                        // GL_BYTE
497           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Nbv)  },
498         { NULL, NULL, NULL,                                        // GL_UBYTE
499           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Nubv) },
500         { NULL, NULL, NULL,
501           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Nsv)  }, // GL_SHORT
502         { NULL, NULL, NULL,                                        // GL_USHORT
503           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Nusv) }, 
504         { NULL, NULL, NULL,                                        // GL_INT
505           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Niv)  }, 
506         { NULL, NULL, NULL,                                        // GL_UINT
507           reinterpret_cast<attribPumpFunc>(glVertexAttrib4Nuiv) },
508         { NULL, NULL, NULL, NULL },                               // GL_FLOAT
509         { NULL, NULL, NULL, NULL },                               // GL_2_BYTES
510         { NULL, NULL, NULL, NULL },                               // GL_3_BYTES
511         { NULL, NULL, NULL, NULL },                               // GL_4_BYTES
512 #if !defined(OSG_OGL_NO_DOUBLE)
513         { NULL, NULL, NULL, NULL }                                // GL_DOUBLE
514 #endif
516 #else // !OSG_USE_OGLES_PROTOS
517         { NULL, NULL, NULL, NULL },                     // GL_BYTE    ES
518         { NULL, NULL, NULL, NULL },                     // GL_UBYTE   ES
519         { NULL, NULL, NULL, NULL },                     // GL_SHORT   ES
520         { NULL, NULL, NULL, NULL },                     // GL_USHORT  ES
521         { NULL, NULL, NULL, NULL },                     // GL_INT     ES
522         { NULL, NULL, NULL, NULL },                     // GL_UINT    ES
523         { NULL, NULL, NULL, NULL },                     // GL_FLOAT   ES
524         { NULL, NULL, NULL, NULL },                     // GL_2_BYTES ES
525         { NULL, NULL, NULL, NULL },                     // GL_3_BYTES ES
526         { NULL, NULL, NULL, NULL },                     // GL_4_BYTES ES
527 #if !defined(OSG_OGL_NO_DOUBLE)
528         { NULL, NULL, NULL, NULL }                      // GL_DOUBLE  ES
529 #endif
530 #endif // OSG_USE_OGLES_PROTOS
531     };
532 #endif 
536     const UInt16 SecColorsPumpSlot  = 0;
537     const UInt16 TexCoords1PumpSlot = 1;
538     const UInt16 TexCoords2PumpSlot = 1;
539     const UInt16 TexCoords3PumpSlot = 1;
540     const UInt16 TexCoords4PumpSlot = 1;
541     const UInt16 TexCoords5PumpSlot = 1;
542     const UInt16 TexCoords6PumpSlot = 1;
543     const UInt16 TexCoords7PumpSlot = 1;
545 #if !defined(OSG_OGL_COREONLY) || defined(OSG_CHECK_COREONLY)
546     UInt32 pumpFuncIDs       [2][numFormats][4];
547 #endif
549     UInt32 attribPumpFuncIDs    [numFormats][4];
550     UInt32 normAttribPumpFuncIDs[numFormats][4];
553     struct PumpData
554     {
555         explicit PumpData();
557         const GeoIntegralProperty         *lengths;
558         const GeoIntegralProperty         *types;
559         const Geometry::MFPropertiesType  *prop;
560         const Geometry::MFPropIndicesType *propIdx;
562         const UInt8                       *attribData  [Geometry::MaxAttribs];
563               UInt32                       attribStride[Geometry::MaxAttribs];
564               GeoVectorProperty           *attribPtr   [Geometry::MaxAttribs];
565               GeoIntegralProperty         *attribIndex [Geometry::MaxAttribs];
566     };
568     PumpData::PumpData() : 
569         lengths(NULL),
570         types  (NULL),
571         prop   (NULL),
572         propIdx(NULL)
573     {
574         for(Int16 i = 0; i < Geometry::MaxAttribs; ++i)
575         {
576             attribData  [i] = NULL;
577             attribStride[i] = 0;
578             attribPtr   [i] = NULL;
579             attribIndex [i] = NULL;
580         }
581     }
583     struct PumpAttribInfo : public PumpData
584     {
585         explicit PumpAttribInfo(void);
587         attribPumpFunc attribPump[Geometry::MaxAttribs];
589     };
591     PumpAttribInfo::PumpAttribInfo(void) :
592         PumpData()
593     {
594         for(Int16 i = 0; i < Geometry::MaxAttribs; ++i)
595         {
596             attribPump[i] = NULL;
597         }
598     }
601     // check mandatory properties
602     bool pumpInternalSetup(const GeoIntegralProperty* prop, bool mandatory)
603     {
604         bool retVal = true;
606         if(mandatory == true && prop == NULL)
607         {
608             retVal = false;
609         }
611         return retVal;
612     }
616 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
617 #pragma GCC diagnostic pop
618 #endif
620 #endif // remove from all but dev docs