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

# SDL\_EGLAttribArrayCallback(3type)

EGL platform attribute initialization callback.

## NAME

SDL\_EGLAttribArrayCallback - EGL platform attribute initialization callback.

## HEADER FILE

Defined in SDL3/SDL\_video.h

## SYNOPSIS

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

**typedef SDL\_EGLAttrib \*(SDLCALL \*SDL\_EGLAttribArrayCallback)(void \*userdata);**

## DESCRIPTION

This is called when SDL is attempting to create an EGL context, to let the app add extra attributes to its eglGetPlatformDisplay() call.

The callback should return a pointer to an EGL attribute array terminated with **EGL\_NONE** . If this function returns NULL, the

**SDL\_CreateWindow**\
  process will fail gracefully.

The returned pointer should be allocated with  **SDL\_malloc** () and will be passed to  **SDL\_free** ().

The arrays returned by each callback will be appended to the existing attribute arrays defined by SDL.

## FUNCTION PARAMETERS

- *userdata*

  an app-controlled pointer that is passed to the callback.

## RETURN VALUE

Returns a newly-allocated array of attributes, terminated with **EGL\_NONE** .

## AVAILABILITY

This datatype is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_EGL\_SetAttributeCallbacks**(3)](/SDL_EGL_SetAttributeCallbacks/3.md)
