---
name: "SDL_ShouldInit"
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_ShouldInit"
---

# SDL\_ShouldInit(3)

Return whether initialization should be done.

## NAME

SDL\_ShouldInit - Return whether initialization should be done.

## HEADER FILE

Defined in SDL3/SDL\_mutex.h

## SYNOPSIS

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

**bool SDL\_ShouldInit(SDL\_InitState \*state);**

## DESCRIPTION

This function checks the passed in state and if initialization should be done, sets the status to

**SDL\_INIT\_STATUS\_INITIALIZING** and returns true. If another thread is already modifying this state, it will wait until that's done before returning.

If this function returns true, the calling code must call

**SDL\_SetInitialized** () to complete the initialization.

## FUNCTION PARAMETERS

- *state*

  the initialization state to check.

## RETURN VALUE

Returns true if initialization needs to be done, false otherwise.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_SetInitialized**(3)](/SDL_SetInitialized/3.md), **•**(3), [**SDL\_ShouldQuit**(3)](/SDL_ShouldQuit/3.md)
