| 80 | } |
| 81 | |
| 82 | ITextRenderer::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 | |
| 98 | ShaderPtr OpenGLRenderSystem::capture(const std::string& name, const std::function<OpenGLShaderPtr()>& createShader) |
| 99 | { |
no test coverage detected