
Public Types | |
| enum | { numFormats = GL_DOUBLE - GL_BYTE + 1 } |
| typedef void(OSG_APIENTRY * | pumpFunc )(GLubyte *data) |
Static Public Member Functions | |
| static void | init (Particles *part, DrawActionBase *, dataType &data) |
| static bool | particle (dataType &data, UInt32 particle) |
| static void | vertex (dataType &, UInt32, UInt32) |
Static Public Attributes | |
Drawing Pumps | |
| static const int | formatBase = GL_BYTE |
| static char * | formatNames [] |
| static pumpFunc | ColorFuncs [numFormats][4] |
Classes | |
| struct | dataType |
Definition at line 612 of file OSGParticles.cpp.
typedef void(OSG_APIENTRY * ColTraitBase::pumpFunc)(GLubyte *data) [inherited] |
anonymous enum [inherited] |
| static void ColTraitGeneric::init | ( | Particles * | part, | |
| DrawActionBase * | , | |||
| dataType & | data | |||
| ) | [inline, static] |
Definition at line 623 of file OSGParticles.cpp.
References ColorFuncs, ColTraitGeneric::dataType::data, formatBase, formatNames, ColTraitGeneric::dataType::func, osg::ParticlesBase::getColors(), osg::ParticlesBase::getPositions(), osg::NullFC, ColTraitGeneric::dataType::perParticle, ColTraitGeneric::dataType::stride, and SWARNING.
00624 { 00625 GeoColorsPtr col = part->getColors(); 00626 00627 data.perParticle = false; 00628 00629 if(col != NullFC) 00630 { 00631 data.data = col->getData(); 00632 if((data.stride = col->getStride()) == 0) 00633 data.stride = col->getFormatSize() * col->getDimension(); 00634 00635 data.func = ColorFuncs[ col->getFormat() - formatBase ] 00636 [ col->getDimension() - 1 ]; 00637 00638 if(data.func == NULL) 00639 { 00640 SWARNING << "Particles " << part << "have illegal " 00641 << "colors: " << col->getDimension() 00642 << "D " << formatNames[ col->getFormat() - formatBase ] 00643 << "!" << std::endl; 00644 return; 00645 } 00646 00647 if(col->getSize() == 1) 00648 { 00649 data.func((GLubyte*) col->getData()); 00650 } 00651 else if(col->getSize() == part->getPositions()->getSize()) 00652 { 00653 data.perParticle = true; 00654 } 00655 } 00656 }
| static bool ColTraitGeneric::particle | ( | dataType & | data, | |
| UInt32 | particle | |||
| ) | [inline, static] |
Definition at line 658 of file OSGParticles.cpp.
References ColTraitGeneric::dataType::data, ColTraitGeneric::dataType::func, ColTraitGeneric::dataType::perParticle, and ColTraitGeneric::dataType::stride.
00659 { 00660 if(data.perParticle == true) 00661 data.func((GLubyte*)(data.data + particle * data.stride)); 00662 return false; 00663 }
| static void ColTraitGeneric::vertex | ( | dataType & | , | |
| UInt32 | , | |||
| UInt32 | ||||
| ) | [inline, static] |
const int ColTraitBase::formatBase = GL_BYTE [static, inherited] |
The smallest enum for data types, used as a base for the formatNames map.
Definition at line 467 of file OSGParticles.cpp.
char * ColTraitBase::formatNames [static, inherited] |
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 470 of file OSGParticles.cpp.
ColTraitBase::pumpFunc ColTraitBase::ColorFuncs [static, inherited] |
Initial value:
{
{ NULL, NULL,
(pumpFunc)glColor3bv, (pumpFunc)glColor4bv },
{ NULL, NULL,
(pumpFunc)glColor3ubv,(pumpFunc)glColor4ubv },
{ NULL, NULL,
(pumpFunc)glColor3sv, (pumpFunc)glColor4sv },
{ NULL, NULL,
(pumpFunc)glColor3usv,(pumpFunc)glColor4usv },
{ NULL, NULL,
(pumpFunc)glColor3iv, (pumpFunc)glColor4iv },
{ NULL, NULL,
(pumpFunc)glColor3uiv,(pumpFunc)glColor4uiv },
{ NULL, NULL,
(pumpFunc)glColor3fv, (pumpFunc)glColor4fv },
{ NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL },
{ NULL, NULL,
(pumpFunc)glColor3dv, (pumpFunc)glColor4dv },
}
Definition at line 472 of file OSGParticles.cpp.
1.5.5