| 310 | } |
| 311 | |
| 312 | void OpenGL3Texture::loadFromFile(const std::string& _filename) |
| 313 | { |
| 314 | destroy(); |
| 315 | |
| 316 | if (mImageLoader) |
| 317 | { |
| 318 | int width = 0; |
| 319 | int height = 0; |
| 320 | PixelFormat format = PixelFormat::Unknow; |
| 321 | |
| 322 | void* data = mImageLoader->loadImage(width, height, format, _filename); |
| 323 | if (data) |
| 324 | { |
| 325 | createManual(width, height, TextureUsage::Static | TextureUsage::Write, format, data); |
| 326 | delete[] (unsigned char*)data; |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | void OpenGL3Texture::saveToFile(const std::string& _filename) |
| 332 | { |