---
name: "SDL_RegisterEvents"
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_RegisterEvents"
---

# SDL\_RegisterEvents(3)

Allocate a set of user-defined events, and return the beginning event number for that set of events.

## NAME

SDL\_RegisterEvents - Allocate a set of user-defined events, and return the beginning event number for that set of events.

## HEADER FILE

Defined in SDL3/SDL\_events.h

## SYNOPSIS

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

**Uint32 SDL\_RegisterEvents(int numevents);**

## FUNCTION PARAMETERS

- *numevents*

  the number of events to be allocated.

## RETURN VALUE

( **Uint32** ) Returns the beginning event number, or 0 if numevents is invalid or if there are not enough user-defined events left.

## 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\_PushEvent**(3)](/SDL_PushEvent/3.md)
