mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 18:28:28 +00:00
render: use nearest pixel scaling for debug text
The debug text font is less legible when scaled linearly.
This commit is contained in:
parent
2b744c7df3
commit
587384756f
1 changed files with 6 additions and 2 deletions
|
@ -5406,10 +5406,14 @@ static bool CreateDebugTextAtlas(SDL_Renderer *renderer)
|
||||||
SDL_assert((row < rows) || ((row == rows) && (column == 0))); // make sure we didn't overflow the surface.
|
SDL_assert((row < rows) || ((row == rows) && (column == 0))); // make sure we didn't overflow the surface.
|
||||||
|
|
||||||
// Convert temp surface into texture
|
// Convert temp surface into texture
|
||||||
renderer->debug_char_texture_atlas = SDL_CreateTextureFromSurface(renderer, atlas);
|
SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, atlas);
|
||||||
|
if (texture) {
|
||||||
|
SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST);
|
||||||
|
renderer->debug_char_texture_atlas = texture;
|
||||||
|
}
|
||||||
SDL_DestroySurface(atlas);
|
SDL_DestroySurface(atlas);
|
||||||
|
|
||||||
return (renderer->debug_char_texture_atlas != NULL);
|
return texture != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool DrawDebugCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
|
static bool DrawDebugCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue