From 45f705a5e590c3dfddc0a544e66beb9bf6205a4d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 12:53:22 -0300 Subject: sketchbook: text rasterized at one scale and drawn at another (f.textScaled), steady under a moving camera --- vendor/text.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vendor/text.h') diff --git a/vendor/text.h b/vendor/text.h index 9611cb1..a421961 100644 --- a/vendor/text.h +++ b/vendor/text.h @@ -16,5 +16,11 @@ bool sk_text_draw_face(SDL_Renderer *, int face, float x, float y, float scale, const char *utf8, size_t len, Uint8 r, Uint8 g, Uint8 b, Uint8 a); bool sk_text_measure_face(SDL_Renderer *, int face, float scale, const char *utf8, size_t len, float *width, float *height); +/* The same, laid out and rasterized at `raster` and drawn at `scale`: the + glyphs keep their places against each other while the size changes (a + camera moving), and one texture serves every size on the way. Its + position is not snapped to a pixel. */ +bool sk_text_draw_scaled(SDL_Renderer *, int face, float x, float y, float scale, float raster, + const char *utf8, size_t len, Uint8 r, Uint8 g, Uint8 b, Uint8 a); void sk_text_begin_frame(SDL_Renderer *); #endif -- cgit v1.3