瀏覽代碼

Added debug output for display connect/disconnect events

Sam Lantinga 3 年之前
父節點
當前提交
a3c05d2f34
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/test/SDL_test_common.c

+ 8 - 0
src/test/SDL_test_common.c

@@ -1473,10 +1473,18 @@ SDLTest_PrintEvent(SDL_Event * event)
     switch (event->type) {
     switch (event->type) {
     case SDL_DISPLAYEVENT:
     case SDL_DISPLAYEVENT:
         switch (event->display.event) {
         switch (event->display.event) {
+        case SDL_DISPLAYEVENT_CONNECTED:
+            SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " connected",
+                    event->display.display);
+            break;
         case SDL_DISPLAYEVENT_ORIENTATION:
         case SDL_DISPLAYEVENT_ORIENTATION:
             SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed orientation to %s",
             SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed orientation to %s",
                     event->display.display, DisplayOrientationName(event->display.data1));
                     event->display.display, DisplayOrientationName(event->display.data1));
             break;
             break;
+        case SDL_DISPLAYEVENT_DISCONNECTED:
+            SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " disconnected",
+                    event->display.display);
+            break;
         default:
         default:
             SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " got unknown event 0x%4.4x",
             SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " got unknown event 0x%4.4x",
                     event->display.display, event->display.event);
                     event->display.display, event->display.event);