summaryrefslogtreecommitdiff
path: root/vendor/text.h
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 12:53:22 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:22:02 -0300
commit45f705a5e590c3dfddc0a544e66beb9bf6205a4d (patch)
treec98d19a1b2dfc4808a46b41cf1b931703ff467b1 /vendor/text.h
parentf8d3a32f4f995eeb7e162b0702998b0565c11e4e (diff)
downloadsketchbook-45f705a5e590c3dfddc0a544e66beb9bf6205a4d.tar.gz
sketchbook-45f705a5e590c3dfddc0a544e66beb9bf6205a4d.zip
sketchbook: text rasterized at one scale and drawn at another (f.textScaled), steady under a moving camera
Diffstat (limited to 'vendor/text.h')
-rw-r--r--vendor/text.h6
1 files changed, 6 insertions, 0 deletions
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