MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Init

Method Init

Source/Engine/Render2D/FontTextureAtlas.cpp:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void FontTextureAtlas::Init(uint32 width, uint32 height)
35{
36 // Setup
37 _width = width;
38 _height = height;
39 const uint32 padding = GetPaddingAmount() * 2; // Double the padding so each slot has own border around it
40 _atlas.Init(_width, _height, padding);
41 _isDirty = false;
42
43 // Reserve upload data memory
44 _data.Resize(_width * _height * _bytesPerPixel, false);
45 Platform::MemoryClear(_data.Get(), _data.Capacity());
46}
47
48FontTextureAtlasSlot* FontTextureAtlas::AddEntry(uint32 width, uint32 height, const Array<byte>& data)
49{

Callers 1

EnsureTextureCreatedMethod · 0.45

Calls 4

MemoryClearFunction · 0.85
ResizeMethod · 0.45
GetMethod · 0.45
CapacityMethod · 0.45

Tested by

no test coverage detected