#include <stdlib.h>#include <stdio.h>#include <stddef.h>#include "OSGConfig.h"#include <OSGGL.h>#include <OSGGLEXT.h>#include "OSGLog.h"#include "OSGFieldContainerPtr.h"#include "OSGGeometry.h"#include "OSGDrawAction.h"#include "OSGMaterial.h"#include "OSGGeoPumpFactory.h"Go to the source code of this file.
Namespaces | |
| namespace | osg |
Defines | |
| #define | pumpSetup(name, typename, getmethod) |
| #define | pumpInternalSetup(name, typename, getmethod, mandatory) |
| #define | pumpGLSetup(name, typename, getmethod) |
| #define | pumpGLExtSetup(name, typename, getmethod) |
| #define | pumpMultiGLExtSetup(name, typename, getmethod) |
| #define | iC |
| #define | iS |
| #define | iN |
| #define | iT |
| #define | iT1 |
| #define | iT2 |
| #define | iT3 |
| #define | iT4 |
| #define | iT5 |
| #define | iT6 |
| #define | iT7 |
| #define | rC ColorFunc ( ColorData + ColorStride * vind[ColorIndex] ); |
| #define | rS SecColorFunc ( SecColorData + SecColorStride * vind[SecColorIndex] ); |
| #define | rN NormalFunc ( NormalData + NormalStride * vind[NormalIndex] ); |
| #define | rT TexCoordsFunc ( TexCoordsData + TexCoordsStride * vind[TexCoordsIndex] ); |
| #define | rT1 TexCoords1Func( GL_TEXTURE1_ARB , TexCoords1Data + TexCoords1Stride * vind[TexCoords1Index] ); |
| #define | rT2 TexCoords2Func( GL_TEXTURE2_ARB , TexCoords2Data + TexCoords2Stride * vind[TexCoords2Index] ); |
| #define | rT3 TexCoords3Func( GL_TEXTURE3_ARB , TexCoords3Data + TexCoords3Stride * vind[TexCoords3Index] ); |
| #define | rT4 TexCoords4Func( GL_TEXTURE4_ARB , TexCoords4Data + TexCoords4Stride * vind[TexCoords4Index] ); |
| #define | rT5 TexCoords5Func( GL_TEXTURE5_ARB , TexCoords5Data + TexCoords5Stride * vind[TexCoords5Index] ); |
| #define | rT6 TexCoords6Func( GL_TEXTURE6_ARB , TexCoords6Data + TexCoords6Stride * vind[TexCoords6Index] ); |
| #define | rT7 TexCoords7Func( GL_TEXTURE7_ARB , TexCoords7Data + TexCoords7Stride * vind[TexCoords7Index] ); |
| #define | defMultiGeoPump(func, init, render) |
| #define | pumpSetup2(name, typename, getmethod) |
Typedefs | |
| typedef void(OSG_APIENTRY * | pumpFunc )(GLubyte *data) |
| typedef void(OSG_APIENTRY * | multiPumpFunc )(GLenum which, GLubyte *data) |
Functions | |
| static void | GeoPump0 (Window *win, Geometry *geo) |
| static void | GeoPump128 (Window *win, Geometry *geo) |
| static void | GeoPump129 (Window *win, Geometry *geo) |
| defMultiGeoPump (1, iC;, rC;) defMultiGeoPump(2 | |
| defMultiGeoPump (3, iC;iS;, rC;rS;) defMultiGeoPump(4 | |
| defMultiGeoPump (5, iC;iN;, rC;rN;) defMultiGeoPump(6 | |
| defMultiGeoPump (7, iC;iS;iN;, rC;rS;rN;) defMultiGeoPump(8 | |
| defMultiGeoPump (9, iC;iT;, rC;rT;) defMultiGeoPump(10 | |
| defMultiGeoPump (11, iC;iS;iT;, rC;rS;rT;) defMultiGeoPump(12 | |
| defMultiGeoPump (13, iC;iN;iT;, rC;rN;rT;) defMultiGeoPump(14 | |
| defMultiGeoPump (15, iC;iS;iN;iT;, rC;rS;rN;rT;) defMultiGeoPump(16 | |
| defMultiGeoPump (17, iC;iT1;, rC;rT1;) defMultiGeoPump(18 | |
| defMultiGeoPump (19, iC;iS;iT1;, rC;rS;rT1;) defMultiGeoPump(20 | |
| defMultiGeoPump (21, iC;iN;iT1;, rC;rN;rT1;) defMultiGeoPump(22 | |
| defMultiGeoPump (23, iC;iS;iN;iT1;, rC;rS;rN;rT1;) defMultiGeoPump(24 | |
| defMultiGeoPump (25, iC;iT;iT1;, rC;rT;rT1;) defMultiGeoPump(26 | |
| defMultiGeoPump (27, iC;iS;iT;iT1;, rC;rS;rT;rT1;) defMultiGeoPump(28 | |
| defMultiGeoPump (29, iC;iN;iT;iT1;, rC;rN;rT;rT1;) defMultiGeoPump(30 | |
| defMultiGeoPump (31, iC;iS;iN;iT;iT1;, rC;rS;rN;rT;rT1;) defMultiGeoPump(32 | |
| defMultiGeoPump (33, iC;iT2;, rC;rT2;) defMultiGeoPump(34 | |
| defMultiGeoPump (35, iC;iS;iT2;, rC;rS;rT2;) defMultiGeoPump(36 | |
| defMultiGeoPump (37, iC;iN;iT2;, rC;rN;rT2;) defMultiGeoPump(38 | |
| defMultiGeoPump (39, iC;iS;iN;iT2;, rC;rS;rN;rT2;) defMultiGeoPump(40 | |
| defMultiGeoPump (41, iC;iT;iT2;, rC;rT;rT2;) defMultiGeoPump(42 | |
| defMultiGeoPump (43, iC;iS;iT;iT2;, rC;rS;rT;rT2;) defMultiGeoPump(44 | |
| defMultiGeoPump (45, iC;iN;iT;iT2;, rC;rN;rT;rT2;) defMultiGeoPump(46 | |
| defMultiGeoPump (47, iC;iS;iN;iT;iT2;, rC;rS;rN;rT;rT2;) defMultiGeoPump(48 | |
| defMultiGeoPump (49, iC;iT1;iT2;, rC;rT1;rT2;) defMultiGeoPump(50 | |
| defMultiGeoPump (51, iC;iS;iT1;iT2;, rC;rS;rT1;rT2;) defMultiGeoPump(52 | |
| defMultiGeoPump (53, iC;iN;iT1;iT2;, rC;rN;rT1;rT2;) defMultiGeoPump(54 | |
| defMultiGeoPump (55, iC;iS;iN;iT1;iT2;, rC;rS;rN;rT1;rT2;) defMultiGeoPump(56 | |
| defMultiGeoPump (57, iC;iT;iT1;iT2;, rC;rT;rT1;rT2;) defMultiGeoPump(58 | |
| defMultiGeoPump (59, iC;iS;iT;iT1;iT2;, rC;rS;rT;rT1;rT2;) defMultiGeoPump(60 | |
| defMultiGeoPump (61, iC;iN;iT;iT1;iT2;, rC;rN;rT;rT1;rT2;) defMultiGeoPump(62 | |
| defMultiGeoPump (63, iC;iS;iN;iT;iT1;iT2;, rC;rS;rN;rT;rT1;rT2;) defMultiGeoPump(64 | |
| defMultiGeoPump (65, iC;iT3;, rC;rT3;) defMultiGeoPump(66 | |
| defMultiGeoPump (67, iC;iS;iT3;, rC;rS;rT3;) defMultiGeoPump(68 | |
| defMultiGeoPump (69, iC;iN;iT3;, rC;rN;rT3;) defMultiGeoPump(70 | |
| defMultiGeoPump (71, iC;iS;iN;iT3;, rC;rS;rN;rT3;) defMultiGeoPump(72 | |
| defMultiGeoPump (73, iC;iT;iT3;, rC;rT;rT3;) defMultiGeoPump(74 | |
| defMultiGeoPump (75, iC;iS;iT;iT3;, rC;rS;rT;rT3;) defMultiGeoPump(76 | |
| defMultiGeoPump (77, iC;iN;iT;iT3;, rC;rN;rT;rT3;) defMultiGeoPump(78 | |
| defMultiGeoPump (79, iC;iS;iN;iT;iT3;, rC;rS;rN;rT;rT3;) defMultiGeoPump(80 | |
| defMultiGeoPump (81, iC;iT1;iT3;, rC;rT1;rT3;) defMultiGeoPump(82 | |
| defMultiGeoPump (83, iC;iS;iT1;iT3;, rC;rS;rT1;rT3;) defMultiGeoPump(84 | |
| defMultiGeoPump (85, iC;iN;iT1;iT3;, rC;rN;rT1;rT3;) defMultiGeoPump(86 | |
| defMultiGeoPump (87, iC;iS;iN;iT1;iT3;, rC;rS;rN;rT1;rT3;) defMultiGeoPump(88 | |
| defMultiGeoPump (89, iC;iT;iT1;iT3;, rC;rT;rT1;rT3;) defMultiGeoPump(90 | |
| defMultiGeoPump (91, iC;iS;iT;iT1;iT3;, rC;rS;rT;rT1;rT3;) defMultiGeoPump(92 | |
| defMultiGeoPump (93, iC;iN;iT;iT1;iT3;, rC;rN;rT;rT1;rT3;) defMultiGeoPump(94 | |
| defMultiGeoPump (95, iC;iS;iN;iT;iT1;iT3;, rC;rS;rN;rT;rT1;rT3;) defMultiGeoPump(96 | |
| defMultiGeoPump (97, iC;iT2;iT3;, rC;rT2;rT3;) defMultiGeoPump(98 | |
| defMultiGeoPump (99, iC;iS;iT2;iT3;, rC;rS;rT2;rT3;) defMultiGeoPump(100 | |
| defMultiGeoPump (101, iC;iN;iT2;iT3;, rC;rN;rT2;rT3;) defMultiGeoPump(102 | |
| defMultiGeoPump (103, iC;iS;iN;iT2;iT3;, rC;rS;rN;rT2;rT3;) defMultiGeoPump(104 | |
| defMultiGeoPump (105, iC;iT;iT2;iT3;, rC;rT;rT2;rT3;) defMultiGeoPump(106 | |
| defMultiGeoPump (107, iC;iS;iT;iT2;iT3;, rC;rS;rT;rT2;rT3;) defMultiGeoPump(108 | |
| defMultiGeoPump (109, iC;iN;iT;iT2;iT3;, rC;rN;rT;rT2;rT3;) defMultiGeoPump(110 | |
| defMultiGeoPump (111, iC;iS;iN;iT;iT2;iT3;, rC;rS;rN;rT;rT2;rT3;) defMultiGeoPump(112 | |
| defMultiGeoPump (113, iC;iT1;iT2;iT3;, rC;rT1;rT2;rT3;) defMultiGeoPump(114 | |
| defMultiGeoPump (115, iC;iS;iT1;iT2;iT3;, rC;rS;rT1;rT2;rT3;) defMultiGeoPump(116 | |
| defMultiGeoPump (117, iC;iN;iT1;iT2;iT3;, rC;rN;rT1;rT2;rT3;) defMultiGeoPump(118 | |
| defMultiGeoPump (119, iC;iS;iN;iT1;iT2;iT3;, rC;rS;rN;rT1;rT2;rT3;) defMultiGeoPump(120 | |
| defMultiGeoPump (121, iC;iT;iT1;iT2;iT3;, rC;rT;rT1;rT2;rT3;) defMultiGeoPump(122 | |
| defMultiGeoPump (123, iC;iS;iT;iT1;iT2;iT3;, rC;rS;rT;rT1;rT2;rT3;) defMultiGeoPump(124 | |
| defMultiGeoPump (125, iC;iN;iT;iT1;iT2;iT3;, rC;rN;rT;rT1;rT2;rT3;) defMultiGeoPump(126 | |
| defMultiGeoPump (127, iC;iS;iN;iT;iT1;iT2;iT3;, rC;rS;rN;rT;rT1;rT2;rT3;) GeoPumpFactory | |
Variables | |
| static const int | formatBase = GL_BYTE |
| static const int | numFormats = GL_DOUBLE - GL_BYTE + 1 |
| static char * | formatNames [] |
| iS | |
| rS | |
| iN | |
| rN | |
| iT | |
| rT | |
| iT1 | |
| rT1 | |
| iT2 | |
| rT2 | |
| iT3 | |
| rT3 | |
| static Char8 | cvsid_cpp [] = "@(#)$Id: $" |
| static Char8 | cvsid_hpp [] = OSGGEOPUMPFACTORY_HEADER_CVSID |
| static Char8 | cvsid_inl [] = OSGGEOPUMPFACTORY_INLINE_CVSID |
| #define pumpSetup | ( | name, | |||
| typename, | |||||
| getmethod | ) |
Value:
typename name##Ptr; \ GLubyte * name##Data = NULL; \ UInt32 name##Stride = 0; \ \ name##Ptr = geo->getmethod(); \ if ( name##Ptr != NullFC ) \ { \ name##Data = name##Ptr->getData(); \ if ( ! ( name##Stride = name##Ptr->getStride() ) ) \ name##Stride = name##Ptr->getFormatSize() * \ name##Ptr->getDimension(); \ }
Definition at line 557 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoVBO::draw(), GeoPump128(), and GeoPump129().
| #define pumpInternalSetup | ( | name, | |||
| typename, | |||||
| getmethod, | |||||
| mandatory | ) |
Value:
GLubyte * name##Data; \ UInt32 name##Stride; \ UInt32 name##Ind = 0; \ typename name##Ptr; \ \ name##Ptr = geo->getmethod(); \ if(mandatory && name##Ptr == NullFC) \ { \ SWARNING << "masterPump: Geometry " << geo << " has no " \ << #name << "s!" << std::endl; \ return; \ } \ else if(name##Ptr != NullFC) \ { \ name##Data = name##Ptr->getData(); \ if(!(name##Stride = name##Ptr->getStride())) \ name##Stride = name##Ptr->getFormatSize() * \ name##Ptr->getDimension(); \ } \ else \ { \ name##Data = NULL; \ name##Stride = 0; \ }
Definition at line 1264 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoPumpFactory::masterGeoPump().
| #define pumpGLSetup | ( | name, | |||
| typename, | |||||
| getmethod | ) |
Definition at line 1290 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoPumpFactory::masterGeoPump().
| #define pumpGLExtSetup | ( | name, | |||
| typename, | |||||
| getmethod | ) |
Definition at line 1324 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoPumpFactory::masterGeoPump().
| #define pumpMultiGLExtSetup | ( | name, | |||
| typename, | |||||
| getmethod | ) |
Definition at line 1370 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoPumpFactory::masterGeoPump().
| #define iC |
Value:
pumpGLSetup ( Color , GeoColorsPtr , getColors )\ Int16 ColorIndex = geo->calcMappingIndex( Geometry::MapColor ); \ if(ColorData && ColorPtr->getSize() == 1) \ ColorFunc(ColorData);
Definition at line 1416 of file OSGGeoPumpFactory.cpp.
| #define iS |
Value:
pumpGLExtSetup ( SecColor , GeoColorsPtr , getSecondaryColors)\ Int16 SecColorIndex = geo->calcMappingIndex(Geometry::MapSecondaryColor);
Definition at line 1421 of file OSGGeoPumpFactory.cpp.
| #define iN |
Value:
pumpGLSetup ( Normal , GeoNormalsPtr , getNormals )\ Int16 NormalIndex = geo->calcMappingIndex(Geometry::MapNormal);
Definition at line 1424 of file OSGGeoPumpFactory.cpp.
Referenced by osg::createSharedIndex().
| #define iT |
Value:
pumpGLSetup ( TexCoords , GeoTexCoordsPtr, getTexCoords )\ Int16 TexCoordsIndex = geo->calcMappingIndex(Geometry::MapTexCoords);
Definition at line 1427 of file OSGGeoPumpFactory.cpp.
| #define iT1 |
Value:
pumpMultiGLExtSetup ( TexCoords1, GeoTexCoordsPtr, getTexCoords1 )\ Int16 TexCoords1Index = geo->calcMappingIndex(Geometry::MapTexCoords1);
Definition at line 1430 of file OSGGeoPumpFactory.cpp.
| #define iT2 |
Value:
pumpMultiGLExtSetup ( TexCoords2, GeoTexCoordsPtr, getTexCoords2 )\ Int16 TexCoords2Index = geo->calcMappingIndex(Geometry::MapTexCoords2);
Definition at line 1433 of file OSGGeoPumpFactory.cpp.
| #define iT3 |
Value:
pumpMultiGLExtSetup ( TexCoords3, GeoTexCoordsPtr, getTexCoords3 )\ Int16 TexCoords3Index = geo->calcMappingIndex(Geometry::MapTexCoords3);
Definition at line 1436 of file OSGGeoPumpFactory.cpp.
| #define iT4 |
Value:
pumpMultiGLExtSetup ( TexCoords4, GeoTexCoordsPtr, getTexCoords4 )\ Int16 TexCoords4Index = geo->calcMappingIndex(Geometry::MapTexCoords4);
Definition at line 1439 of file OSGGeoPumpFactory.cpp.
| #define iT5 |
Value:
pumpMultiGLExtSetup ( TexCoords5, GeoTexCoordsPtr, getTexCoords5 )\ Int16 TexCoords5Index = geo->calcMappingIndex(Geometry::MapTexCoords5);
Definition at line 1442 of file OSGGeoPumpFactory.cpp.
| #define iT6 |
Value:
pumpMultiGLExtSetup ( TexCoords6, GeoTexCoordsPtr, getTexCoords6 )\ Int16 TexCoords6Index = geo->calcMappingIndex(Geometry::MapTexCoords6);
Definition at line 1445 of file OSGGeoPumpFactory.cpp.
| #define iT7 |
Value:
pumpMultiGLExtSetup ( TexCoords7, GeoTexCoordsPtr, getTexCoords7 )\ Int16 TexCoords7Index = geo->calcMappingIndex(Geometry::MapTexCoords7);
Definition at line 1448 of file OSGGeoPumpFactory.cpp.
| #define rC ColorFunc ( ColorData + ColorStride * vind[ColorIndex] ); |
Definition at line 1451 of file OSGGeoPumpFactory.cpp.
| #define rS SecColorFunc ( SecColorData + SecColorStride * vind[SecColorIndex] ); |
Definition at line 1452 of file OSGGeoPumpFactory.cpp.
| #define rN NormalFunc ( NormalData + NormalStride * vind[NormalIndex] ); |
Definition at line 1453 of file OSGGeoPumpFactory.cpp.
| #define rT TexCoordsFunc ( TexCoordsData + TexCoordsStride * vind[TexCoordsIndex] ); |
Definition at line 1454 of file OSGGeoPumpFactory.cpp.
Referenced by osg::TransformationMatrix< ValueTypeT >::factor().
| #define rT1 TexCoords1Func( GL_TEXTURE1_ARB , TexCoords1Data + TexCoords1Stride * vind[TexCoords1Index] ); |
Definition at line 1455 of file OSGGeoPumpFactory.cpp.
| #define rT2 TexCoords2Func( GL_TEXTURE2_ARB , TexCoords2Data + TexCoords2Stride * vind[TexCoords2Index] ); |
Definition at line 1456 of file OSGGeoPumpFactory.cpp.
| #define rT3 TexCoords3Func( GL_TEXTURE3_ARB , TexCoords3Data + TexCoords3Stride * vind[TexCoords3Index] ); |
Definition at line 1457 of file OSGGeoPumpFactory.cpp.
| #define rT4 TexCoords4Func( GL_TEXTURE4_ARB , TexCoords4Data + TexCoords4Stride * vind[TexCoords4Index] ); |
Definition at line 1458 of file OSGGeoPumpFactory.cpp.
| #define rT5 TexCoords5Func( GL_TEXTURE5_ARB , TexCoords5Data + TexCoords5Stride * vind[TexCoords5Index] ); |
Definition at line 1459 of file OSGGeoPumpFactory.cpp.
| #define rT6 TexCoords6Func( GL_TEXTURE6_ARB , TexCoords6Data + TexCoords6Stride * vind[TexCoords6Index] ); |
Definition at line 1460 of file OSGGeoPumpFactory.cpp.
| #define rT7 TexCoords7Func( GL_TEXTURE7_ARB , TexCoords7Data + TexCoords7Stride * vind[TexCoords7Index] ); |
Definition at line 1461 of file OSGGeoPumpFactory.cpp.
| #define defMultiGeoPump | ( | func, | |||
| init, | |||||
| render | ) |
Definition at line 1468 of file OSGGeoPumpFactory.cpp.
| #define pumpSetup2 | ( | name, | |||
| typename, | |||||
| getmethod | ) |
Value:
typename name##Ptr; \ GLubyte * name##Data = NULL; \ UInt32 name##Size = 0; \ \ name##Ptr = geo->getmethod(); \ if ( name##Ptr != NullFC ) \ { \ name##Data = name##Ptr->getData(); \ name##Size = name##Ptr->getSize() * name##Ptr->getFormatSize() * name##Ptr->getDimension(); \ }
Definition at line 2234 of file OSGGeoPumpFactory.cpp.
Referenced by osg::GeoVBO::update().
| typedef void(OSG_APIENTRY * pumpFunc)(GLubyte *data) |
Definition at line 342 of file OSGGeoPumpFactory.cpp.
| typedef void(OSG_APIENTRY * multiPumpFunc)(GLenum which, GLubyte *data) |
Definition at line 343 of file OSGGeoPumpFactory.cpp.
MasterPump for empty geometry, does nothing
Definition at line 551 of file OSGGeoPumpFactory.cpp.
Referenced by defMultiGeoPump().
MasterPump for non-indexed geometry
Definition at line 574 of file OSGGeoPumpFactory.cpp.
References osg::GeoPumpFactory::_extMultitexture, osg::GeoPumpFactory::_extSecondaryColor, osg::GeoPumpFactory::_funcglClientActiveTextureARB, osg::GeoPumpFactory::_funcglSecondaryColorPointer, FWARNING, osg::Window::getFunction(), GL_SECONDARY_COLOR_ARRAY_EXT, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, GL_TEXTURE3_ARB, GL_TEXTURE4_ARB, GL_TEXTURE5_ARB, GL_TEXTURE6_ARB, GL_TEXTURE7_ARB, GLenum, GLsizei, osg::Window::hasExtension(), osg::NullFC, OSG_APIENTRY, and pumpSetup.
Referenced by defMultiGeoPump().
00576 { 00577 Int16 modified=0; 00578 pumpSetup(Positions , GeoPositionsPtr , getPositions ); 00579 pumpSetup(Colors , GeoColorsPtr , getColors ); 00580 pumpSetup(SecColors , GeoColorsPtr , getSecondaryColors ); 00581 pumpSetup(TexCoords , GeoTexCoordsPtr , getTexCoords ); 00582 pumpSetup(TexCoords1 , GeoTexCoordsPtr , getTexCoords1 ); 00583 pumpSetup(TexCoords2 , GeoTexCoordsPtr , getTexCoords2 ); 00584 pumpSetup(TexCoords3 , GeoTexCoordsPtr , getTexCoords3 ); 00585 pumpSetup(TexCoords4 , GeoTexCoordsPtr , getTexCoords4 ); 00586 pumpSetup(TexCoords5 , GeoTexCoordsPtr , getTexCoords5 ); 00587 pumpSetup(TexCoords6 , GeoTexCoordsPtr , getTexCoords6 ); 00588 pumpSetup(TexCoords7 , GeoTexCoordsPtr , getTexCoords7 ); 00589 pumpSetup(Normals , GeoNormalsPtr , getNormals ); 00590 00591 pumpSetup(Lengths , GeoPLengthsPtr , getLengths ); 00592 pumpSetup(Types , GeoPTypesPtr , getTypes ); 00593 00594 if (PositionsData) 00595 { 00596 glVertexPointer(PositionsPtr->getDimension(), PositionsPtr->getFormat(), 00597 PositionsStride, PositionsData); 00598 glEnableClientState(GL_VERTEX_ARRAY); 00599 modified|=(1<<0); 00600 } 00601 00602 if (ColorsData) 00603 { 00604 glColorPointer(ColorsPtr->getDimension(), ColorsPtr->getFormat(), 00605 ColorsStride, ColorsData); 00606 glEnableClientState(GL_COLOR_ARRAY); 00607 modified|=(1<<1); 00608 } 00609 00610 if (SecColorsData) 00611 { 00612 if (win->hasExtension(GeoPumpFactory::_extSecondaryColor)) 00613 { 00614 void (OSG_APIENTRY*_glSecondaryColorPointerEXT) 00615 (GLint size,GLenum type,GLsizei stride,const GLvoid *pointer)= 00616 (void (OSG_APIENTRY*)(GLint size,GLenum type,GLsizei stride,const GLvoid *pointer)) 00617 win->getFunction(GeoPumpFactory::_funcglSecondaryColorPointer); 00618 00619 _glSecondaryColorPointerEXT(SecColorsPtr->getDimension(), 00620 SecColorsPtr->getFormat(), 00621 SecColorsStride, SecColorsData); 00622 glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); 00623 modified|=(1<<2); 00624 } 00625 else 00626 FWARNING(("GeoPump128: Window has no Secondary Color extension\n")); 00627 } 00628 00629 00630 if (NormalsData) 00631 { 00632 glNormalPointer(NormalsPtr->getFormat(), NormalsStride, NormalsData); 00633 glEnableClientState(GL_NORMAL_ARRAY); 00634 modified|=(1<<3); 00635 } 00636 00637 if (TexCoordsData) 00638 { 00639 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00640 { 00641 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00642 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00643 _glClientActiveTextureARB(GL_TEXTURE0_ARB); 00644 glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(), 00645 TexCoordsStride, TexCoordsData); 00646 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00647 } 00648 else 00649 { 00650 glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(), 00651 TexCoordsStride, TexCoordsData); 00652 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00653 } 00654 modified|=(1<<4); 00655 } 00656 00657 if (TexCoords1Data) 00658 { 00659 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00660 { 00661 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00662 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00663 _glClientActiveTextureARB(GL_TEXTURE1_ARB); 00664 glTexCoordPointer (TexCoords1Ptr->getDimension(), TexCoords1Ptr->getFormat(), 00665 TexCoords1Stride, TexCoords1Data); 00666 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00667 modified|=(1<<5); 00668 } 00669 else 00670 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00671 } 00672 00673 if (TexCoords2Data) 00674 { 00675 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00676 { 00677 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00678 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00679 _glClientActiveTextureARB(GL_TEXTURE2_ARB); 00680 glTexCoordPointer (TexCoords2Ptr->getDimension(), TexCoords2Ptr->getFormat(), 00681 TexCoords2Stride, TexCoords2Data); 00682 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00683 modified|=(1<<6); 00684 } 00685 else 00686 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00687 } 00688 00689 if (TexCoords3Data) 00690 { 00691 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00692 { 00693 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00694 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00695 _glClientActiveTextureARB(GL_TEXTURE3_ARB); 00696 glTexCoordPointer (TexCoords3Ptr->getDimension(), TexCoords3Ptr->getFormat(), 00697 TexCoords3Stride, TexCoords3Data); 00698 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00699 modified|=(1<<7); 00700 } 00701 else 00702 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00703 } 00704 00705 if (TexCoords4Data) 00706 { 00707 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00708 { 00709 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00710 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00711 _glClientActiveTextureARB(GL_TEXTURE4_ARB); 00712 glTexCoordPointer (TexCoords4Ptr->getDimension(), TexCoords4Ptr->getFormat(), 00713 TexCoords4Stride, TexCoords4Data); 00714 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00715 modified|=(1<<8); 00716 } 00717 else 00718 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00719 } 00720 00721 if (TexCoords5Data) 00722 { 00723 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00724 { 00725 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00726 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00727 _glClientActiveTextureARB(GL_TEXTURE5_ARB); 00728 glTexCoordPointer (TexCoords5Ptr->getDimension(), TexCoords5Ptr->getFormat(), 00729 TexCoords5Stride, TexCoords5Data); 00730 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00731 modified|=(1<<9); 00732 } 00733 else 00734 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00735 } 00736 00737 if (TexCoords6Data) 00738 { 00739 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00740 { 00741 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00742 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00743 _glClientActiveTextureARB(GL_TEXTURE6_ARB); 00744 glTexCoordPointer (TexCoords6Ptr->getDimension(), TexCoords6Ptr->getFormat(), 00745 TexCoords6Stride, TexCoords6Data); 00746 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00747 modified|=(1<<10); 00748 } 00749 else 00750 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00751 } 00752 00753 if (TexCoords7Data) 00754 { 00755 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00756 { 00757 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00758 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00759 _glClientActiveTextureARB(GL_TEXTURE7_ARB); 00760 glTexCoordPointer (TexCoords7Ptr->getDimension(), TexCoords7Ptr->getFormat(), 00761 TexCoords7Stride, TexCoords7Data); 00762 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00763 modified|=(1<<11); 00764 } 00765 else 00766 FWARNING(("GeoPump128: Window has no MultitextureARB extension\n")); 00767 } 00768 00769 UInt32 lendummy; 00770 UInt32 LengthsSize; 00771 UInt32 LengthsFormatSize; 00772 00773 if(LengthsPtr != NullFC && LengthsData != NULL) 00774 { 00775 LengthsSize = LengthsPtr->getSize(); 00776 LengthsFormatSize = LengthsPtr->getFormatSize(); 00777 } 00778 else 00779 { 00780 LengthsSize = 1; 00781 LengthsFormatSize = 4; 00782 LengthsData = (UChar8*) &lendummy; 00783 lendummy = PositionsPtr->getSize(); 00784 } 00785 00786 UInt32 LengthsInd,TypesInd = 0; 00787 UInt32 first=0; 00788 00789 if(LengthsFormatSize == 4) 00790 { 00791 for(LengthsInd = 0; LengthsInd < LengthsSize; LengthsInd++) 00792 { 00793 UInt32 count = *(UInt32*)(LengthsData + LengthsInd * LengthsStride); 00794 glDrawArrays(*(TypesData + TypesInd++ * TypesStride),first,count); 00795 first+=count; 00796 } 00797 } 00798 else if(LengthsFormatSize == 2) 00799 { 00800 for(LengthsInd = 0; LengthsInd < LengthsSize; LengthsInd++) 00801 { 00802 UInt16 count = *(UInt16*)(LengthsData + LengthsInd * LengthsStride); 00803 glDrawArrays(*(TypesData + TypesInd++ * TypesStride),first,count); 00804 first+=count; 00805 } 00806 } 00807 else 00808 { 00809 FWARNING(("GeoPump128: unknown Lengths format size\n")); 00810 } 00811 00812 if(modified&(1<<0)) glDisableClientState(GL_VERTEX_ARRAY); 00813 if(modified&(1<<1)) glDisableClientState(GL_COLOR_ARRAY); 00814 if(modified&(1<<2)) glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); 00815 if(modified&(1<<3)) glDisableClientState(GL_NORMAL_ARRAY); 00816 00817 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00818 { 00819 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00820 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00821 00822 if(modified&(1<<4)) 00823 { 00824 _glClientActiveTextureARB(GL_TEXTURE0_ARB); 00825 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00826 } 00827 00828 if(modified&(1<<5)) 00829 { 00830 _glClientActiveTextureARB(GL_TEXTURE1_ARB); 00831 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00832 } 00833 00834 if(modified&(1<<6)) 00835 { 00836 _glClientActiveTextureARB(GL_TEXTURE2_ARB); 00837 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00838 } 00839 00840 if(modified&(1<<7)) 00841 { 00842 _glClientActiveTextureARB(GL_TEXTURE3_ARB); 00843 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00844 } 00845 00846 if(modified&(1<<8)) 00847 { 00848 _glClientActiveTextureARB(GL_TEXTURE4_ARB); 00849 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00850 } 00851 00852 if(modified&(1<<9)) 00853 { 00854 _glClientActiveTextureARB(GL_TEXTURE5_ARB); 00855 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00856 } 00857 00858 if(modified&(1<<10)) 00859 { 00860 _glClientActiveTextureARB(GL_TEXTURE6_ARB); 00861 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00862 } 00863 00864 if(modified&(1<<11)) 00865 { 00866 _glClientActiveTextureARB(GL_TEXTURE7_ARB); 00867 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00868 } 00869 } 00870 else 00871 { 00872 if(modified&(1<<4)) glDisableClientState(GL_TEXTURE_COORD_ARRAY); 00873 } 00874 }
MasterPump for single-indexed geometry
Definition at line 880 of file OSGGeoPumpFactory.cpp.
References osg::GeoPumpFactory::_extCompiledVertexArray, osg::GeoPumpFactory::_extDrawRangeElements, osg::GeoPumpFactory::_extMultitexture, osg::GeoPumpFactory::_extSecondaryColor, osg::GeoPumpFactory::_funcglClientActiveTextureARB, osg::GeoPumpFactory::_funcglDrawRangeElementsEXT, osg::GeoPumpFactory::_funcglLockArraysEXT, osg::GeoPumpFactory::_funcglSecondaryColorPointer, osg::GeoPumpFactory::_funcglUnlockArraysEXT, FWARNING, osg::Window::getFunction(), osg::GeometryBase::getHighindices(), osg::GeometryBase::getLowindices(), osg::GeometryBase::getMaxindex(), osg::GeometryBase::getMinindex(), GL_SECONDARY_COLOR_ARRAY_EXT, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, GL_TEXTURE3_ARB, GL_TEXTURE4_ARB, GL_TEXTURE5_ARB, GL_TEXTURE6_ARB, GL_TEXTURE7_ARB, GLenum, GLsizei, GLuint(), osg::Window::hasExtension(), osg::NullFC, OSG_APIENTRY, pumpSetup, and start.
Referenced by defMultiGeoPump().
00882 { 00883 Int16 modified=0; 00884 pumpSetup(Positions , GeoPositionsPtr , getPositions ); 00885 pumpSetup(Colors , GeoColorsPtr , getColors ); 00886 pumpSetup(SecColors , GeoColorsPtr , getSecondaryColors ); 00887 pumpSetup(TexCoords , GeoTexCoordsPtr , getTexCoords ); 00888 pumpSetup(TexCoords1 , GeoTexCoordsPtr , getTexCoords1 ); 00889 pumpSetup(TexCoords2 , GeoTexCoordsPtr , getTexCoords2 ); 00890 pumpSetup(TexCoords3 , GeoTexCoordsPtr , getTexCoords3 ); 00891 pumpSetup(TexCoords4 , GeoTexCoordsPtr , getTexCoords4 ); 00892 pumpSetup(TexCoords5 , GeoTexCoordsPtr , getTexCoords5 ); 00893 pumpSetup(TexCoords6 , GeoTexCoordsPtr , getTexCoords6 ); 00894 pumpSetup(TexCoords7 , GeoTexCoordsPtr , getTexCoords7 ); 00895 pumpSetup(Normals , GeoNormalsPtr , getNormals ); 00896 00897 pumpSetup(Lengths , GeoPLengthsPtr , getLengths ); 00898 pumpSetup(Types , GeoPTypesPtr , getTypes ); 00899 pumpSetup(Indices , GeoIndicesPtr , getIndices ); 00900 00901 if (PositionsData) 00902 { 00903 glVertexPointer(PositionsPtr->getDimension(), PositionsPtr->getFormat(), 00904 PositionsStride, PositionsData); 00905 glEnableClientState(GL_VERTEX_ARRAY); 00906 modified|=(1<<0); 00907 } 00908 00909 if (ColorsData) 00910 { 00911 glColorPointer(ColorsPtr->getDimension(), ColorsPtr->getFormat(), 00912 ColorsStride, ColorsData); 00913 glEnableClientState(GL_COLOR_ARRAY); 00914 modified|=(1<<1); 00915 } 00916 00917 if (SecColorsData) 00918 { 00919 if (win->hasExtension(GeoPumpFactory::_extSecondaryColor)) 00920 { 00921 void (OSG_APIENTRY*_glSecondaryColorPointerEXT) 00922 (GLint size,GLenum type,GLsizei stride,const GLvoid *pointer)= 00923 (void (OSG_APIENTRY*)(GLint size,GLenum type,GLsizei stride,const GLvoid *pointer)) 00924 win->getFunction(GeoPumpFactory::_funcglSecondaryColorPointer); 00925 00926 _glSecondaryColorPointerEXT(SecColorsPtr->getDimension(), 00927 SecColorsPtr->getFormat(), 00928 SecColorsStride, SecColorsData); 00929 glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); 00930 modified|=(1<<2); 00931 } 00932 else 00933 FWARNING(("GeoPump129: Window has no Secondary Color extension\n")); 00934 } 00935 00936 00937 if (NormalsData) 00938 { 00939 glNormalPointer(NormalsPtr->getFormat(), NormalsStride, NormalsData); 00940 glEnableClientState(GL_NORMAL_ARRAY); 00941 modified|=(1<<3); 00942 } 00943 00944 if (TexCoordsData) 00945 { 00946 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00947 { 00948 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00949 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00950 _glClientActiveTextureARB(GL_TEXTURE0_ARB); 00951 glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(), 00952 TexCoordsStride, TexCoordsData); 00953 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00954 } 00955 else 00956 { 00957 glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(), 00958 TexCoordsStride, TexCoordsData); 00959 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00960 } 00961 modified|=(1<<4); 00962 } 00963 00964 if (TexCoords1Data) 00965 { 00966 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00967 { 00968 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00969 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00970 _glClientActiveTextureARB(GL_TEXTURE1_ARB); 00971 glTexCoordPointer (TexCoords1Ptr->getDimension(), TexCoords1Ptr->getFormat(), 00972 TexCoords1Stride, TexCoords1Data); 00973 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00974 modified|=(1<<5); 00975 } 00976 else 00977 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 00978 } 00979 00980 if (TexCoords2Data) 00981 { 00982 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00983 { 00984 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 00985 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 00986 _glClientActiveTextureARB(GL_TEXTURE2_ARB); 00987 glTexCoordPointer (TexCoords2Ptr->getDimension(), TexCoords2Ptr->getFormat(), 00988 TexCoords2Stride, TexCoords2Data); 00989 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00990 modified|=(1<<6); 00991 } 00992 else 00993 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 00994 } 00995 00996 if (TexCoords3Data) 00997 { 00998 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 00999 { 01000 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01001 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01002 _glClientActiveTextureARB(GL_TEXTURE3_ARB); 01003 glTexCoordPointer (TexCoords3Ptr->getDimension(), TexCoords3Ptr->getFormat(), 01004 TexCoords3Stride, TexCoords3Data); 01005 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 01006 modified|=(1<<7); 01007 } 01008 else 01009 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 01010 } 01011 01012 if (TexCoords4Data) 01013 { 01014 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 01015 { 01016 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01017 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01018 _glClientActiveTextureARB(GL_TEXTURE4_ARB); 01019 glTexCoordPointer (TexCoords4Ptr->getDimension(), TexCoords4Ptr->getFormat(), 01020 TexCoords4Stride, TexCoords4Data); 01021 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 01022 modified|=(1<<8); 01023 } 01024 else 01025 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 01026 } 01027 01028 if (TexCoords5Data) 01029 { 01030 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 01031 { 01032 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01033 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01034 _glClientActiveTextureARB(GL_TEXTURE5_ARB); 01035 glTexCoordPointer (TexCoords5Ptr->getDimension(), TexCoords5Ptr->getFormat(), 01036 TexCoords5Stride, TexCoords5Data); 01037 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 01038 modified|=(1<<9); 01039 } 01040 else 01041 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 01042 } 01043 01044 if (TexCoords6Data) 01045 { 01046 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 01047 { 01048 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01049 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01050 _glClientActiveTextureARB(GL_TEXTURE6_ARB); 01051 glTexCoordPointer (TexCoords6Ptr->getDimension(), TexCoords6Ptr->getFormat(), 01052 TexCoords6Stride, TexCoords6Data); 01053 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 01054 modified|=(1<<10); 01055 } 01056 else 01057 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 01058 } 01059 01060 if (TexCoords7Data) 01061 { 01062 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 01063 { 01064 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01065 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01066 _glClientActiveTextureARB(GL_TEXTURE7_ARB); 01067 glTexCoordPointer (TexCoords7Ptr->getDimension(), TexCoords7Ptr->getFormat(), 01068 TexCoords7Stride, TexCoords7Data); 01069 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 01070 modified|=(1<<11); 01071 } 01072 else 01073 FWARNING(("GeoPump129: Window has no MultitextureARB extension\n")); 01074 } 01075 01076 UInt32 lendummy; 01077 UInt32 LengthsSize; 01078 bool len16 = false; 01079 01080 if(LengthsPtr != NullFC && LengthsData != NULL) 01081 { 01082 LengthsSize = LengthsPtr->getSize(); 01083 len16 = (LengthsPtr->getFormatSize() == 2); 01084 } 01085 else 01086 { 01087 LengthsSize = 1; 01088 LengthsData = (UChar8*) &lendummy; 01089 lendummy = PositionsPtr->getSize(); 01090 } 01091 01092 UInt32 LengthsInd = 0, TypesInd = 0, IndicesInd = 0, 01093 IndicesSize = IndicesPtr->getSize(); 01094 01095 if (win->hasExtension(GeoPumpFactory::_extCompiledVertexArray)) 01096 { 01097 void (OSG_APIENTRY*_glLockArraysEXT) (GLint first, GLsizei count)= 01098 (void (OSG_APIENTRY*) (GLint first, GLsizei count)) 01099 win->getFunction(GeoPumpFactory::_funcglLockArraysEXT); 01100 01101 _glLockArraysEXT(geo->getMinindex(), geo->getMaxindex() + 1); 01102 } 01103 01104 void (OSG_APIENTRY *osgGLDrawRangeElementsEXT)(GLenum mode, GLuint start, 01105 GLuint end, GLsizei count, GLenum type, const GLvoid*indices) = 01106 (void (OSG_APIENTRY *)(GLenum mode, GLuint start, 01107 GLuint end, GLsizei count, GLenum type, const GLvoid*indices)) 01108 win->getFunction(GeoPumpFactory::_funcglDrawRangeElementsEXT); 01109 01110 01111 if(len16 == false) 01112 { 01113 for(LengthsInd = 0; LengthsInd < LengthsSize; LengthsInd++) 01114 { 01115 UInt32 count = *(UInt32*)(LengthsData + LengthsInd * LengthsStride); 01116 UInt8 * vind = IndicesData + IndicesStride * IndicesInd; 01117 IndicesInd += count; 01118 01119 #if 0 01120 glDrawElements(*(TypesData + TypesInd++ * TypesStride),count, 01121 IndicesPtr->getFormat(),vind); 01122 #else 01123 if(win->hasExtension(GeoPumpFactory::_extDrawRangeElements)) 01124 { 01125 osgGLDrawRangeElementsEXT(*(TypesData + TypesInd++ * TypesStride), 01126 geo->getLowindices() [LengthsInd], 01127 geo->getHighindices()[LengthsInd], 01128 count, 01129 IndicesPtr->getFormat(), 01130 vind); 01131 } 01132 else 01133 { 01134 // hope this still works 01135 glDrawElements(*(TypesData + TypesInd++ * TypesStride), 01136 count, 01137 IndicesPtr->getFormat(), 01138 vind); 01139 } 01140 #endif 01141 } 01142 } 01143 else if(len16 == true) 01144 { 01145 for(LengthsInd = 0; LengthsInd < LengthsSize; LengthsInd++) 01146 { 01147 UInt16 count = *(UInt16*)(LengthsData + LengthsInd * LengthsStride); 01148 UInt8 * vind = IndicesData + IndicesStride * IndicesInd; 01149 IndicesInd += count; 01150 01151 #if 0 01152 glDrawElements(*(TypesData + TypesInd++ * TypesStride),count, 01153 IndicesPtr->getFormat(),vind); 01154 #else 01155 if(win->hasExtension(GeoPumpFactory::_extDrawRangeElements)) 01156 { 01157 osgGLDrawRangeElementsEXT(*(TypesData + TypesInd++ * TypesStride), 01158 0, 01159 IndicesSize, 01160 count, 01161 IndicesPtr->getFormat(), 01162 vind); 01163 } 01164 else 01165 { 01166 // hope this still works 01167 glDrawElements(*(TypesData + TypesInd++ * TypesStride), 01168 count, 01169 IndicesPtr->getFormat(), 01170 vind); 01171 } 01172 #endif 01173 } 01174 } 01175 else 01176 { 01177 FWARNING(("GeoPump129: unknown Lengths format size\n")); 01178 } 01179 01180 if (win->hasExtension(GeoPumpFactory::_extCompiledVertexArray)) 01181 { 01182 void (OSG_APIENTRY*_glUnlockArraysEXT) (void)= 01183 (void (OSG_APIENTRY*) (void)) 01184 win->getFunction(GeoPumpFactory::_funcglUnlockArraysEXT); 01185 01186 _glUnlockArraysEXT(); 01187 } 01188 01189 if(modified&(1<<0)) glDisableClientState(GL_VERTEX_ARRAY); 01190 if(modified&(1<<1)) glDisableClientState(GL_COLOR_ARRAY); 01191 if(modified&(1<<2)) glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); 01192 if(modified&(1<<3)) glDisableClientState(GL_NORMAL_ARRAY); 01193 01194 if (win->hasExtension(GeoPumpFactory::_extMultitexture)) 01195 { 01196 void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)= 01197 (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB); 01198 01199 if(modified&(1<<4)) 01200 { 01201 _glClientActiveTextureARB(GL_TEXTURE0_ARB); 01202 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01203 } 01204 01205 if(modified&(1<<5)) 01206 { 01207 _glClientActiveTextureARB(GL_TEXTURE1_ARB); 01208 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01209 } 01210 01211 if(modified&(1<<6)) 01212 { 01213 _glClientActiveTextureARB(GL_TEXTURE2_ARB); 01214 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01215 } 01216 01217 if(modified&(1<<7)) 01218 { 01219 _glClientActiveTextureARB(GL_TEXTURE3_ARB); 01220 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01221 } 01222 01223 if(modified&(1<<8)) 01224 { 01225 _glClientActiveTextureARB(GL_TEXTURE4_ARB); 01226 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01227 } 01228 01229 if(modified&(1<<9)) 01230 { 01231 _glClientActiveTextureARB(GL_TEXTURE5_ARB); 01232 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01233 } 01234 01235 if(modified&(1<<10)) 01236 { 01237 _glClientActiveTextureARB(GL_TEXTURE6_ARB); 01238 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01239 } 01240 01241 if(modified&(1<<11)) 01242 { 01243 _glClientActiveTextureARB(GL_TEXTURE7_ARB); 01244 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01245 } 01246 } 01247 else 01248 { 01249 if(modified&(1<<4)) glDisableClientState(GL_TEXTURE_COORD_ARRAY); 01250 } 01251 }
| defMultiGeoPump | ( | 1 | , | |
| iC; | , | |||
| rC; | ||||
| ) |
Definition at line 1654 of file OSGGeoPumpFactory.cpp.
References GeoPump0(), GeoPump128(), GeoPump129(), and osg::GeoPumpFactory::masterGeoPump().
01658 {&GeoPump0, 01659 &GeoPump1,&GeoPump2,&GeoPump3,&GeoPump4,&GeoPump5,&GeoPump6,&GeoPump7,&GeoPump8, 01660 &GeoPump9,&GeoPump10,&GeoPump11,&GeoPump12,&GeoPump13,&GeoPump14,&GeoPump15,&GeoPump16, 01661 &GeoPump17,&GeoPump18,&GeoPump19,&GeoPump20,&GeoPump21,&GeoPump22,&GeoPump23,&GeoPump24, 01662 &GeoPump25,&GeoPump26,&GeoPump27,&GeoPump28,&GeoPump29,&GeoPump30,&GeoPump31,&GeoPump32, 01663 &GeoPump33,&GeoPump34,&GeoPump35,&GeoPump36,&GeoPump37,&GeoPump38,&GeoPump39,&GeoPump40, 01664 &GeoPump41,&GeoPump42,&GeoPump43,&GeoPump44,&GeoPump45,&GeoPump46,&GeoPump47,&GeoPump48, 01665 &GeoPump49,&GeoPump50,&GeoPump51,&GeoPump52,&GeoPump53,&GeoPump54,&GeoPump55,&GeoPump56, 01666 &GeoPump57,&GeoPump58,&GeoPump59,&GeoPump60,&GeoPump61,&GeoPump62,&GeoPump63,&GeoPump64, 01667 &GeoPump65,&GeoPump66,&GeoPump67,&GeoPump68,&GeoPump69,&GeoPump70,&GeoPump71,&GeoPump72, 01668 &GeoPump73,&GeoPump74,&GeoPump75,&GeoPump76,&GeoPump77,&GeoPump78,&GeoPump79,&GeoPump80, 01669 &GeoPump81,&GeoPump82,&GeoPump83,&GeoPump84,&GeoPump85,&GeoPump86,&GeoPump87,&GeoPump88, 01670 &GeoPump89,&GeoPump90,&GeoPump91,&GeoPump92,&GeoPump93,&GeoPump94,&GeoPump95,&GeoPump96, 01671 &GeoPump97,&GeoPump98,&GeoPump99,&GeoPump100,&GeoPump101,&GeoPump102,&GeoPump103,&GeoPump104, 01672 &GeoPump105,&GeoPump106,&GeoPump107,&GeoPump108,&GeoPump109,&GeoPump110,&GeoPump111,&GeoPump112, 01673 &GeoPump113,&GeoPump114,&GeoPump115,&GeoPump116,&GeoPump117,&GeoPump118,&GeoPump119,&GeoPump120, 01674 &GeoPump121,&GeoPump122,&GeoPump123,&GeoPump124,&GeoPump125,&GeoPump126,&GeoPump127,&GeoPump128, 01675 &GeoPump129,&GeoPumpFactory::masterGeoPump};
const int formatBase = GL_BYTE [static] |
Definition at line 349 of file OSGGeoPumpFactory.cpp.
const int numFormats = GL_DOUBLE - GL_BYTE + 1 [static] |
Definition at line 350 of file OSGGeoPumpFactory.cpp.
char* formatNames[] [static] |
Initial value:
{ "GL_BYTE", "GL_UNSIGNED_BYTE", "GL_SHORT", "GL_UNSIGNED_SHORT",
"GL_INT", "GL_UNSIGNED_INT", "GL_FLOAT", "GL_2_BYTES",
"GL_3_BYTES", "GL_4_BYTES", "GL_DOUBLE"
}
Definition at line 352 of file OSGGeoPumpFactory.cpp.
Definition at line 1529 of file OSGGeoPumpFactory.cpp.
Definition at line 1529 of file OSGGeoPumpFactory.cpp.
Definition at line 1531 of file OSGGeoPumpFactory.cpp.
Definition at line 1531 of file OSGGeoPumpFactory.cpp.
Definition at line 1535 of file OSGGeoPumpFactory.cpp.
Definition at line 1535 of file OSGGeoPumpFactory.cpp.
Definition at line 1543 of file OSGGeoPumpFactory.cpp.
Definition at line 1543 of file OSGGeoPumpFactory.cpp.
Definition at line 1559 of file OSGGeoPumpFactory.cpp.
Definition at line 1559 of file OSGGeoPumpFactory.cpp.
Definition at line 1591 of file OSGGeoPumpFactory.cpp.
Definition at line 1591 of file OSGGeoPumpFactory.cpp.
Char8 cvsid_cpp[] = "@(#)$Id: $" [static] |
Definition at line 3081 of file OSGGeoPumpFactory.cpp.
Char8 cvsid_hpp[] = OSGGEOPUMPFACTORY_HEADER_CVSID [static] |
Definition at line 3082 of file OSGGeoPumpFactory.cpp.
Char8 cvsid_inl[] = OSGGEOPUMPFACTORY_INLINE_CVSID [static] |
Definition at line 3083 of file OSGGeoPumpFactory.cpp.
1.5.5