mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 15:40:02 +00:00
OGL: Scale OSD text on big screens.
This commit is contained in:
parent
d4449971c9
commit
a5c0739fab
@ -157,6 +157,7 @@ RasterFont::RasterFont()
|
||||
}
|
||||
}
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHARACTER_WIDTH * CHARACTER_COUNT, CHARACTER_HEIGHT, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user