testcamera: Report device name and SDL camera driver in the window title.

This commit is contained in:
Ryan C. Gordon 2024-06-13 17:05:06 -04:00
parent fa3e22c5da
commit 9d3d893322
No known key found for this signature in database
GPG Key ID: FA148B892AB48044

View File

@ -28,6 +28,7 @@ static SDL_CameraDeviceID back_camera = 0;
int SDL_AppInit(void **appstate, int argc, char *argv[])
{
char window_title[128];
int devcount = 0;
int i;
const char *camera_name = NULL;
@ -143,6 +144,9 @@ int SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_FAILURE;
}
SDL_snprintf(window_title, sizeof (window_title), "testcamera: %s (%s)", SDL_GetCameraDeviceName(camera_id), SDL_GetCurrentCameraDriver());
SDL_SetWindowTitle(window, window_title);
return SDL_APP_CONTINUE;
}