SDL_RenderEvent(3type)

✨ SDL_RenderEvent ✨

okay bestie, welcome to the SDL_RenderEvent page πŸ’– this is one of the SDL3 datatype pages (the manual calls the whole collection SDL3 DATATYPES, iykyk), and we're about to get into the renderer event struct. it's giving "short and sweet" fr fr β€” no cap, this one's a quick read πŸŽ€


🌸 NAME 🌸

SDL_RenderEvent β€” the Renderer event structure, aka the whole event.render.* family πŸ¦‹

like, when your renderer is going THROUGH it, this is the struct that shows up to tell you πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta pull in the header:

#include <SDL3/SDL_events.h>

and here's the struct itself, verbatim, don't touch a single character:

typedef struct SDL_RenderEvent
{
    SDL_EventType type; /**< SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST */
    Uint32 reserved;
    Uint64 timestamp;   /**< In nanoseconds, populated using SDL_GetTicksNS() */
    SDL_WindowID windowID; /**< The window containing the renderer in question. */
} SDL_RenderEvent;

let's break down the members, because every single one of them matters πŸ‘‘

  • type β€” the event type, and it's lowkey a pick-your-fighter situation. it's one of SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, or SDL_EVENT_RENDER_DEVICE_LOST. so like, targets got reset, or the device got reset, or β€” and this is the dramatic one β€” the device got lost 😭. it's an SDL_EventType, obviously πŸ’…
  • reserved β€” a Uint32 just vibing there. it's reserved, bestie. do not touch it, do not look at it, do not make it your main character. hands off πŸ™ˆ
  • timestamp β€” a Uint64 measured in nanoseconds, and it gets populated using SDL_GetTicksNS(). so when this event happened? the struct knows. down to the nanosecond. iconic precision fr ⏱️
  • windowID β€” an SDL_WindowID that tells you the window containing the renderer in question. which renderer? the one in question. that one. the one we're talking about πŸͺŸ

🌈 AVAILABILITY 🌈

this struct has been available since SDL 3.2.0 β€” so if you're on something older than that, sorry babe, it's not there yet 🫢


ngl this page is short, so there's no SEE ALSO, no OPTIONS, no EXIT STATUS, none of that. just the struct, the vibes, and you. and honestly? slay πŸ’…

and that's the whole thing, bestie! this was the SDL_RenderEvent(3type) page, coming to you from Simple Directmedia Layer, SDL 3.4.18, dated right along with it πŸŽ€ go forth and handle those renderer events, you absolute legend πŸ‘‘βœ¨

πŸ“¦ where this page comes from