OGL: Scale OSD text on big screens.

This commit is contained in:
degasus
2018-03-12 00:34:46 +01:00
committed by Markus Wick
parent d4449971c9
commit a5c0739fab
2 changed files with 12 additions and 4 deletions

View File

@ -851,10 +851,17 @@ Renderer::CreateFramebuffer(const AbstractTexture* color_attachment,
void Renderer::RenderText(const std::string& text, int left, int top, u32 color)
{
s_raster_font->printMultilineText(text,
left * 2.0f / static_cast<float>(m_backbuffer_width) - 1.0f,
1.0f - top * 2.0f / static_cast<float>(m_backbuffer_height), 0,
m_backbuffer_width, m_backbuffer_height, color);
int screen_width = m_backbuffer_width;
int screen_height = m_backbuffer_height;
if (screen_width >= 2000)
{
screen_width /= 2;
screen_height /= 2;
}
s_raster_font->printMultilineText(text, left * 2.0f / static_cast<float>(screen_width) - 1.0f,
1.0f - top * 2.0f / static_cast<float>(screen_height), 0,
screen_width, screen_height, color);
}
std::unique_ptr<AbstractShader> Renderer::CreateShaderFromSource(ShaderStage stage,