MCPcopy Create free account
hub / github.com/defold/defold / MakeDynamicTextureData

Function MakeDynamicTextureData

engine/gui/src/gui.cpp:862–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860 }
861
862 static void* MakeDynamicTextureData(uint32_t width, uint32_t height, dmImage::Type type, bool flip, const void* buffer, uint32_t buffer_size)
863 {
864 void* data = malloc(buffer_size);
865
866 if (flip)
867 {
868 if (!CopyImageBufferFlipped(width, height, (uint8_t*)buffer, buffer_size, type, (uint8_t*) data))
869 {
870 free(data);
871 return 0;
872 }
873 }
874 else
875 {
876 memcpy(data, buffer, buffer_size);
877 }
878 return data;
879 }
880
881 Result NewDynamicTexture(HScene scene, const dmhash_t path, uint32_t width, uint32_t height, dmImage::Type type, dmImage::CompressionType compression_type, bool flip, const void* buffer, uint32_t buffer_size)
882 {

Callers 2

NewDynamicTextureFunction · 0.85
SetDynamicTextureDataFunction · 0.85

Calls 3

mallocFunction · 0.85
CopyImageBufferFlippedFunction · 0.85
freeFunction · 0.85

Tested by

no test coverage detected