30 "[--video driver] [--renderer driver] [--gldebug] [--info all|video|modes|render|event] [--log all|error|system|audio|video|render|input] [--display N] [--fullscreen | --fullscreen-desktop | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--min-geometry WxH] [--max-geometry WxH] [--logical WxH] [--scale N] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--allow-highdpi]"
33 "[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]"
54 for (i = 1; argv[
i]; ++
i) {
108 char **argv = state->
argv;
263 while (*y && *y !=
',') {
282 while (*h && *h !=
'x') {
301 while (*h && *h !=
'x') {
320 while (*h && *h !=
'x') {
339 while (*h && *h !=
'x') {
470 if (
SDL_strcmp(argv[index],
"-NSDocumentRevisionsDebugMode") == 0) {
488 return "[--trackmem]";
631 for (i = 0; i <
sizeof(info->
flags) * 8; ++
i) {
633 if (info->
flags & flag) {
654 SDL_Log(
" Max Texture Size: %dx%d\n",
684 const int DRAGGABLE_TITLE = 32;
690 if (area->
x < RESIZE_BORDER) {
691 if (area->
y < RESIZE_BORDER) {
692 SDL_Log(
"SDL_HITTEST_RESIZE_TOPLEFT\n");
694 }
else if (area->
y >= (h-RESIZE_BORDER)) {
695 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOMLEFT\n");
698 SDL_Log(
"SDL_HITTEST_RESIZE_LEFT\n");
701 }
else if (area->
x >= (w-RESIZE_BORDER)) {
702 if (area->
y < RESIZE_BORDER) {
703 SDL_Log(
"SDL_HITTEST_RESIZE_TOPRIGHT\n");
705 }
else if (area->
y >= (h-RESIZE_BORDER)) {
706 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOMRIGHT\n");
709 SDL_Log(
"SDL_HITTEST_RESIZE_RIGHT\n");
712 }
else if (area->
y >= (h-RESIZE_BORDER)) {
713 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOM\n");
715 }
else if (area->
y < RESIZE_BORDER) {
716 SDL_Log(
"SDL_HITTEST_RESIZE_TOP\n");
718 }
else if (area->
y < DRAGGABLE_TITLE) {
719 SDL_Log(
"SDL_HITTEST_DRAGGABLE\n");
736 SDL_Log(
"No built-in video drivers\n");
738 SDL_snprintf(text,
sizeof(text),
"Built-in video drivers:");
739 for (i = 0; i <
n; ++
i) {
749 SDL_Log(
"Couldn't initialize video driver: %s\n",
796 Uint32 Rmask, Gmask, Bmask, Amask;
797 #if SDL_VIDEO_DRIVER_WINDOWS
798 int adapterIndex = 0;
802 SDL_Log(
"Number of displays: %d\n", n);
803 for (i = 0; i <
n; ++
i) {
814 SDL_Log(
"Bounds: %dx%d at %d,%d\n", bounds.
w, bounds.
h, bounds.
x, bounds.
y);
815 SDL_Log(
"Usable bounds: %dx%d at %d,%d\n", usablebounds.
w, usablebounds.
h, usablebounds.
x, usablebounds.
y);
816 SDL_Log(
"DPI: %fx%f\n", hdpi, vdpi);
821 SDL_Log(
" Current mode: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
824 if (Rmask || Gmask || Bmask) {
825 SDL_Log(
" Red Mask = 0x%.8x\n", Rmask);
826 SDL_Log(
" Green Mask = 0x%.8x\n", Gmask);
827 SDL_Log(
" Blue Mask = 0x%.8x\n", Bmask);
829 SDL_Log(
" Alpha Mask = 0x%.8x\n", Amask);
835 SDL_Log(
"No available fullscreen video modes\n");
837 SDL_Log(
" Fullscreen video modes:\n");
838 for (j = 0; j <
m; ++
j) {
841 &Gmask, &Bmask, &Amask);
842 SDL_Log(
" Mode %d: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
845 if (Rmask || Gmask || Bmask) {
846 SDL_Log(
" Red Mask = 0x%.8x\n",
848 SDL_Log(
" Green Mask = 0x%.8x\n",
850 SDL_Log(
" Blue Mask = 0x%.8x\n",
853 SDL_Log(
" Alpha Mask = 0x%.8x\n",
859 #if SDL_VIDEO_DRIVER_WINDOWS
862 SDL_Log(
"D3D9 Adapter Index: %d", adapterIndex);
866 SDL_Log(
"DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex);
876 SDL_Log(
"No built-in render drivers\n");
878 SDL_Log(
"Built-in render drivers:\n");
879 for (i = 0; i <
n; ++
i) {
887 switch (state->
depth) {
933 SDL_Log(
"Couldn't create window: %s\n",
946 printf(
"Window requested size %dx%d, got %dx%d\n", state->
window_w, state->
window_h, w, h);
951 SDL_Log(
"Can't set up fullscreen display mode: %s\n",
979 for (j = 0; j <
n; ++
j) {
988 SDL_Log(
"Couldn't find render driver named %s",
996 SDL_Log(
"Couldn't create renderer: %s\n",
1002 }
else if (state->
scale) {
1008 SDL_Log(
"Current renderer:\n");
1020 SDL_Log(
"No built-in audio drivers\n");
1022 SDL_snprintf(text,
sizeof(text),
"Built-in audio drivers:");
1023 for (i = 0; i <
n; ++
i) {
1033 SDL_Log(
"Couldn't initialize audio driver: %s\n",
1054 switch (orientation)
1056 #define CASE(X) case SDL_ORIENTATION_##X: return #X
1059 CASE(LANDSCAPE_FLIPPED);
1061 CASE(PORTRAIT_FLIPPED);
1063 default:
return "???";
1072 #define AXIS_CASE(ax) case SDL_CONTROLLER_AXIS_##ax: return #ax
1081 default:
return "???";
1090 #define BUTTON_CASE(btn) case SDL_CONTROLLER_BUTTON_##btn: return #btn
1108 default:
return "???";
1120 switch (event->
type) {
1127 SDL_Log(
"SDL EVENT: Display %d got unknown event 0x%4.4x",
1144 SDL_Log(
"SDL EVENT: Window %d moved to %d,%d",
1149 SDL_Log(
"SDL EVENT: Window %d resized to %dx%d",
1154 SDL_Log(
"SDL EVENT: Window %d changed size to %dx%d",
1168 SDL_Log(
"SDL EVENT: Mouse entered window %d",
1175 SDL_Log(
"SDL EVENT: Window %d gained keyboard focus",
1179 SDL_Log(
"SDL EVENT: Window %d lost keyboard focus",
1192 SDL_Log(
"SDL EVENT: Window %d got unknown event 0x%4.4x",
1198 SDL_Log(
"SDL EVENT: Keyboard: key pressed in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
1205 SDL_Log(
"SDL EVENT: Keyboard: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
1212 SDL_Log(
"SDL EVENT: Keyboard: text editing \"%s\" in window %d",
1216 SDL_Log(
"SDL EVENT: Keyboard: text input \"%s\" in window %d",
1220 SDL_Log(
"SDL EVENT: Keymap changed");
1223 SDL_Log(
"SDL EVENT: Mouse: moved to %d,%d (%d,%d) in window %d",
1229 SDL_Log(
"SDL EVENT: Mouse: button %d pressed at %d,%d with click count %d in window %d",
1234 SDL_Log(
"SDL EVENT: Mouse: button %d released at %d,%d with click count %d in window %d",
1239 SDL_Log(
"SDL EVENT: Mouse: wheel scrolled %d in x and %d in y (reversed: %d) in window %d",
1243 SDL_Log(
"SDL EVENT: Joystick index %d attached",
1247 SDL_Log(
"SDL EVENT: Joystick %d removed",
1251 SDL_Log(
"SDL EVENT: Joystick %d: ball %d moved by %d,%d",
1257 const char *position =
"UNKNOWN";
1260 position =
"CENTER";
1266 position =
"RIGHTUP";
1272 position =
"RIGHTDOWN";
1278 position =
"LEFTDOWN";
1284 position =
"LEFTUP";
1292 SDL_Log(
"SDL EVENT: Joystick %d: button %d pressed",
1296 SDL_Log(
"SDL EVENT: Joystick %d: button %d released",
1300 SDL_Log(
"SDL EVENT: Controller index %d attached",
1304 SDL_Log(
"SDL EVENT: Controller %d removed",
1308 SDL_Log(
"SDL EVENT: Controller %d axis %d ('%s') value: %d",
1315 SDL_Log(
"SDL EVENT: Controller %d button %d ('%s') down",
1320 SDL_Log(
"SDL EVENT: Controller %d button %d ('%s') up",
1325 SDL_Log(
"SDL EVENT: Clipboard updated");
1329 SDL_Log(
"SDL EVENT: Finger: motion touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
1337 SDL_Log(
"SDL EVENT: Finger: %s touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
1355 SDL_Log(
"SDL EVENT: render device reset");
1358 SDL_Log(
"SDL EVENT: render targets reset");
1362 SDL_Log(
"SDL EVENT: App terminating");
1365 SDL_Log(
"SDL EVENT: App running low on memory");
1368 SDL_Log(
"SDL EVENT: App will enter the background");
1371 SDL_Log(
"SDL EVENT: App entered the background");
1374 SDL_Log(
"SDL EVENT: App will enter the foreground");
1377 SDL_Log(
"SDL EVENT: App entered the foreground");
1380 SDL_Log(
"SDL EVENT: Drag and drop beginning");
1389 SDL_Log(
"SDL EVENT: Drag and drop ending");
1392 SDL_Log(
"SDL EVENT: Quit requested");
1416 0x00FF0000, 0x0000FF00, 0x000000FF,
1418 0x000000FF, 0x0000FF00, 0x00FF0000,
1444 struct SDL_Rect rect = { 0, 0, 0, 0 };
1472 switch (event->
type) {
1480 if (window == state->
windows[i]) {
1510 if (window == state->
windows[i]) {
1550 if (currentIndex >= 0 && numDisplays >= 1) {
1553 dest = (currentIndex + numDisplays - 1) % numDisplays;
1555 dest = (currentIndex + numDisplays + 1) % numDisplays;
1557 SDL_Log(
"Centering on display %d\n", dest);
1568 const int delta = 100;
1577 SDL_Log(
"Setting position to (%d, %d)\n", x, y);
1604 printf(
"Copied text to clipboard\n");
1631 SDL_Log(
"%sapturing mouse %s!\n", shouldCapture ?
"C" :
"Unc", (rc == 0) ?
"succeeded" :
"failed");
1640 printf(
"Clipboard: %s\n", text);
1642 printf(
"Clipboard is empty\n");
1697 }
else if (withAlt) {
1708 }
else if (withShift) {
1738 SDL_Log(
"ABSOLUTE MOUSE: (%d, %d)%s%s%s%s%s\n", x, y,
1770 SDL_snprintf(message,
sizeof(message),
"(%i, %i), rel (%i, %i)\n", lastEvent.
x, lastEvent.
y, lastEvent.
xrel, lastEvent.
yrel);
1783 lastEvent =
event->motion;