| 577 | } |
| 578 | |
| 579 | void GLStateCacheManager::setPointParameters(const GLfloat *attenuation, float minSize, float maxSize) |
| 580 | { |
| 581 | if(minSize > -1) |
| 582 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 583 | if (minSize != mPointSizeMin) |
| 584 | #endif |
| 585 | { |
| 586 | mPointSizeMin = minSize; |
| 587 | glPointParameterf(GL_POINT_SIZE_MIN, mPointSizeMin); |
| 588 | } |
| 589 | |
| 590 | if(maxSize > -1) |
| 591 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 592 | if (maxSize != mPointSizeMax) |
| 593 | #endif |
| 594 | { |
| 595 | mPointSizeMax = maxSize; |
| 596 | glPointParameterf(GL_POINT_SIZE_MAX, mPointSizeMax); |
| 597 | } |
| 598 | |
| 599 | if(attenuation) |
| 600 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 601 | if (attenuation[0] != mPointAttenuation[0] || attenuation[1] != mPointAttenuation[1] || attenuation[2] != mPointAttenuation[2]) |
| 602 | #endif |
| 603 | { |
| 604 | mPointAttenuation[0] = attenuation[0]; |
| 605 | mPointAttenuation[1] = attenuation[1]; |
| 606 | mPointAttenuation[2] = attenuation[2]; |
| 607 | glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, &mPointAttenuation[0]); |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | void GLStateCacheManager::enableTextureCoordGen(GLenum type) |
| 612 | { |
| 613 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 614 | std::unordered_map<GLenum, TexGenParams>::iterator it = mTextureCoordGen.find(mActiveTextureUnit); |
| 615 | if (it == mTextureCoordGen.end()) |
| 616 | { |
| 617 | glEnable(type); |
| 618 | mTextureCoordGen[mActiveTextureUnit].mEnabled.insert(type); |
| 619 | } |
| 620 | else |
| 621 | { |
| 622 | if (it->second.mEnabled.find(type) == it->second.mEnabled.end()) |
| 623 | { |
| 624 | glEnable(type); |
| 625 | it->second.mEnabled.insert(type); |
| 626 | } |
| 627 | } |
| 628 | #else |
| 629 | glEnable(type); |
| 630 | #endif |
| 631 | } |
| 632 | |
| 633 | void GLStateCacheManager::disableTextureCoordGen(GLenum type) |
| 634 | { |
| 635 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 636 | std::unordered_map<GLenum, TexGenParams>::iterator it = mTextureCoordGen.find(mActiveTextureUnit); |
no outgoing calls
no test coverage detected