mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-08 20:38:14 +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:

committed by
Sam Lantinga

parent
2b744c7df3
commit
587384756f
@@ -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)
|
||||||
|
Reference in New Issue
Block a user