| 291 | } |
| 292 | |
| 293 | void OpenGLESTexture::loadFromFile(const std::string& _filename) |
| 294 | { |
| 295 | destroy(); |
| 296 | |
| 297 | if (mImageLoader) |
| 298 | { |
| 299 | int width = 0; |
| 300 | int height = 0; |
| 301 | PixelFormat format = PixelFormat::Unknow; |
| 302 | |
| 303 | void* data = mImageLoader->loadImage(width, height, format, _filename); |
| 304 | if (data) |
| 305 | { |
| 306 | createManual(width, height, TextureUsage::Static | TextureUsage::Write, format, data); |
| 307 | delete (unsigned char*)data; |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | void OpenGLESTexture::saveToFile(const std::string& _filename) |
| 313 | { |