- unsigned w = image.get_width();
- unsigned h = image.get_height();
- texture.storage(pixelformat_from_image(image, texture.use_srgb_format), w, h);
- texture.OpenGLTexture2D::sub_image(0, 0, 0, w, h, pixel_buffer, 0);
+ if(img_loader)
+ {
+ unsigned w = image.get_width();
+ unsigned h = image.get_height();
+ texture.storage(pixelformat_from_image(image, texture.use_srgb_format), w, h);
+ }
+ texture.OpenGLTexture2D::sub_image(0, 0, 0, texture.width, texture.height, pixel_buffer, 0);