void GLTexture::loadImpl() { if( mUsage & TU_RENDERTARGET ) { createRenderTexture(); return; } // Now the only copy is on the stack and will be cleaned in case of // exceptions being thrown from _loadImages LoadedImages loadedImages = mLoadedImages; mLoadedImages.setNull(); // Call internal _loadImages, not loadImage since that's external and // will determine load status etc again ConstImagePtrList imagePtrs; for (size_t i=0 ; i<loadedImages->size() ; ++i) { imagePtrs.push_back(&(*loadedImages)[i]); } _loadImages(imagePtrs); // Generate mipmaps after all texture levels have been loaded // This is required for compressed formats such as DXT // If we can do automip generation and the user desires this, do so if((mUsage & TU_AUTOMIPMAP) && mNumRequestedMipmaps && mMipmapsHardwareGenerated) { glGenerateMipmapEXT(getGLTextureTarget()); } }
void GLES2Texture::loadImpl() { if (mUsage & TU_RENDERTARGET) { createRenderTexture(); return; } // Now the only copy is on the stack and will be cleaned in case of // exceptions being thrown from _loadImages LoadedImages loadedImages = mLoadedImages; mLoadedImages.setNull(); // Call internal _loadImages, not loadImage since that's external and // will determine load status etc again ConstImagePtrList imagePtrs; for (size_t i = 0; i < loadedImages->size(); ++i) { imagePtrs.push_back(&(*loadedImages)[i]); } _loadImages(imagePtrs); if((mUsage & TU_AUTOMIPMAP) && mNumRequestedMipmaps && mMipmapsHardwareGenerated) { OGRE_CHECK_GL_ERROR(glGenerateMipmap(getGLES2TextureTarget())); } }
void GL3PlusTexture::loadImpl() { if (mUsage & TU_RENDERTARGET) { createRenderTexture(); return; } // Now the only copy is on the stack and will be cleaned in case of // exceptions being thrown from _loadImages LoadedImages loadedImages = mLoadedImages; mLoadedImages.setNull(); // Call internal _loadImages, not loadImage since that's external and // will determine load status etc again ConstImagePtrList imagePtrs; for (size_t i = 0; i < loadedImages->size(); ++i) { imagePtrs.push_back(&(*loadedImages)[i]); } _loadImages(imagePtrs); // Generate mipmaps after all texture levels have been loaded // This is required for compressed formats such as DXT if (mUsage & TU_AUTOMIPMAP) { OGRE_CHECK_GL_ERROR(glGenerateMipmap(getGL3PlusTextureTarget())); } }
void GLTexture::loadImpl() { if( mUsage & TU_RENDERTARGET ) { createRenderTexture(); return; } // Now the only copy is on the stack and will be cleaned in case of // exceptions being thrown from _loadImages LoadedImages loadedImages = mLoadedImages; mLoadedImages.setNull(); // Call internal _loadImages, not loadImage since that's external and // will determine load status etc again ConstImagePtrList imagePtrs; for (size_t i=0 ; i<loadedImages->size() ; ++i) { imagePtrs.push_back(&(*loadedImages)[i]); } _loadImages(imagePtrs); }