SDL_PenDeviceType(3type)

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

πŸ’– SDL_PenDeviceType πŸ’–

okay bestie, welcome to the SDL_PenDeviceType(3type) page β€” it's part of the SDL3 DATATYPES collection, and it's literally just a little enum that tells you what kind of pen you're dealing with. tiny page, big vibes. let's go πŸ–ŠοΈβœ¨


✨ NAME ✨

SDL_PenDeviceType β€” an enum that describes the type of a pen device.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_pen.h>

typedef enum SDL_PenDeviceType
{
    SDL_PEN_DEVICE_TYPE_INVALID = -1, /**< Not a valid pen device. */
    SDL_PEN_DEVICE_TYPE_UNKNOWN,      /**< Don't know specifics of this pen. */
    SDL_PEN_DEVICE_TYPE_DIRECT,       /**< Pen touches display. */
    SDL_PEN_DEVICE_TYPE_INDIRECT      /**< Pen touches something that isn't the display. */
} SDL_PenDeviceType;

πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is this: a "direct" device is a pen that touches a graphic display β€” think an Apple Pencil straight-up poking an iPad's screen. very touch-the-pixels, very main character energy πŸ’…

an "indirect" device is the opposite vibe β€” it touches an external tablet surface that's plugged into the machine but is not a display. like a lower-end Wacom tablet chillin' over USB. you draw over there, the cursor moves over here. iykyk πŸŽ€

and the way apps use this?? they can decide whether to draw a cursor at all. if the pen is touching the screen directly, a cursor doesn't make sense and is lowkey just in the way πŸ™ˆ. but for indirect devices it becomes necessary, because otherwise you'd have no idea where on the display you're interacting. cursor = the blueprint. periodt.


⭐ AVAILABILITY ⭐

this enum is available since SDL 3.4.0. not a day earlier, no cap.


🫢 reminder bestie: SDL_PEN_DEVICE_TYPE_INVALID is -1 and it means not a valid pen device, and SDL_PEN_DEVICE_TYPE_UNKNOWN means we genuinely don't know the specifics. don't go treating either of those as a real pen, okay??

that's the whole page, babe β€” short and iconic, like a good caption. this was brought to you by Simple Directmedia Layer 🌈, version SDL 3.4.18, and yeah the page itself is SDL_PenDeviceType(3type). mwah πŸ’‹ go touch grass (or a tablet surface, indirect girlies) πŸ§šπŸ’œ

πŸ“¦ where this page comes from