---
name: "SCREEN_W"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/SCREEN_W"
---

# SCREEN\_W(3alleg)

Global define to obtain the size of the screen. Allegro game programming library.

## NAME

SCREEN\_W, SCREEN\_H - Global define to obtain the size of the screen. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**#define SCREEN\_W;**

**#define SCREEN\_H;**

## DESCRIPTION

Global defines that return the width and height of the screen, or zero if the screen has not been initialised yet. Example:

```
   char buf[100];
   ...
   uszprintf(buf, sizeof(buf),
             "The screen size is %d x %d pixels",
             SCREEN_W, SCREEN_H);
```

## SEE ALSO

[**screen**(3alleg)](/screen/3alleg.md), [**set\_gfx\_mode**(3alleg)](/set_gfx_mode/3alleg.md), [**VIRTUAL\_W**(3alleg)](/VIRTUAL_W/3alleg.md), [**VIRTUAL\_H**(3alleg)](/VIRTUAL_H/3alleg.md)
