- glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pixel_buffer.get_id());
- texture.image(image, 0, true);
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+
+ unsigned w = image.get_width();
+ unsigned h = image.get_height();
+ texture.storage(pixelformat_from_image(image, texture.use_srgb_format), w, h);
+ texture.sub_image(0, 0, 0, w, h, pixel_buffer, 0);
+