---
name: "SDL_GetJoystickFromID"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetJoystickFromID"
---

# SDL\_GetJoystickFromID(3)

Get the SDL\_Joystick associated with an instance ID, if it has been opened.

## NAME

SDL\_GetJoystickFromID - Get the  **SDL\_Joystick**\
  associated with an instance ID, if it has been opened.

## HEADER FILE

Defined in SDL3/SDL\_joystick.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Joystick \* SDL\_GetJoystickFromID(SDL\_JoystickID instance\_id);**

## FUNCTION PARAMETERS

- *instance\_id*

  the instance ID to get the  **SDL\_Joystick**\
    for.

## RETURN VALUE

( **SDL\_Joystick**\
  \*) Returns an  **SDL\_Joystick**\
  on success or NULL on failure or if it hasn't been opened yet; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
