SDL_GetJoysticks() follows the SDL_GetStringRule

This commit is contained in:
Sam Lantinga committed 2024-07-19 12:22:03 -07:00
1 parent b32c9615a7
commit 4961af4569
7 files changed
+15 -20

No files matched your search

+1 -2
View File
@@ -1187,7 +1187,7 @@ static void OpenVirtualGamepad(void)
static void CloseVirtualGamepad(void)
{
int i;
SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL);
const SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL);
if (joysticks) {
for (i = 0; joysticks[i]; ++i) {
SDL_JoystickID instance_id = joysticks[i];
@@ -1195,7 +1195,6 @@ static void CloseVirtualGamepad(void)
SDL_DetachVirtualJoystick(instance_id);
}
}
SDL_free(joysticks);
}
if (virtual_joystick) {
+1 -1
View File
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
SDL_free(SDL_GetMice(&num_mice));
SDL_Log("There are %d mice at startup\n", num_mice);
SDL_free(SDL_GetJoysticks(&num_joysticks));
SDL_GetJoysticks(&num_joysticks);
SDL_Log("There are %d joysticks at startup\n", num_joysticks);
if (enable_haptic) {