source/Irrlicht/COGLES2Texture.cpp
//! Regenerates the mip map levels of the texture.

Regenerates the mip map levels of the texture.
Regenerates the mip map levels of the texture .
void COGLES2Texture::regenerateMipMapLevels(void* mipmapData)
	{
		if ( AutomaticMipmapUpdate || !HasMipMaps )
			return;
		if (( Image->getDimension().Width == 1 ) && ( Image->getDimension().Height == 1 ) )
			return;
		if (!mipmapData)
		{
			glGenerateMipmap(GL_TEXTURE_2D);
			return;
		}
		u32 width = Image->getDimension().Width;
		u32 height = Image->getDimension().Height;
		u32 i = 0;
		u8* target = static_cast<u8*>(mipmapData);
		do
		{
			if ( width > 1 )
				width >>= 1;
			if ( height > 1 )
				height >>= 1;
			++i;
			glTexImage2D(GL_TEXTURE_2D, i, InternalFormat, width, height,
					0, PixelFormat, PixelType, mipmapData);
			if (mipmapData)
			{
				mipmapData = static_cast<u8*>(mipmapData)+width*height*Image->getBytesPerPixel();
				target = static_cast<u8*>(mipmapData);
			}
		}
		while ( width != 1 || height != 1 );
	}
void COGLES2Texture :: regenerateMipMapLevels ( void * mipmapData ) { if ( AutomaticMipmapUpdate || ! HasMipMaps ) return ; if ( ( Image -> getDimension ( ) . Width == 1 ) && ( Image -> getDimension ( ) . Height == 1 ) ) return ; if ( ! mipmapData ) { glGenerateMipmap ( GL_TEXTURE_2D ) ; return ; } u32 width = Image -> getDimension ( ) . Width ; u32 height = Image -> getDimension ( ) . Height ; u32 i = 0 ; u8 * target = static_cast < u8 * > ( mipmapData ) ; do { if ( width > 1 ) width >>= 1 ; if ( height > 1 ) height >>= 1 ; ++ i ; glTexImage2D ( GL_TEXTURE_2D , i , InternalFormat , width , height , 0 , PixelFormat , PixelType , mipmapData ) ; if ( mipmapData ) { mipmapData = static_cast < u8 * > ( mipmapData ) + width * height * Image -> getBytesPerPixel ( ) ; target = static_cast < u8 * > ( mipmapData ) ; } } while ( width != 1 || height != 1 ) ; }
Regenerates the mip map levels of the texture.
Regenerates the mip map levels of the texture .
// Manually create mipmaps
 // get next prepared mipmap data if available
