SDL icon indicating copy to clipboard operation
SDL copied to clipboard

`SDL_EVENT_RENDER_*` events should probably tell which rendered it applies to

Open Susko3 opened this issue 1 year ago • 2 comments

The events:

  • SDL_EVENT_RENDER_TARGETS_RESET
  • SDL_EVENT_RENDER_DEVICE_RESET
  • SDL_EVENT_RENDER_DEVICE_LOST

don't have any data associated with them (except SDL_CommonEvent data).

Since these events apply to a renderer, and an application can create multiple renderers, the events should mention which renderer they apply to.

Susko3 avatar Nov 14 '24 21:11 Susko3

Can we stick a pointer into an event now? Everything else that isn't a const char * takes an instance ID...

/**
 * Renderer event structure (event.render.*)
 *
 * \since This struct is available since SDL 3.1.7.
 */
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_Renderer *renderer;      /**< the renderer added changing */
} SDL_RenderEvent;

icculus avatar Nov 15 '24 03:11 icculus

No, we should use the associated window.

slouken avatar Nov 15 '24 03:11 slouken