| 263 | } |
| 264 | |
| 265 | bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL) |
| 266 | { |
| 267 | PROFILE_SCOPE(GFXGLTextureManager_loadTexture); |
| 268 | GFXGLTextureObject *texture = static_cast<GFXGLTextureObject*>(aTexture); |
| 269 | |
| 270 | AssertFatal(texture->getBinding() == GL_TEXTURE_1D || texture->getBinding() == GL_TEXTURE_2D, |
| 271 | "GFXGLTextureManager::_loadTexture(GBitmap) - This method can only be used with 1D/2D textures"); |
| 272 | |
| 273 | if(texture->getBinding() == GL_TEXTURE_3D) |
| 274 | return false; |
| 275 | |
| 276 | // No 24bit formats. |
| 277 | if(pDL->getFormat() == GFXFormatR8G8B8) |
| 278 | pDL->setFormat(GFXFormatR8G8B8A8); |
| 279 | // Bind to edit |
| 280 | PRESERVE_TEXTURE(texture->getBinding()); |
| 281 | glBindTexture(texture->getBinding(), texture->getHandle()); |
| 282 | |
| 283 | texture->mFormat = pDL->getFormat(); |
| 284 | if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8) |
| 285 | _fastTextureLoad(texture, pDL); |
| 286 | else |
| 287 | _slowTextureLoad(texture, pDL); |
| 288 | |
| 289 | if(texture->getMipLevels() != 1) |
| 290 | glGenerateMipmap(texture->getBinding()); |
| 291 | |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds) |
| 296 | { |
no test coverage detected