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

Function ConvertMinTextureFilter

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

Font maps have no mips, so we need to make sure we use a supported min filter

Source from the content-addressed store, hash-verified

65
66 // Font maps have no mips, so we need to make sure we use a supported min filter
67 static dmGraphics::TextureFilter ConvertMinTextureFilter(dmGraphics::TextureFilter filter)
68 {
69 if (filter == dmGraphics::TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST)
70 {
71 filter = dmGraphics::TEXTURE_FILTER_NEAREST;
72 }
73 else if (filter == dmGraphics::TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST)
74 {
75 filter = dmGraphics::TEXTURE_FILTER_LINEAR;
76 }
77
78 return filter;
79 }
80
81 static void SetupCache(HFontMap font_map, uint32_t texture_width, uint32_t texture_height,
82 uint32_t cell_width, uint32_t cell_height, uint32_t max_ascent)

Callers 1

SetFontMapFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected