mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-11-04 01:34:38 +00:00 
			
		
		
		
	Added USB VID/PID information to the SDL test programs
This commit is contained in:
		@@ -368,6 +368,7 @@ main(int argc, char *argv[])
 | 
				
			|||||||
            SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
 | 
					            SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
 | 
				
			||||||
            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
 | 
					            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
 | 
				
			||||||
            SDL_Log("       guid: %s\n", guid);
 | 
					            SDL_Log("       guid: %s\n", guid);
 | 
				
			||||||
 | 
					            SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
 | 
				
			||||||
            SDL_JoystickClose(joystick);
 | 
					            SDL_JoystickClose(joystick);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -435,3 +436,5 @@ main(int argc, char *argv[])
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* vi: set ts=4 sw=4 expandtab: */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -276,7 +276,9 @@ main(int argc, char *argv[])
 | 
				
			|||||||
            name = SDL_JoystickNameForIndex(i);
 | 
					            name = SDL_JoystickNameForIndex(i);
 | 
				
			||||||
            description = "Joystick";
 | 
					            description = "Joystick";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        SDL_Log("%s %d: %s (guid %s)\n", description, i, name ? name : "Unknown", guid);
 | 
					        SDL_Log("%s %d: %s (guid %s, VID 0x%.4x, PID 0x%.4x)\n",
 | 
				
			||||||
 | 
					            description, i, name ? name : "Unknown", guid,
 | 
				
			||||||
 | 
					            SDL_JoystickGetDeviceVendor(i), SDL_JoystickGetDeviceProduct(i));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", nController, SDL_NumJoysticks());
 | 
					    SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", nController, SDL_NumJoysticks());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -348,3 +350,5 @@ main(int argc, char *argv[])
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* vi: set ts=4 sw=4 expandtab: */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -274,6 +274,7 @@ main(int argc, char *argv[])
 | 
				
			|||||||
            SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
 | 
					            SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
 | 
				
			||||||
            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
 | 
					            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
 | 
				
			||||||
            SDL_Log("       guid: %s\n", guid);
 | 
					            SDL_Log("       guid: %s\n", guid);
 | 
				
			||||||
 | 
					            SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
 | 
				
			||||||
            SDL_JoystickClose(joystick);
 | 
					            SDL_JoystickClose(joystick);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -344,3 +345,5 @@ main(int argc, char *argv[])
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* vi: set ts=4 sw=4 expandtab: */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user