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

Function ClearTexture

engine/render/src/render/font/fontmap.cpp:131–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 static void ClearTexture(HFontMap font_map, uint32_t width, uint32_t height)
132 {
133 dmGraphics::TextureParams tex_params;
134 tex_params.m_Format = font_map->m_CacheFormat;
135 tex_params.m_Width = width;
136 tex_params.m_Height = height;
137 tex_params.m_Depth = 1;
138 tex_params.m_MinFilter = dmGraphics::TEXTURE_FILTER_LINEAR;
139 tex_params.m_MagFilter = dmGraphics::TEXTURE_FILTER_LINEAR;
140
141 tex_params.m_DataSize = width * height * font_map->m_CacheChannels;
142 tex_params.m_Data = malloc(tex_params.m_DataSize);
143 memset((void*)tex_params.m_Data, 0, tex_params.m_DataSize);
144
145 dmGraphics::SetTexture(font_map->m_GraphicsContext, font_map->m_Texture, tex_params);
146
147 free((void*)tex_params.m_Data);
148 }
149
150 static void RecreateTexture(HFontMap font_map, dmGraphics::HContext graphics_context, uint32_t width, uint32_t height)
151 {

Callers 2

RecreateTextureFunction · 0.85
ResetCacheFunction · 0.85

Calls 3

mallocFunction · 0.85
freeFunction · 0.85
SetTextureFunction · 0.50

Tested by

no test coverage detected