return sub_image(level, 0, 0, w, h, fmt, type, data);
BindRestore _bind(this);
return sub_image(level, 0, 0, w, h, fmt, type, data);
BindRestore _bind(this);
glTexImage2D(target, level, ifmt, w, h, 0, get_upload_format(fmt), type, data);
allocated |= 1<<level;
if(auto_gen_mipmap && level==0)
{
generate_mipmap();
glTexImage2D(target, level, ifmt, w, h, 0, get_upload_format(fmt), type, data);
allocated |= 1<<level;
if(auto_gen_mipmap && level==0)
{
generate_mipmap();
-void Texture2D::image(const Graphics::Image &img, bool srgb, bool from_buffer)
+void Texture2D::image(const Graphics::Image &img, unsigned lv, bool srgb, bool from_buffer)
{
unsigned w = img.get_width();
unsigned h = img.get_height();
PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
{
{
unsigned w = img.get_width();
unsigned h = img.get_height();
PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
{
storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, l);
}
storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, l);
}