width(0),
height(0)
{
- target=GL_TEXTURE_2D;
+ target = GL_TEXTURE_2D;
bind();
}
if(wd==0 || ht==0)
throw InvalidParameterValue("Invalid texture dimensions");
- ifmt=fmt;
- width=wd;
- height=ht;
- border=brd;
+ ifmt = fmt;
+ width = wd;
+ height = ht;
+ border = brd;
}
void Texture2D::image(int level, PixelFormat fmt, DataType type, const void *data)
void Texture2D::image(const Graphics::Image &img)
{
- unsigned w=img.get_width();
- unsigned h=img.get_height();
- PixelFormat fmt=pixelformat_from_graphics(img.get_format());
+ unsigned w = img.get_width();
+ unsigned h = img.get_height();
+ PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
storage(fmt, w, h, 0);
else if(w!=width || h!=height)
void Texture2D::Loader::raw_data(const string &data)
{
- Texture2D &t2d=static_cast<Texture2D &>(obj);
+ Texture2D &t2d = static_cast<Texture2D &>(obj);
t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data());
}