| 370 | } |
| 371 | |
| 372 | void GLStateCacheManager::setEnabled(GLenum flag, bool enabled) |
| 373 | { |
| 374 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 375 | auto iter = std::find(mEnableVector.begin(), mEnableVector.end(), flag); |
| 376 | bool was_enabled = iter != mEnableVector.end(); |
| 377 | |
| 378 | if(was_enabled == enabled) |
| 379 | return; // no change |
| 380 | |
| 381 | if(!enabled) |
| 382 | { |
| 383 | mEnableVector.erase(iter); |
| 384 | } |
| 385 | else |
| 386 | { |
| 387 | mEnableVector.push_back(flag); |
| 388 | } |
| 389 | #endif |
| 390 | if(!enabled) |
| 391 | { |
| 392 | glDisable(flag); |
| 393 | } |
| 394 | else |
| 395 | { |
| 396 | glEnable(flag); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | void GLStateCacheManager::setViewport(const Rect& r) |
| 401 | { |
no test coverage detected