------------------------------------------------------------------------------
| 422 | |
| 423 | //------------------------------------------------------------------------------ |
| 424 | static int FindPowerOfTwo(int i, int maxDimGL) |
| 425 | { |
| 426 | int size = vtkMath::NearestPowerOfTwo(i); |
| 427 | |
| 428 | // [these lines added by Tim Hutton (implementing Joris Vanden Wyngaerd's |
| 429 | // suggestions)] |
| 430 | // limit the size of the texture to the maximum allowed by OpenGL |
| 431 | // (slightly more graceful than texture failing but not ideal) |
| 432 | if (size < 0 || size > maxDimGL) |
| 433 | { |
| 434 | size = maxDimGL; |
| 435 | } |
| 436 | // end of Tim's additions |
| 437 | |
| 438 | return size; |
| 439 | } |
| 440 | |
| 441 | //------------------------------------------------------------------------------ |
| 442 | // Creates resampled unsigned char texture map that is a power of two in both |
no outgoing calls
no test coverage detected