MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / initFromMemory

Method initFromMemory

src/server/gui/core/resources/TextureResource.cpp:65–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void TextureResource::initFromMemory(const char* data, size_t length)
66{
67 // This is only valid if we have a local texture data object
68 assert(mTextureData != nullptr);
69 mTextureData->releaseVRAM();
70 mTextureData->releaseRAM();
71 mTextureData->initImageFromMemory((const unsigned char*)data, length);
72 // Get the size from the texture data
73 mSize = Vector2i((int)mTextureData->width(), (int)mTextureData->height());
74 mSourceSize = Vector2f(mTextureData->sourceWidth(), mTextureData->sourceHeight());
75}
76
77const Vector2i TextureResource::getSize() const
78{

Callers 1

setImageMethod · 0.80

Calls 9

releaseVRAMMethod · 0.80
releaseRAMMethod · 0.80
initImageFromMemoryMethod · 0.80
sourceWidthMethod · 0.80
sourceHeightMethod · 0.80
Vector2iClass · 0.50
Vector2fClass · 0.50
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected