---
name: "SDL_LoadBMP"
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_LoadBMP"
---

# SDL\_LoadBMP(3)

Load a BMP image from a file.

## NAME

SDL\_LoadBMP - Load a BMP image from a file.

## HEADER FILE

Defined in SDL3/SDL\_surface.h

## SYNOPSIS

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

**SDL\_Surface \* SDL\_LoadBMP(const char \*file);**

## DESCRIPTION

The new surface should be freed with

**SDL\_DestroySurface** (). Not doing so will result in a memory leak.

## FUNCTION PARAMETERS

- *file*

  the BMP file to load.

## RETURN VALUE

( **SDL\_Surface**\
  \*) Returns a pointer to a new

**SDL\_Surface**\
  structure or NULL on failure; call

**SDL\_GetError** () for more information.

## 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\_DestroySurface**(3)](/SDL_DestroySurface/3.md), **•**(3), [**SDL\_LoadBMP\_IO**(3)](/SDL_LoadBMP_IO/3.md), **•**(3), [**SDL\_SaveBMP**(3)](/SDL_SaveBMP/3.md)
