82 HydraxLOG(
"Error in TextureManager::_updateNormalMap, create() does not called.");
89 HydraxLOG(
"Error in TextureManager::_updateNormalMap, Image type isn't correct.");
98 if (Texture->getWidth() != ImageSize.
Width ||
99 Texture->getHeight() != ImageSize.
Height)
106 Ogre::HardwarePixelBufferSharedPtr pixelBuffer = Texture->getBuffer();
108 pixelBuffer->lock(Ogre::HardwareBuffer::HBL_NORMAL);
109 const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock();
111 Ogre::uint8* pDest =
static_cast<Ogre::uint8*
>(pixelBox.data);
115 for (
x = 0;
x < ImageSize.
Width;
x++)
126 pixelBuffer->unlock();
135 Ogre::TextureManager::getSingleton().remove(Name);
137 Texture = Ogre::TextureManager::getSingleton().
139 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
144 Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
148 catch (Ogre::Exception &e)
Ogre::TexturePtr mTextures[1]
Our Ogre::TexturePtr array.
Ogre::String mTextureNames[1]
Our Ogre::String array for store texture's names.
void create(const Size &Size)
Create height and normal map textures.
bool _createTexture(Ogre::TexturePtr &Texture, const Ogre::String &Name, const Size &Size)
Create an Ogre::Texture.
const Ogre::String & getTextureName(const TexturesID &Id) const
Get texture's name.
Ogre::TexturePtr & getTexture(const TexturesID &Id)
Get texture.
bool mCreated
Have been created already called?
TextureManager(Hydrax *h)
Constructor.
bool _updateNormalMap(Image &Image)
Update normal map.