SDL_CameraDeviceEvent(3type)
π SDL_CameraDeviceEvent π
okay bestie, we're in the SDL3 datatypes era and today's main character is SDL_CameraDeviceEvent, from SDL_CameraDeviceEvent(3type). it's the camera device event structure, and you'll catch it living its life under event.cdevice.*. π
β¨ NAME β¨
SDL_CameraDeviceEvent β the camera device event structure, aka event.cdevice.* π₯β¨
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_events.h>
typedef struct SDL_CameraDeviceEvent
{
SDL_EventType type; /**< SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_CameraID which; /**< SDL_CameraID for the device being added or removed or changing */
} SDL_CameraDeviceEvent;
π¦ DESCRIPTION π¦
so basically this is the struct you get handed when the camera situation changes, and you need to know about it. it's giving "the group chat has an update" energy, except the group chat is SDL and the update is a camera. π
let's break down the members, because every single one matters:
typeβ anSDL_EventType, and it's gonna be one of these four icons:SDL_EVENT_CAMERA_DEVICE_ADDED,SDL_EVENT_CAMERA_DEVICE_REMOVED,SDL_EVENT_CAMERA_DEVICE_APPROVED, orSDL_EVENT_CAMERA_DEVICE_DENIED. which one you got tells you the whole vibe of the situation. πreservedβ aUint32. it's just sitting there. hands off, bestie, it's not for you. πtimestampβ aUint64, measured in nanoseconds, and it's populated usingSDL_GetTicksNS(). so when did this happen? it tells you, in the tiniest units of time known to girlkind. β±οΈβ¨whichβ anSDL_CameraIDfor the device that's being added, or removed, or changing. this is the "who is this about" field, and it's never not important. π₯
β AVAILABILITY β
this struct has been around since SDL 3.2.0. so if you're on anything older, sorry babe, it's not there yet. π
and that's the whole page, no notes. mwah. π«Ά
this little love letter to cameras came to you from the good people of Simple Directmedia Layer, and it's serving SDL 3.4.18. go forth and handle your events, queen. πππ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms