SDL_HINT_MOUSE_DPI_SCALE_CURSORS(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– SDL_HINT_MOUSE_DPI_SCALE_CURSORS πŸ’–

okay bestie, welcome to the SDL3 functions manual, this one's a macro-hint situation and it's literally so useful 🫢


✨ NAME ✨

SDL_HINT_MOUSE_DPI_SCALE_CURSORS β€” a variable that decides whether we scale cursors by the current display scale or not πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_MOUSE_DPI_SCALE_CURSORS "SDL_MOUSE_DPI_SCALE_CURSORS"

like yes, that's the whole thing, she's short and she's iconic 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so this variable can be set to the following values, and there are exactly two, no cap:

  • "0" β€” cursors will not change size based on the display content scale. this is the default, she's the chill one, the low-maintenance queen πŸ™ˆ
  • "1" β€” cursors will automatically match the display content scale (e.g. a 2x sized cursor will be used when the window is on a monitor with 200% scale). this is currently implemented on Windows πŸ”₯
⚠️ and listen, this hint needs to be set before creating cursors. before. like, do it first. the vibe check happens at creation time, so if you roll up late it's not gonna help you bestie 😭

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.4.0 ⭐ so if you're on anything older, sorry babe, she doesn't exist yet πŸ’€


and that's the whole page, mwah πŸ’œ go forth and make those cursors the right size on that 200% monitor, main character energy only πŸ‘‘

Simple Directmedia Layer Β· SDL 3.4.18 β€” tysm for reading, ily, bye bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from