Texture1D::Texture1D():
Texture(GL_TEXTURE_1D),
- ifmt(RGB),
width(0),
allocated(0)
{
if(wd==0)
throw invalid_argument("Texture1D::storage");
- if(MSP_sized_internal_formats)
- fmt = get_sized_pixelformat(fmt);
- require_pixelformat(fmt);
-
- ifmt = fmt;
+ set_internal_format(fmt);
width = wd;
}
return sub_image(level, 0, w, fmt, type, data);
BindRestore _bind(this);
- glTexImage1D(target, level, ifmt, w, 0, fmt, type, data);
+ glTexImage1D(target, level, ifmt, w, 0, get_upload_format(fmt), type, data);
allocated |= 1<<level;
if(gen_mipmap && level==0)
Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
allocate(level);
+ fmt = get_upload_format(fmt);
if(ARB_direct_state_access)
glTextureSubImage1D(id, level, x, wd, fmt, type, data);
else