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

Function RecreateTexture

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

Source from the content-addressed store, hash-verified

148 }
149
150 static void RecreateTexture(HFontMap font_map, dmGraphics::HContext graphics_context, uint32_t width, uint32_t height)
151 {
152 // create new texture to be used as a cache
153 dmGraphics::TextureCreationParams tex_create_params;
154 tex_create_params.m_Width = width;
155 tex_create_params.m_Height = height;
156 tex_create_params.m_OriginalWidth = width;
157 tex_create_params.m_OriginalHeight = height;
158
159 if (font_map->m_Texture)
160 {
161 dmGraphics::DeleteTexture(graphics_context, font_map->m_Texture);
162 }
163 font_map->m_Texture = dmGraphics::NewTexture(graphics_context, tex_create_params);
164
165 ClearTexture(font_map, width, height);
166 }
167
168 /**
169 * Update the font map with the specified parameters. The parameters are consumed and should not be read after this call.

Callers 2

SetFontMapFunction · 0.85
ResetCacheFunction · 0.85

Calls 3

DeleteTextureFunction · 0.85
NewTextureFunction · 0.85
ClearTextureFunction · 0.85

Tested by

no test coverage detected