-void Texture2D::storage(PixelFormat fmt, sizei wd, sizei ht, int brd)
+void Texture2D::storage(PixelFormat fmt, unsigned wd, unsigned ht, int brd)
{
if(width>0)
throw InvalidState("Texture storage may only be specified once");
if(wd==0 || ht==0)
throw InvalidParameterValue("Invalid texture dimensions");
{
if(width>0)
throw InvalidState("Texture storage may only be specified once");
if(wd==0 || ht==0)
throw InvalidParameterValue("Invalid texture dimensions");
-void Texture2D::image(int level, PixelFormat fmt, GLenum type, const void *data)
+void Texture2D::image(int level, PixelFormat fmt, DataType type, const void *data)
glTexImage2D(target, level, ifmt, width, height, border, fmt, type, data);
}
glTexImage2D(target, level, ifmt, width, height, border, fmt, type, data);
}
-void Texture2D::sub_image(int level, int x, int y, sizei wd, sizei ht, PixelFormat fmt, GLenum type, const void *data)
+void Texture2D::sub_image(int level, int x, int y, unsigned wd, unsigned ht, PixelFormat fmt, DataType type, const void *data)
- unsigned w=img.get_width();
- unsigned h=img.get_height();
- PixelFormat fmt=img.get_format();
+ unsigned w = img.get_width();
+ unsigned h = img.get_height();
+ PixelFormat fmt = pixelformat_from_graphics(img.get_format());
- image(0, fmt, GL_UNSIGNED_BYTE, img.get_data());
+ image(0, fmt, UNSIGNED_BYTE, img.get_data());
- Texture2D &t2d=static_cast<Texture2D &>(tex);;
- t2d.image(0, t2d.ifmt, GL_UNSIGNED_BYTE, data.data());
+ Texture2D &t2d = static_cast<Texture2D &>(obj);
+ t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data());
}
void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned b)
{
}
void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned b)
{
- static_cast<Texture2D &>(tex).storage(fmt, w, h, b);
+ static_cast<Texture2D &>(obj).storage(fmt, w, h, b);