---
name: "SDL_EGL_SetAttributeCallbacks"
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_EGL_SetAttributeCallbacks"
---

# SDL\_EGL\_SetAttributeCallbacks(3)

Sets the callbacks for defining custom EGLAttrib arrays for EGL initialization.

## NAME

SDL\_EGL\_SetAttributeCallbacks - Sets the callbacks for defining custom EGLAttrib arrays for EGL initialization.

## HEADER FILE

Defined in SDL3/SDL\_video.h

## SYNOPSIS

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

**void SDL\_EGL\_SetAttributeCallbacks(SDL\_EGLAttribArrayCallback platformAttribCallback,**                                    **SDL\_EGLIntArrayCallback surfaceAttribCallback,**                                    **SDL\_EGLIntArrayCallback contextAttribCallback, void \*userdata);**

## DESCRIPTION

Callbacks that aren't needed can be set to NULL.

NOTE: These callback pointers will be reset after

**SDL\_GL\_ResetAttributes** .

## FUNCTION PARAMETERS

- *platformAttribCallback*

  callback for attributes to pass to eglGetPlatformDisplay. May be NULL.

- *surfaceAttribCallback*

  callback for attributes to pass to eglCreateSurface. May be NULL.

- *contextAttribCallback*

  callback for attributes to pass to eglCreateContext. May be NULL.

- *userdata*

  a pointer that is passed to the callbacks.

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
