MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / Update

Method Update

src/Nazara/Renderer/Texture.cpp:882–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

CopyToImageMethod · 0.45

Calls 7

SetUnpackAlignementFunction · 0.85
GetConstPixelsMethod · 0.80
GetLevelSizeFunction · 0.70
IsValidMethod · 0.45
GetFormatMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected