allocate();
}
+void TextureCube::image(unsigned level, const void *data)
+{
+ const char *pixels = static_cast<const char *>(data);
+ unsigned face_size = size*size*get_pixel_size(storage_fmt);
+ for(unsigned i=0; i<6; ++i)
+ image(static_cast<TextureCubeFace>(i), level, pixels+i*face_size);
+}
+
void TextureCube::image(TextureCubeFace face, unsigned level, const void *data)
{
unsigned lsz = get_level_size(level);
else if(w!=size || h!=size)
throw incompatible_data("TextureCube::image");
- const char *pixels = reinterpret_cast<const char *>(img.get_pixels());
- unsigned face_size = img.get_stride()*size;
- for(unsigned i=0; i<6; ++i)
- image(static_cast<TextureCubeFace>(i), 0, pixels+i*face_size);
+ image(0, img.get_pixels());
}
unsigned TextureCube::get_n_levels() const
return fv+s*sv+t*tv;
}
-uint64_t TextureCube::get_data_size() const
-{
- return id ? size*size*6*get_pixel_size(storage_fmt) : 0;
-}
-
TextureCube::Loader::Loader(TextureCube &t):
DataFile::DerivedObjectLoader<TextureCube, Texture::Loader>(t)