| 317 | } |
| 318 | |
| 319 | void OpenGLTexture::loadFromFile(const std::string& _filename) |
| 320 | { |
| 321 | destroy(); |
| 322 | |
| 323 | if (mImageLoader) |
| 324 | { |
| 325 | int width = 0; |
| 326 | int height = 0; |
| 327 | PixelFormat format = PixelFormat::Unknow; |
| 328 | |
| 329 | void* data = mImageLoader->loadImage(width, height, format, _filename); |
| 330 | if (data) |
| 331 | { |
| 332 | createManual(width, height, TextureUsage::Static | TextureUsage::Write, format, data); |
| 333 | delete[] (unsigned char*)data; |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | void OpenGLTexture::saveToFile(const std::string& _filename) |
| 339 | { |