---
name: "SDL_INIT_INTERFACE"
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_INIT_INTERFACE"
---

# SDL\_INIT\_INTERFACE(3)

A macro to initialize an SDL interface.

## NAME

SDL\_INIT\_INTERFACE - A macro to initialize an SDL interface.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

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

**#define SDL\_INIT\_INTERFACE(iface)               .BI** *do***{***.BI*        **SDL\_zerop(iface);                       .BI** *(iface)-\>version***=***sizeof(\*(iface));***.BI**    *} while (0)*

## DESCRIPTION

This macro will initialize an SDL interface structure and should be called before you fill out the fields with your implementation.

You can use it like this:

-

  ```
  SDL_IOStreamInterface iface;
  SDL_INIT_INTERFACE(&iface);
  // Fill in the interface function pointers with your implementation
  iface.seek = ...
  stream = SDL_OpenIO(&iface, NULL);
  ```

If you are using designated initializers, you can use the size of the interface as the version, e.g.

-

  ```
  SDL_IOStreamInterface iface = {
      .version = sizeof(iface),
      .seek = ...
  };
  stream = SDL_OpenIO(&iface, NULL);
  ```

## THREAD SAFETY

It is safe to call this macro from any thread.

## AVAILABILITY

This macro is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_IOStreamInterface**(3type)](/SDL_IOStreamInterface/3type.md), **•**(3), [**SDL\_StorageInterface**(3type)](/SDL_StorageInterface/3type.md), **•**(3), [**SDL\_VirtualJoystickDesc**(3type)](/SDL_VirtualJoystickDesc/3type.md)
