MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / captureTextRenderer

Method captureTextRenderer

radiantcore/rendersystem/OpenGLRenderSystem.cpp:82–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82ITextRenderer::Ptr OpenGLRenderSystem::captureTextRenderer(IGLFont::Style style, std::size_t size)
83{
84 // Try to find an existing text renderer with this combination
85 auto fontKey = std::make_pair(style, size);
86
87 auto existing = _textRenderers.find(fontKey);
88
89 if (existing == _textRenderers.end())
90 {
91 auto font = GlobalOpenGL().getFont(fontKey.first, fontKey.second);
92 existing = _textRenderers.emplace(fontKey, std::make_shared<TextRenderer>(font)).first;
93 }
94
95 return existing->second;
96}
97
98ShaderPtr OpenGLRenderSystem::capture(const std::string& name, const std::function<OpenGLShaderPtr()>& createShader)
99{

Callers 4

ensureShadersMethod · 0.80
onPreRenderMethod · 0.80
onPreRenderMethod · 0.80
acquireShadersMethod · 0.80

Calls 3

getFontMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected