| 880 | } |
| 881 | |
| 882 | bool Texture::Update(const Image& image, UInt8 level) |
| 883 | { |
| 884 | #if NAZARA_RENDERER_SAFE |
| 885 | if (!image.IsValid()) |
| 886 | { |
| 887 | NazaraError("Image must be valid"); |
| 888 | return false; |
| 889 | } |
| 890 | |
| 891 | if (image.GetFormat() != m_impl->format) |
| 892 | { |
| 893 | NazaraError("Image format does not match texture format"); |
| 894 | return false; |
| 895 | } |
| 896 | #endif |
| 897 | |
| 898 | const UInt8* pixels = image.GetConstPixels(0, 0, 0, level); |
| 899 | if (!pixels) |
| 900 | { |
| 901 | NazaraError("Failed to access image's pixels"); |
| 902 | return false; |
| 903 | } |
| 904 | |
| 905 | return Update(pixels, image.GetWidth(level), image.GetHeight(level), level); |
| 906 | } |
| 907 | |
| 908 | bool Texture::Update(const Image& image, const Boxui& box, UInt8 level) |
| 909 | { |
no test coverage detected