void TextureBuffer::processPostDeactivate(DrawEnv *pEnv) { Window *win = pEnv->getWindow(); // If there are TextureBuffers with mipmap filters attached, // the mipmaps need to be regenerated TextureObjChunk *pTexObj = this->getTexture(); if(pTexObj == NULL) return; GLenum target = pTexObj->determineTextureTarget(win); if(target == GL_TEXTURE_2D && (pTexObj->getMinFilter() == GL_NEAREST_MIPMAP_NEAREST || pTexObj->getMinFilter() == GL_LINEAR_MIPMAP_NEAREST || pTexObj->getMinFilter() == GL_NEAREST_MIPMAP_LINEAR || pTexObj->getMinFilter() == GL_LINEAR_MIPMAP_LINEAR ) ) { OSGGETGLFUNC( OSGglGenerateMipmapProc, osgGlGenerateMipmapProc, _uiFuncGenerateMipmap ); glBindTexture(target, win->getGLObjectId(pTexObj->getGLId())); osgGlGenerateMipmapProc(target); } }