MCPcopy Create free account
hub / github.com/OGRECave/ogre / getTextureSize

Method getTextureSize

OgreMain/src/OgreAutoParamDataSource.cpp:657–675  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

655 }
656 //-----------------------------------------------------------------------------
657 Vector4f AutoParamDataSource::getTextureSize(size_t index) const
658 {
659 Vector4f size = Vector4f(1,1,1,1);
660
661 if (index < mCurrentPass->getNumTextureUnitStates())
662 {
663 const TexturePtr& tex = mCurrentPass->getTextureUnitState(
664 static_cast<unsigned short>(index))->_getTexturePtr();
665 if (tex)
666 {
667 size[0] = static_cast<float>(tex->getWidth());
668 size[1] = static_cast<float>(tex->getHeight());
669 size[2] = static_cast<float>(tex->getDepth());
670 size[3] = static_cast<float>(tex->getNumMipmaps());
671 }
672 }
673
674 return size;
675 }
676 //-----------------------------------------------------------------------------
677 Vector4f AutoParamDataSource::getInverseTextureSize(size_t index) const
678 {

Callers 1

_updateAutoParamsMethod · 0.80

Calls 6

Vector4fClass · 0.85
getTextureUnitStateMethod · 0.80
getNumMipmapsMethod · 0.80
getWidthMethod · 0.45
getHeightMethod · 0.45
getDepthMethod · 0.45

Tested by

no test coverage detected