Browse Source

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

Ryan C. Gordon 10 months ago
parent
commit
9d3d893322
1 changed files with 4 additions and 0 deletions
  1. 4 0
      test/testcamera.c

+ 4 - 0
test/testcamera.c

@@ -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;
 }