---
name: "SDL_WM_SetIcon"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_WM_SetIcon"
---

# SDL\_WM\_SetIcon(3)

Sets the icon for the display window.

## NAME

SDL\_WM\_SetIcon - Sets the icon for the display window.

## SYNOPSIS

**#include "SDL.h"**

**void SDL\_WM\_SetIcon**(**SDL\_Surface \*icon, Uint8 \*mask**);

## DESCRIPTION

Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to *SDL\_SetVideoMode*.

It takes an **icon** surface, and a **mask** in MSB format.

If **mask** is **NULL**, the entire icon surface will be used as the icon.

## EXAMPLE

```
SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);
```

## SEE ALSO

**SDL\_SetVideoMode**, **SDL\_WM\_SetCaption**
